From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id BDE57C433F5 for ; Mon, 23 May 2022 16:09:28 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E21316B0005; Mon, 23 May 2022 12:09:27 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DD07C6B0006; Mon, 23 May 2022 12:09:27 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CE6116B0007; Mon, 23 May 2022 12:09:27 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id C27126B0005 for ; Mon, 23 May 2022 12:09:27 -0400 (EDT) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 9C1F1352B8 for ; Mon, 23 May 2022 16:09:27 +0000 (UTC) X-FDA: 79497492774.25.BCA31F4 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf25.hostedemail.com (Postfix) with ESMTP id 4D5EBA002A for ; Mon, 23 May 2022 16:08:58 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 0AF75106F; Mon, 23 May 2022 09:09:25 -0700 (PDT) Received: from wubuntu (unknown [10.57.67.228]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 9AC653F73D; Mon, 23 May 2022 09:09:23 -0700 (PDT) Date: Mon, 23 May 2022 17:09:21 +0100 From: Qais Yousef To: Mel Gorman Cc: Andrew Morton , Nicolas Saenz Julienne , Marcelo Tosatti , Vlastimil Babka , Michal Hocko , LKML , Linux-MM Subject: Re: [PATCH 3/6] mm/page_alloc: Split out buddy removal code from rmqueue into separate helper Message-ID: <20220523160921.k34jjbpd62bmc7fj@wubuntu> References: <20220512085043.5234-1-mgorman@techsingularity.net> <20220512085043.5234-4-mgorman@techsingularity.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20220512085043.5234-4-mgorman@techsingularity.net> X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 4D5EBA002A X-Stat-Signature: zaa69n7i3cu9cqqq4odt6bphhbdazk9g Authentication-Results: imf25.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf25.hostedemail.com: domain of qais.yousef@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=qais.yousef@arm.com X-Rspam-User: X-HE-Tag: 1653322138-395985 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 05/12/22 09:50, Mel Gorman wrote: > This is a preparation page to allow the buddy removal code to be reused > in a later patch. > > No functional change. > > Signed-off-by: Mel Gorman > Tested-by: Minchan Kim > Acked-by: Minchan Kim > --- I see this splat when this patch is applied on 5.10.107 kernel: [ 132.779332] CPU: 1 PID: 203 Comm: klogd Not tainted 5.10.107-00039-g83962808e276 #28 [ 132.782470] BUG: using __this_cpu_add_return() in preemptible [00000000] code: udhcpc/229 [ 132.787809] Hardware name: ARM Juno development board (r2) (DT) [ 132.787841] Call trace: [ 132.787881] dump_backtrace+0x0/0x2c0 [ 132.787921] show_stack+0x18/0x28 [ 132.787963] dump_stack_lvl+0x108/0x150 [ 132.788003] dump_stack+0x1c/0x58 [ 132.788049] check_preemption_disabled+0xf4/0x108 [ 132.788095] __this_cpu_preempt_check+0x20/0x2c [ 132.788135] __inc_numa_state+0x3c/0x120 [ 132.788177] get_page_from_freelist+0xd6c/0x1ac8 [ 132.788220] __alloc_pages_nodemask+0x224/0x1780 [ 132.797359] caller is __this_cpu_preempt_check+0x20/0x2c [ 132.803579] alloc_pages_current+0xb0/0x150 [ 132.803621] allocate_slab+0x2d0/0x408 [ 132.803662] ___slab_alloc+0x43c/0x640 [ 132.803704] __slab_alloc.isra.0+0x70/0xc8 [ 132.803747] __kmalloc_node_track_caller+0x10c/0x2d8 [ 132.803792] __kmalloc_reserve.isra.0+0x80/0x160 [ 132.803835] __alloc_skb+0xd0/0x2a8 [ 132.883893] alloc_skb_with_frags+0x64/0x2a0 [ 132.888632] sock_alloc_send_pskb+0x420/0x438 [ 132.893465] unix_dgram_sendmsg+0x1d4/0x930 [ 132.898112] __sys_sendto+0x16c/0x230 [ 132.902198] __arm64_sys_sendto+0x78/0x98 [ 132.906654] el0_svc_common.constprop.0+0xac/0x278 I could resolve it by applying this patch: diff --git a/mm/vmstat.c b/mm/vmstat.c index 80c1e0a0f094e..92fb0c08296ef 100644 --- a/mm/vmstat.c +++ b/mm/vmstat.c @@ -957,11 +957,11 @@ void __inc_numa_state(struct zone *zone, u16 __percpu *p = pcp->vm_numa_stat_diff + item; u16 v; - v = __this_cpu_inc_return(*p); + v = this_cpu_inc_return(*p); if (unlikely(v > NUMA_STATS_THRESHOLD)) { zone_numa_state_add(v, zone, item); - __this_cpu_write(*p, 0); + this_cpu_write(*p, 0); } } AFAICT zone_statistics() no longer protected by the spin_lock_irqsave(), so preemption no longer disabled. You need to have CONFIG_NUMA and CONFIG_DEBUG_PREEMPT enabled to reproduce this. HTH Thanks! -- Qais Yousef