Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit182f3d7

Browse files
Muchun Songtorvalds
Muchun Song
authored andcommitted
mm/page_alloc.c: skip setting nodemask when we are in interrupt
When we are in the interrupt context, it is irrelevant to the current taskcontext. If we use current task's mems_allowed, we can be fair to allocpages in the fast path and fall back to slow path memory allocation whenthe current node(which is the current task mems_allowed) does not haveenough memory to allocate. In this case, it slows down the memoryallocation speed of interrupt context. So we can skip setting thenodemask to allow any node to allocate memory, so that fast pathallocation can success.Signed-off-by: Muchun Song <songmuchun@bytedance.com>Signed-off-by: Andrew Morton <akpm@linux-foundation.org>Reviewed-by: Pekka Enberg <penberg@kernel.org>Cc: David Hildenbrand <david@redhat.com>Link:http://lkml.kernel.org/r/20200706025921.53683-1-songmuchun@bytedance.comSigned-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parentda41566 commit182f3d7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

‎mm/page_alloc.c‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4788,7 +4788,11 @@ static inline bool prepare_alloc_pages(gfp_t gfp_mask, unsigned int order,
47884788

47894789
if (cpusets_enabled()) {
47904790
*alloc_mask |=__GFP_HARDWALL;
4791-
if (!ac->nodemask)
4791+
/*
4792+
* When we are in the interrupt context, it is irrelevant
4793+
* to the current task context. It means that any node ok.
4794+
*/
4795+
if (!in_interrupt()&& !ac->nodemask)
47924796
ac->nodemask=&cpuset_current_mems_allowed;
47934797
else
47944798
*alloc_flags |=ALLOC_CPUSET;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp