Received: by 2002:a05:6358:701b:b0:131:369:b2a3 with SMTP id 27csp423831rwo; Fri, 21 Jul 2023 14:17:10 -0700 (PDT) X-Google-Smtp-Source: APBJJlHdyXKGjRzmpZHcZJ8MyITNyd9Cr9w4AXLtX8OmSimYODYoQyjtFcxWl4u8WQSxElGrwB6Q X-Received: by 2002:aa7:c382:0:b0:521:db0e:93d9 with SMTP id k2-20020aa7c382000000b00521db0e93d9mr2553284edq.40.1689974230143; Fri, 21 Jul 2023 14:17:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689974230; cv=none; d=google.com; s=arc-20160816; b=id9SZmJnnlzhR4rcCdT4XuXXtghHhVUDs+kl9oBpqCktqIr02m7RKWmCmUOKsavYPh lwK6lSoecDT3JOQVn3VmOF5yPpIFQhwdgonTQJbl0Q/pd/agfhPMEN3wFA5cr9JfEC/T V4aEgCkfKnkZolwU02zwlfL2foLdJBTI4n0U9fhlJCBiSE++9ldAs1cqLwB4IFI5b0ws PNflvDolx2nJEXAOpn+0Rus5l96rLrZv4VB7WMWVTIivmUCSUDfQO8YXJD/vPMT1RXbf rP8L/heiZAt442QgCEwC7Wg5ABMAXEO5jyzdmlEaWjM9zvYZBBteYbSaTG3apkNcPxBZ parg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=HmvlwLqe/HyMXG8CYpAUMk+EWmV9FBll7iWhqk+njS0=; fh=YmJ1iUMfRSyWkFG++qcA8D6FYjlnldA+ddrk6xZRPQo=; b=cJTrdn0y9JUCmTPXYB+Z9MxvcJNBAc25Exu3gb+qIzoN03BTDFMrHIl4/ysg+aqTiv B1vQmDYEgcfJvHIqRkmfCSxg6YjG45Ovx+s45bie1zlo4fBciREx0V6JTwKbKi5YcuVz cef8Uz85SkmLavI+LZrcUZIXc6El4Ux8vcIjrVBY5RtGTq6KBcX7dDbT7FI7wbzq7B0c Oshz4a2EXHkfcFEs4vn8cZSCItFDqSvorOgt2WzuR1r/3v2+ldR1+A875DrWvnKYBnae EWPWzVnRTau+KhSQuuBWyPPIGSeR3oO2CO500xa+owiQyvvO0tsbuG5AR7nGG1M/5ni4 amIA== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x18-20020aa7d6d2000000b0051e0d3bb44fsi2678508edr.21.2023.07.21.14.16.45; Fri, 21 Jul 2023 14:17:10 -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; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230309AbjGUVDG (ORCPT + 99 others); Fri, 21 Jul 2023 17:03:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33316 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229902AbjGUVDE (ORCPT ); Fri, 21 Jul 2023 17:03:04 -0400 Received: from mail-io1-f51.google.com (mail-io1-f51.google.com [209.85.166.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9D2EA1FD2 for ; Fri, 21 Jul 2023 14:03:03 -0700 (PDT) Received: by mail-io1-f51.google.com with SMTP id ca18e2360f4ac-78625caa702so100038039f.1 for ; Fri, 21 Jul 2023 14:03:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689973383; x=1690578183; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=HmvlwLqe/HyMXG8CYpAUMk+EWmV9FBll7iWhqk+njS0=; b=Zb15Kt5EZYqDvvhRZhvE+IwXyR1o+/82Vi1OhLBv/fblZY24NkJkOFlhFnbq+lBDRS TRfHLnbPRuVQhYFFRB5GQnFG5Xz/KSXoSWJwAlyay1ElOjqTkGb5GjnZmb2o6YbRmknv /D8+GEo3cUDxTCTASVD+VgtfuCpLGSEANNYKlRZ74iJskZ0nIZV7cRkGR8IuRQaytxyX P4winADvpxd2xX9fJObZE3M834EUJVwDTtWk0kaQq7k3pX9TQO/dGIJfcTKrruzTrXIN trv+ocq2rJEejux/j+3HWs73Qoz5PzSAHXqtXyHAveDyWAHnYDse7/MR9CjIqs+nWJZ0 eDTg== X-Gm-Message-State: ABy/qLbJ47Tm/FIzJqZp2cW7AQH8QFOJEorvuAh+3QrI4p78vWjEXaBj IZTj6j859tGyQF59fu2i9aZISvFGOXw= X-Received: by 2002:a6b:6d02:0:b0:783:5e93:1e7f with SMTP id a2-20020a6b6d02000000b007835e931e7fmr1072143iod.18.1689973382836; Fri, 21 Jul 2023 14:03:02 -0700 (PDT) Received: from snowbird ([2601:282:1800:1f50::d356]) by smtp.gmail.com with ESMTPSA id w22-20020a05660201d600b007836a9ca101sm1343263iot.22.2023.07.21.14.03.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Jul 2023 14:03:02 -0700 (PDT) Date: Fri, 21 Jul 2023 14:03:00 -0700 From: Dennis Zhou To: Baoquan He 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: <20230721131800.20003-4-bhe@redhat.com> X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no 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 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? > 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