Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp1785527pxb; Wed, 9 Feb 2022 04:34:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJzFKpwJ7nnVpYKfmzWD8Srir++F7j08xJYWiMSQEbZiBOM8QWA9a8+RXVb4L7mgwuD9b1jx X-Received: by 2002:a17:90b:4a85:: with SMTP id lp5mr3212967pjb.25.1644410085744; Wed, 09 Feb 2022 04:34:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644410085; cv=none; d=google.com; s=arc-20160816; b=eBtSJk7aUExKPdBdoNKWod0GLZyCJNMnuA92Zi5Y2/9R5jVK8R/iMJ53lpaMaedq6w WJsFkgr6kIGRwm+v4VR1BhwdWz6Xam75tZ0UFzLmT+3QfP5ofoEJtrzXATvmgubFJNak Xw4ot9RHurSaTf7x3YCuGvYXD/Zy5q4rThbRqcjUKi2DOYEAhXzvbF12/jP1ieK+Bwnz enteJFp4fKn1eQ2rFekNo84ojqsByyFuxKnj44zDy0mVw0tflB0hL1W2GImmydh/i8XH muhRkcO7pTiXCyAv5vKzXhogNlrq13Cg9xQ43zEj5Gvl9JvSnj+59/Tbvw3NAjnBeKK3 qe4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:dkim-signature; bh=XfermB6CMKU1zKQ537x6yTA+IzQs5j2AWlksK8pCcRU=; b=IFrMLsV8eiK2IgFIVpEn0JgpmfFkhWXHgzBGcP5YMUTPhh2DdUG69TrHdZxFXSVTSa JJHXhBcYGTGKmDcChF06XvGDmfT+akU0MrJjlaRrNRysu4XTqskWtOg93whwaMj5OGY7 lwN5EtWjsypQK7pPQXcDtH00bfd77Id93v2Rlp8NSFU+1CxcmWYrUJ6rf2A/M7LL+njc KcXvYbFLMkBzS2NkFmRGB0RCtaKllrppnfosbZxVnjl2TQDRyflEKsZKrvZspbMZgEFZ yr2V8KrpAekvGeEFoV0mXCZ3sQhLQoFWQ8y/hBE2LYYzWl2OLROqabYvHD9m6QElmVHj ZTHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=RTTwdLCV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u26si16893256pfg.1.2022.02.09.04.34.32; Wed, 09 Feb 2022 04:34:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=RTTwdLCV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231167AbiBIMDo (ORCPT + 99 others); Wed, 9 Feb 2022 07:03:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39114 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229541AbiBIMDL (ORCPT ); Wed, 9 Feb 2022 07:03:11 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 08873C03C180 for ; Wed, 9 Feb 2022 03:36:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1644406567; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XfermB6CMKU1zKQ537x6yTA+IzQs5j2AWlksK8pCcRU=; b=RTTwdLCVIBcSbOth+M/OZx1x1gfPdvw8oOU6lo31GHp+gjyFd2vdt8RwPD7Yc1HJWNZQC8 HD5FfEH5rYcy/JJBsOvzdglnhvbBvUeIKZT6ECuNMOF0t+UmobjdNqwvfmITtyCvXRQSUe 7QG+1SsK47G/UVxH7Bwksamf8nnAB0Y= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-592-_M7WPzw_MVGb_NkfRXv0aw-1; Wed, 09 Feb 2022 06:36:06 -0500 X-MC-Unique: _M7WPzw_MVGb_NkfRXv0aw-1 Received: by mail-wm1-f72.google.com with SMTP id p24-20020a05600c1d9800b0037be98d03a1so1946479wms.0 for ; Wed, 09 Feb 2022 03:36:06 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=XfermB6CMKU1zKQ537x6yTA+IzQs5j2AWlksK8pCcRU=; b=sNYnyzalmzHxUrSusOZcIOmdFxQdkeuNcqeNp/McF+Aaz8f+fU6rMm5ISPGfxOuZm1 Ta6nmMlzVz8Q2vPw96VNbZewLZH5LJTlyp24oITyasPCzlkwCL8/BlAkEZuTWcE61JSd eK4fGzVNoD2smdGY7n39Qf0c+vC+7JtkUfYwsSyzA9hQAyuFY1zb6Xl9l7GsVwOVnEKC KNG2qVi8Nv9cRSsmQVFMHR2E9lUl+59B6VynpNa8zjoUJ0XGPgSxfBlpVj7QEuLwXVZg 8cgPo4hOsKDh1SG2USo/KNQRKZGrl9+T/k8ZSmfYp47KFJxwrVQDSNnXn7pBcQsQGLZu DMyg== X-Gm-Message-State: AOAM531j6j9CmfkdFdVmEou3T/m0CcbOMYuAxX5LnK5CBdMnBrtiKDf+ 8jfkMVZ7Ci/SHHrbAU5kbx+Z+KCrfWF7CC4skD+TeU+/Z0y+O/6YsuKRAzkZji1ZZHrLCcV1WSO Aaf6ibyT3u6z3B82kNFRbtiqN X-Received: by 2002:a05:600c:3b97:: with SMTP id n23mr640442wms.116.1644406564898; Wed, 09 Feb 2022 03:36:04 -0800 (PST) X-Received: by 2002:a05:600c:3b97:: with SMTP id n23mr640405wms.116.1644406564445; Wed, 09 Feb 2022 03:36:04 -0800 (PST) Received: from ?IPv6:2a0c:5a80:1204:1500:37e7:8150:d9df:36f? ([2a0c:5a80:1204:1500:37e7:8150:d9df:36f]) by smtp.gmail.com with ESMTPSA id z17sm4531039wmf.11.2022.02.09.03.36.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Feb 2022 03:36:04 -0800 (PST) Message-ID: <035d9c7a21eb024e336dce0942fa3f85b864aaea.camel@redhat.com> Subject: Re: [PATCH 0/2] mm/page_alloc: Remote per-cpu lists drain support From: Nicolas Saenz Julienne To: Xiongfeng Wang , akpm@linux-foundation.org Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, frederic@kernel.org, tglx@linutronix.de, mtosatti@redhat.com, mgorman@suse.de, linux-rt-users@vger.kernel.org, vbabka@suse.cz, cl@linux.com, paulmck@kernel.org, willy@infradead.org Date: Wed, 09 Feb 2022 12:36:02 +0100 In-Reply-To: References: <20220208100750.1189808-1-nsaenzju@redhat.com> <7c87f388-cc50-e9a1-17a7-802bb42656e4@huawei.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.3 (3.42.3-1.fc35) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2022-02-09 at 19:26 +0800, Xiongfeng Wang wrote: > Hi, > > On 2022/2/9 17:45, Nicolas Saenz Julienne wrote: > > Hi Xiongfeng, thanks for taking the time to look at this. > > > > On Wed, 2022-02-09 at 16:55 +0800, Xiongfeng Wang wrote: > > > Hi Nicolas, > > > > > > 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 printed. I am > > > not sure if it is related to this patchset. But when I reverted this patchset, > > > the 'NULL pointer' Calltrace didn't show. > > > > 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: > > > > ------------------------->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 = true; > > } else { > > for_each_populated_zone(z) { > > - pcp = per_cpu_ptr(zone->per_cpu_pageset, cpu); > > + pcp = per_cpu_ptr(z->per_cpu_pageset, cpu); > > lp = rcu_dereference_protected(pcp->lp, > > mutex_is_locked(&pcpu_drain_mutex)); > > if (lp->count) { > > I have tested it. It works well. No more 'NULL pointer' Calltrace. Thanks! -- Nicolás Sáenz