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 6E96EC433F5 for ; Wed, 9 Feb 2022 11:26:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C93396B0071; Wed, 9 Feb 2022 06:26:40 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C43446B0073; Wed, 9 Feb 2022 06:26:40 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B5A9B6B0074; Wed, 9 Feb 2022 06:26:40 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id A83466B0071 for ; Wed, 9 Feb 2022 06:26:40 -0500 (EST) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 59F96182152E6 for ; Wed, 9 Feb 2022 11:26:40 +0000 (UTC) X-FDA: 79123013760.10.A89D86F Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf27.hostedemail.com (Postfix) with ESMTP id 330D84000B for ; Wed, 9 Feb 2022 11:26:37 +0000 (UTC) Received: from dggpemm500021.china.huawei.com (unknown [172.30.72.54]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4JtyGy1t4wzbk7K; Wed, 9 Feb 2022 19:25:30 +0800 (CST) Received: from dggpemm500002.china.huawei.com (7.185.36.229) by dggpemm500021.china.huawei.com (7.185.36.109) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Wed, 9 Feb 2022 19:26:31 +0800 Received: from [10.174.179.5] (10.174.179.5) by dggpemm500002.china.huawei.com (7.185.36.229) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Wed, 9 Feb 2022 19:26:30 +0800 Subject: Re: [PATCH 0/2] mm/page_alloc: Remote per-cpu lists drain support To: Nicolas Saenz Julienne , CC: , , , , , , , , , , References: <20220208100750.1189808-1-nsaenzju@redhat.com> <7c87f388-cc50-e9a1-17a7-802bb42656e4@huawei.com> From: Xiongfeng Wang Message-ID: Date: Wed, 9 Feb 2022 19:26:29 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" X-Originating-IP: [10.174.179.5] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpemm500002.china.huawei.com (7.185.36.229) X-CFilter-Loop: Reflected X-Rspamd-Queue-Id: 330D84000B X-Rspam-User: Authentication-Results: imf27.hostedemail.com; dkim=none; spf=pass (imf27.hostedemail.com: domain of wangxiongfeng2@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=wangxiongfeng2@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com X-Stat-Signature: 3x534fwarppmpsx7w3b7d8kqjxstgj8d X-Rspamd-Server: rspam04 X-HE-Tag: 1644405997-558527 Content-Transfer-Encoding: quoted-printable 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: Hi, On 2022/2/9 17:45, Nicolas Saenz Julienne wrote: > Hi Xiongfeng, thanks for taking the time to look at this. >=20 > On Wed, 2022-02-09 at 16:55 +0800, Xiongfeng Wang wrote: >> Hi Nicolas=EF=BC=8C >> >> When I applied the patchset on the following commit and tested on QEMU= , I came >> accross the following CallTrace. >> commit dd81e1c7d5fb126e5fbc5c9e334d7b3ec29a16a0 >> >> I wrote a userspace application to consume the memory. When the memory= is used >> out, the OOM killer is triggered and the following Calltrace is printe= d. I am >> not sure if it is related to this patchset. But when I reverted this p= atchset, >> the 'NULL pointer' Calltrace didn't show. >=20 > It's a silly mistake on my part, while cleaning up the code I messed up= one of > the 'struct per_cpu_pages' accessors. This should fix it: >=20 > ------------------------->8------------------------- > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > index 0caa7155ca34..e65b991c3dc8 100644 > --- a/mm/page_alloc.c > +++ b/mm/page_alloc.c > @@ -3279,7 +3279,7 @@ static void __drain_all_pages(struct zone *zone, = bool force_all_cpus) > has_pcps =3D true; > } else { > for_each_populated_zone(z) { > - pcp =3D per_cpu_ptr(zone->per_cpu_pages= et, cpu); > + pcp =3D per_cpu_ptr(z->per_cpu_pageset,= cpu); > lp =3D rcu_dereference_protected(pcp->l= p, > mutex_is_locked(&pcpu_d= rain_mutex)); > if (lp->count) { I have tested it. It works well. No more 'NULL pointer' Calltrace. Thanks, Xiongfeng > ------------------------->8------------------------- >=20 > Thanks! >=20