Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp7178196rwp; Tue, 18 Jul 2023 11:09:15 -0700 (PDT) X-Google-Smtp-Source: APBJJlHSwlI6dQgkrUMAA0tUZi7IB4ELKew0IWKn2MTtxhuQG/XF3ufIuzw2sYqPGtEZ9ke5Vsfm X-Received: by 2002:a17:906:77d8:b0:993:d54b:3e46 with SMTP id m24-20020a17090677d800b00993d54b3e46mr423619ejn.0.1689703755401; Tue, 18 Jul 2023 11:09:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689703755; cv=none; d=google.com; s=arc-20160816; b=kR/i5xfJyHPs3kjtBQjl/Xm+f93HONMcfIbAiiN9ICsUJQ6wdGvrPzniCnMyxmN2WO Y1uXxM2Ki8FyW9T9GpNcC0qFEnRrA43rhZgb4f8dwk6gFlNlSeEZQMUpJu4rEzSrRK4+ ppgps2H4+EpHpLJSYiMIMTUBH+MKOKBpGKc9PnQBuLbyr1+R4xgHJlDf93ONsyAgJ84E WAP/EyYIGHoj170v7AYrL1WBiO/CWpmhe/XJ2Eet+sqJtZv+8+M4oRWe8//sBaBPic/U CocBechEHkHOW2jueY7WVIGeLCgxyRRxs20JgXdJSmZSlGgPuvq2H96cVLg8FWhlBILh oapw== 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 :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=G6ZvtxXz8LWuh3BEkRQdSDw1LC62Bv63uPf/N/pI/hA=; fh=JeC7FM6lNo7Br8EMPC4DmcOHKgr6JheC9VLJKs8JX1A=; b=CM7cInvHtUJsaoGrnaPu1sbTfOFZKe+waQZ9Pwwy8Gx3K/WoWE023spnTITuYKSev5 gGVkqIQA4EK+7jT6ATdiuEpTD+WKqenp6JuejS9H+ZX3XoXzyC1m+qN/zcExFqseaYs0 yaPz9TG3fRFAH/BMLImtjr6uNgcSYJuIkAFEIcpZjYD76okiuqZrCgF3QPNbOpx3P7bE eylFE9dTYouzndaMVshkIGtfEVN7Lr3FXTnZ+O/ILVDu/reKhrlgaSr0behtLfJFBXHr xinA6Fb9wKPjoKMsdz3l3KwmWoXKQVHAmhSgVZuginxb7kl7TZbrenJv2Gk9JJPTZxPz RzdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=ExelwVvv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l14-20020a1709067d4e00b00992ac0466e2si1435569ejp.653.2023.07.18.11.08.51; Tue, 18 Jul 2023 11:09:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=ExelwVvv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232391AbjGRRRm (ORCPT + 99 others); Tue, 18 Jul 2023 13:17:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48002 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233422AbjGRRRh (ORCPT ); Tue, 18 Jul 2023 13:17:37 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3C0CC1705 for ; Tue, 18 Jul 2023 10:17:37 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A16DD6167F for ; Tue, 18 Jul 2023 17:17:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CE648C433C7; Tue, 18 Jul 2023 17:17:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1689700656; bh=+hnVIU5zZw20GkGYfgr8/6QlYnCVkhQQSbU4SSZMDx0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=ExelwVvvbfz9f2iFh1sPcovf3jrbZCGCYNo3HuoHrWS22IhKYMGmb+qlDfN/XP56q VhumL5/yHIgtvTHSG0VffwaoPOXxYz8gjmQB3yn3n8SmEqhI3lv4Xkk3x0NCaeytTY xeLoXXDMUnbmlgNvEnGs5u9j05iQCt0Fns1DoEwA= Date: Tue, 18 Jul 2023 10:17:35 -0700 From: Andrew Morton To: sunran001@208suo.com Cc: dennis@kernel.org, tj@kernel.org, cl@linux.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm/percpu.c: change GFP_KERNEL to GFP_ATOMIC Message-Id: <20230718101735.aa31791899e2f9e19e8e0a75@linux-foundation.org> In-Reply-To: <7aa3a1cee63518cb13906d11ea130c9c@208suo.com> References: <20230718063328.16140-1-xujianghui@cdjrlc.com> <7aa3a1cee63518cb13906d11ea130c9c@208suo.com> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 Tue, 18 Jul 2023 14:35:11 +0800 sunran001@208suo.com wrote: > ERROR: function pcpu_balance_populated called on line 2238 inside lock > on line 2234 but uses GFP_KERNEL > > Generated by: scripts/coccinelle/locks/call_kern.cocci > > ... > > --- a/mm/percpu.c > +++ b/mm/percpu.c > @@ -2033,7 +2033,7 @@ static void pcpu_balance_free(bool empty_only) > static void pcpu_balance_populated(void) > { > /* gfp flags passed to underlying allocators */ > - const gfp_t gfp = GFP_KERNEL | __GFP_NORETRY | __GFP_NOWARN; > + const gfp_t gfp = GFP_ATOMIC | __GFP_NORETRY | __GFP_NOWARN; > struct pcpu_chunk *chunk; > int slot, nr_to_pop, ret; I don't believe this warning is correct. spin_unlock_irq(&pcpu_lock); ret = pcpu_populate_chunk(chunk, rs, rs + nr, gfp); cond_resched(); spin_lock_irq(&pcpu_lock);