Commit d56c1584 authored by Miaohe Lin's avatar Miaohe Lin Committed by akpm

mm: compaction: clean up comment for sched contention

Since commit cf66f070 ("mm, compaction: do not consider a need to
reschedule as contention"), async compaction won't abort when scheduling
is needed.  Correct the relevant comment accordingly.

Link: https://lkml.kernel.org/r/20220418141253.24298-5-linmiaohe@huawei.comSigned-off-by: default avatarMiaohe Lin <linmiaohe@huawei.com>
Cc: Charan Teja Kalla <charante@codeaurora.org>
Cc: David Hildenbrand <david@redhat.com>
Cc: Pintu Kumar <pintu@codeaurora.org>
Cc: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent 00bc102f
...@@ -513,15 +513,12 @@ static bool compact_lock_irqsave(spinlock_t *lock, unsigned long *flags, ...@@ -513,15 +513,12 @@ static bool compact_lock_irqsave(spinlock_t *lock, unsigned long *flags,
* very heavily contended. The lock should be periodically unlocked to avoid * very heavily contended. The lock should be periodically unlocked to avoid
* having disabled IRQs for a long time, even when there is nobody waiting on * having disabled IRQs for a long time, even when there is nobody waiting on
* the lock. It might also be that allowing the IRQs will result in * the lock. It might also be that allowing the IRQs will result in
* need_resched() becoming true. If scheduling is needed, async compaction * need_resched() becoming true. If scheduling is needed, compaction schedules.
* aborts. Sync compaction schedules.
* Either compaction type will also abort if a fatal signal is pending. * Either compaction type will also abort if a fatal signal is pending.
* In either case if the lock was locked, it is dropped and not regained. * In either case if the lock was locked, it is dropped and not regained.
* *
* Returns true if compaction should abort due to fatal signal pending, or * Returns true if compaction should abort due to fatal signal pending.
* async compaction due to need_resched() * Returns false when compaction can continue.
* Returns false when compaction can continue (sync compaction might have
* scheduled)
*/ */
static bool compact_unlock_should_abort(spinlock_t *lock, static bool compact_unlock_should_abort(spinlock_t *lock,
unsigned long flags, bool *locked, struct compact_control *cc) unsigned long flags, bool *locked, struct compact_control *cc)
...@@ -574,7 +571,7 @@ static unsigned long isolate_freepages_block(struct compact_control *cc, ...@@ -574,7 +571,7 @@ static unsigned long isolate_freepages_block(struct compact_control *cc,
/* /*
* Periodically drop the lock (if held) regardless of its * Periodically drop the lock (if held) regardless of its
* contention, to give chance to IRQs. Abort if fatal signal * contention, to give chance to IRQs. Abort if fatal signal
* pending or async compaction detects need_resched() * pending.
*/ */
if (!(blockpfn % SWAP_CLUSTER_MAX) if (!(blockpfn % SWAP_CLUSTER_MAX)
&& compact_unlock_should_abort(&cc->zone->lock, flags, && compact_unlock_should_abort(&cc->zone->lock, flags,
......
...@@ -402,7 +402,7 @@ struct compact_control { ...@@ -402,7 +402,7 @@ struct compact_control {
bool direct_compaction; /* False from kcompactd or /proc/... */ bool direct_compaction; /* False from kcompactd or /proc/... */
bool proactive_compaction; /* kcompactd proactive compaction */ bool proactive_compaction; /* kcompactd proactive compaction */
bool whole_zone; /* Whole zone should/has been scanned */ bool whole_zone; /* Whole zone should/has been scanned */
bool contended; /* Signal lock or sched contention */ bool contended; /* Signal lock contention */
bool rescan; /* Rescanning the same pageblock */ bool rescan; /* Rescanning the same pageblock */
bool alloc_contig; /* alloc_contig_range allocation */ bool alloc_contig; /* alloc_contig_range allocation */
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment