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 5B733EB64DD for ; Sat, 22 Jul 2023 01:57:05 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8B2796B0071; Fri, 21 Jul 2023 21:57:04 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 862BF6B0072; Fri, 21 Jul 2023 21:57:04 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 72A648D0001; Fri, 21 Jul 2023 21:57:04 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 62BDF6B0071 for ; Fri, 21 Jul 2023 21:57:04 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 289478045E for ; Sat, 22 Jul 2023 01:57:04 +0000 (UTC) X-FDA: 81037584768.14.0013372 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf22.hostedemail.com (Postfix) with ESMTP id 140BCC0003 for ; Sat, 22 Jul 2023 01:57:01 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=HjFDXWFZ; spf=pass (imf22.hostedemail.com: domain of bhe@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=bhe@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1689991022; a=rsa-sha256; cv=none; b=Xm83VX5b9wMqGF480shRNCDNH3a0X7NaTQQagon42d00BVGcWwm/LmC/PA9cgDNC2Fj761 E17N2Uu+SpFxk7fKxNZAvF5+6r9M1hIBkvTCVFRM6i4LBNXAi5Cdu3Pqe/6xSYMj0lxgJ4 SzNWQKTU2dsLmLf2VRXUiJQq7pMGJPw= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=HjFDXWFZ; spf=pass (imf22.hostedemail.com: domain of bhe@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=bhe@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1689991022; h=from:from:sender: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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=jYv8A4iNWJLqBUsmWoE6MiO6/A7584+GM0NOMC65SjQ=; b=yQobpypD8vqoEWSWpEniWt9aJg1ZUkZEHeFI8kIeR2m/hR0tA9BurTFZTF/JKansLscnE7 44gyZXx4JvKwaFM+6JVNwVrH8ZBfNSWcV8QrqyCPzX56He/92E7SFsvK1L3BPJcDXPN12U YyBgw0wGBA9GszgL6L2mmtJzdetG8l8= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1689991021; 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: in-reply-to:in-reply-to:references:references; bh=jYv8A4iNWJLqBUsmWoE6MiO6/A7584+GM0NOMC65SjQ=; b=HjFDXWFZ32SiGYzo1RdUqvK50s5GyEEU3lzNn5kfJO5ekIhiQcJCdfq1rZnbL0Mu7EDxcs YBuC/F3LWZB8TVweWJCT97VbCK3v9SEOvdMSCNZx/ibXw53G9cs9VAhIfBIl7tfiYOFYlm WSTwyAueX/NAt4+gumWtYDtpzDguNfI= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-505-0_d3AoYJMze3FKf2Cz7xUA-1; Fri, 21 Jul 2023 21:56:55 -0400 X-MC-Unique: 0_d3AoYJMze3FKf2Cz7xUA-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E378386F122; Sat, 22 Jul 2023 01:56:54 +0000 (UTC) Received: from localhost (ovpn-12-31.pek2.redhat.com [10.72.12.31]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C15E7492C13; Sat, 22 Jul 2023 01:56:53 +0000 (UTC) Date: Sat, 22 Jul 2023 09:56:50 +0800 From: Baoquan He To: Dennis Zhou Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, akpm@linux-foundation.org, tj@kernel.org, cl@linux.com, mawupeng1@huawei.com Subject: Re: [PATCH 3/3] mm/percpu.c: print error message too if atomic alloc failed Message-ID: References: <20230721131800.20003-1-bhe@redhat.com> <20230721131800.20003-4-bhe@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 140BCC0003 X-Stat-Signature: pumb1mkw7ih9jks69hz4fsirurxb6gyh X-Rspam-User: X-HE-Tag: 1689991021-118594 X-HE-Meta: U2FsdGVkX19rqxY8MRYO7wb9e98Nls6lxfgQvCW2UwrL+DaDqjtrVQ12969AP8P93PHLn+58YWaRJ43G/CSqhxrgQ+ahjjZdeH7KOc/uCqCcySzp8HVh54mES0syzZU//jnmuXawHys9V+r6g35T07nEz1czib/c0b+x2XrLWPFqOq7rAt6z3zkAxmvfUeoYy4VV35j+y1C9o8StSNP9n7s+buhjPZgV872LCkdk1RzsK0PSdHtuDanpQxJI7VxL9ycMyNNCj05Y/C7iyV3Vb7bEZGlVX95VgsWs+GfSjSIT2aI63p+YWyYQQo5hLSsTE8uIWtflpIXpfv90QGXUDGlonC7xCJcDqBXS579ZZc7HZ9p43wJQCs91xKZTjgIHKHt4oZXTU+E+GCYSzJyEy9Ona3fVXKF4eQwC5bB+EfOa6JgOyADEW/gUz4rDSlKLGTgXznEzXH4t0uAR1AYPyFAFjjJGcu6z65lYZADTE089q9TU3Jfqa2E6hAfLZVdJz8dLxHgM64NTj5KUhj4acjjY8gIxrI5bZMAFQxoW2ywE+MmCrLjv9EmKPNQL43vDaOGK6WZRxwxmlSYQGZ+0x0JGu5yXiJDePt/bEMZDvm+g/NQuMFh2QewIjLd6wIPq11TGEcf8VA9VaScn87D8/nayXi3xio2CB71/Nx8rV1SVLp9onTv/PO66dI/ZmfWW9TBuKogWq/KcGeH+K0FygxwAzXSJ4eD7yIxn/82bFJ/wnUWFekBNZmEWWjVYY7oI81VldIqOmkAbXeQSDSZaEjRI9OthBUoqFk3L+D0Sm1pQSAnA7A3jf2RppG+a0EqHOcYegYB4KG7jJtJJwJLk1BRQvkBbUCKJBoPwbFDbVI1pvUjm1ChdYc+3tBizhblnpPvP1bUdRNEySeJBge2Wcz2umoYTMcaJtt2ZpM+xw26gJZiNVYRT452vfzXNkTAHSmYI9xvbqKUdPehMD9/ hF0mWGqC YVoDSaFv5ajtg2YvTnjs7en/VD0l3pJSi7T045cIxvfiP6b2JlsHYSa3L9QdCyEK9pw1AJfmG5o9lC2U28QZtXGGD0xf1HdiIHGZOP0AgWPrz9c5SGSoiZ0gucvZG8+yZX+YEGRBMj6l5U/8/FMom0RFDySenmUHUar5bwmthdSDpINzDOj8lh7xGbqbyUT4x0zluHxYG7WCNUqK4UwKD7D2U0HVRAwQI7R8c 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 07/21/23 at 02:03pm, Dennis Zhou wrote: > On Fri, Jul 21, 2023 at 09:18:00PM +0800, Baoquan He wrote: > > The variable 'err' is assgigned to an error message if atomic alloc > > failed, while it has no chance to be printed if is_atomic is true. > > > > Here change to print error message too if atomic alloc failed, while > > avoid to call dump_stack() if that case. > > > > Signed-off-by: Baoquan He > > --- > > mm/percpu.c | 6 ++++-- > > 1 file changed, 4 insertions(+), 2 deletions(-) > > > > diff --git a/mm/percpu.c b/mm/percpu.c > > index c25b058a46ad..74f75ef0ad58 100644 > > --- a/mm/percpu.c > > +++ b/mm/percpu.c > > @@ -1890,13 +1890,15 @@ static void __percpu *pcpu_alloc(size_t size, size_t align, bool reserved, > > fail: > > trace_percpu_alloc_percpu_fail(reserved, is_atomic, size, align); > > > > - if (!is_atomic && do_warn && warn_limit) { > > + if (do_warn && warn_limit) { > > pr_warn("allocation failed, size=%zu align=%zu atomic=%d, %s\n", > > size, align, is_atomic, err); > > - dump_stack(); > > + if (is_atomic) > > + dump_stack(); > > This should be (!is_atomic) to preserve the current logic? You are quite right, I must be dizzy at the moment when making change. Will fix this. Thanks for reviewing. > > > if (!--warn_limit) > > pr_info("limit reached, disable warning\n"); > > } > > + > > if (is_atomic) { > > /* see the flag handling in pcpu_balance_workfn() */ > > pcpu_atomic_alloc_failed = true; > > -- > > 2.34.1 > > > > Thanks, > Dennis >