+ mm-use-in_atomic-in-print_vma_addr.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Subject: mm: use in_atomic() in print_vma_addr()
has been added to the -mm tree.  Its filename is
     mm-use-in_atomic-in-print_vma_addr.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/mm-use-in_atomic-in-print_vma_addr.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/mm-use-in_atomic-in-print_vma_addr.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: "Yang Shi" <yang.s@xxxxxxxxxxxxxxx>
Subject: mm: use in_atomic() in print_vma_addr()

3e51f3c4004c9b ("sched/preempt: Remove PREEMPT_ACTIVE unmasking off
in_atomic()") uses in_atomic() just check the preempt count, so it is not
necessary to use preempt_count() in print_vma_addr() any more.  Replace
preempt_count() to in_atomic() which is a generic API for checking atomic
context.

in_atomic() is the preferred API for checking atomic context instead of
preempt_count() which should be used for retrieving the preemption count
value.

If we go through the kernel code, almost everywhere "in_atomic" is used
for such use case already, except two places:

- print_vma_addr()
- debug_smp_processor_id()

Both came from Ingo long time ago before 3e51f3c4004c9b01 ("sched/preempt:
Remove PREEMPT_ACTIVE unmasking off in_atomic()").  But, after this commit
was merged, use in_atomic() to follow the convention.

Link: http://lkml.kernel.org/r/1509572313-102989-1-git-send-email-yang.s@xxxxxxxxxxxxxxx
Signed-off-by: Yang Shi <yang.s@xxxxxxxxxxxxxxx>
Acked-by: Michal Hocko <mhocko@xxxxxxxx>
Cc: Frederic Weisbecker <fweisbec@xxxxxxxxx>
Cc: Ingo Molnar <mingo@xxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 mm/memory.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -puN mm/memory.c~mm-use-in_atomic-in-print_vma_addr mm/memory.c
--- a/mm/memory.c~mm-use-in_atomic-in-print_vma_addr
+++ a/mm/memory.c
@@ -4488,7 +4488,7 @@ void print_vma_addr(char *prefix, unsign
 	 * Do not print if we are in atomic
 	 * contexts (in exception stacks, etc.):
 	 */
-	if (preempt_count())
+	if (in_atomic())
 		return;
 
 	down_read(&mm->mmap_sem);
_

Patches currently in -mm which might be from yang.s@xxxxxxxxxxxxxxx are

tools-slabinfo-add-u-option-to-show-unreclaimable-slabs-only.patch
mm-slabinfo-dump-config_slabinfo.patch
mm-slabinfo-dump-config_slabinfo-v11.patch
mm-oom-show-unreclaimable-slab-info-when-unreclaimable-slabs-user-memory.patch
mm-oom-show-unreclaimable-slab-info-when-unreclaimable-slabs-user-memory-v11.patch
mm-use-in_atomic-in-print_vma_addr.patch

--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux