From patchwork Wed Mar 29 07:24:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Hajda X-Patchwork-Id: 76404 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp229892vqo; Wed, 29 Mar 2023 00:38:54 -0700 (PDT) X-Google-Smtp-Source: AKy350Yw8c1T4pvTvcLRbXesQxeowz8Q8pv3nkJ3ejqexF/63+bi2a2BsQa895EQrRjNT8SFx8GF X-Received: by 2002:a17:906:7214:b0:905:a46b:a725 with SMTP id m20-20020a170906721400b00905a46ba725mr1268619ejk.16.1680075534101; Wed, 29 Mar 2023 00:38:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680075534; cv=none; d=google.com; s=arc-20160816; b=AI6hn44cpXWInMf1cuzF3rsEUylg0OcGsJRItL/jUVD7PYWyBFdo3IyiLpYbpZ6Tlv Scs9hFHJc1i/nBJyyRMLsNBCvKr7XKrsxA8HsztIMfp7HU3IM7XFoq+ku1XAwpLEaLbd DrFlTQJ6km3x/pVElea/pB1m8Ju30X8CRD2dapFFTmQKXgdp8SQNj4d0mcWKD5y3cch5 0RwCY6E0TwJEpspyM9+HeNkF9LSNkzODCDbdlr+wGA8tc4R0cdUlQsUI2aXk+gWOaYNT VfBjJncEo4qXQNZ355u8FdP9gMYBvKxaE77uVZqAZZ2H6Y152me+IgIaY8vVmLCoULJ6 mOrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=GyYopXCNXXRMovMXZAlkOeOZRO3qBBaL4hztzkKV1mA=; b=CKCJcRPOb5qUeK7TUD7eHncaQgxR8vrZjeE82i5sfdqX/Aj017a6fgJr5BR1FduRnO tsKi0+kOKvdnGV7WYCdI1R1KRaTVHwWgKvx3TGj+N/5XvPymIPvTDeezLwrkYIKjr6XC Q62VFEQPQ1o8oAgZW0V5/45wAgWzgfurOTkYi+qHqoSeOiRRO3qCbVMTfsC9t/YK6U/I pJSaeLppj+0YWHJUzH/pqR8QqShWhkDXtUPSVtGHw7XgP7yc1EqRqsQ7RiZI4tRxZRcJ MfDkw0AZcW9lCzZPRevcsZ/u0CudRiaN4IZbZ07xyc52VVu2UuaEP3gPvd0wPTJ85zpb 2/7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=C1MofU7C; 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=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t3-20020a170906948300b0091f87d963c9si31000213ejx.633.2023.03.29.00.38.30; Wed, 29 Mar 2023 00:38:54 -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=@intel.com header.s=Intel header.b=C1MofU7C; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230148AbjC2H0t (ORCPT + 99 others); Wed, 29 Mar 2023 03:26:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230127AbjC2H0C (ORCPT ); Wed, 29 Mar 2023 03:26:02 -0400 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 90F5630C2; Wed, 29 Mar 2023 00:25:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1680074719; x=1711610719; h=from:date:subject:mime-version:content-transfer-encoding: message-id:references:in-reply-to:to:cc; bh=V3l4oFrTXgNaHDsFH5ny9LhlqFRgL1aXxFRyebnTRqc=; b=C1MofU7C1ZfVMroNkoRttYeuJnNsGduSlHpXxTy8Ciy/EqSc0ojn7I3M znLX/kxcYr+4R+9+mXq8pL0WL5I5+pJf5sqOmGlBTEnJoRQVAaBze8ePv yXOZMxX8gR4VIX+KKFGgf94egJCn6cSPzIdI8aYTLXCWYF/FbRrYXcNKA C2Rwrt68cjx8wnyLzTdPGbLEeO3kUIeiL8Nq/9N/osIWsheIw48Yc1ZON rZz/cShwhAOwU0QR56MYGf46tQsjv3lgcyVkfFJrFU8uWQ2Hc6fj8zzT+ PF8PfT/Mg9lUj69zfbaX6K4qJ/3OItliJqwbSslxfjv90mhG9CSNGUUNA g==; X-IronPort-AV: E=McAfee;i="6600,9927,10663"; a="368569763" X-IronPort-AV: E=Sophos;i="5.98,300,1673942400"; d="scan'208";a="368569763" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Mar 2023 00:24:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10663"; a="827772848" X-IronPort-AV: E=Sophos;i="5.98,300,1673942400"; d="scan'208";a="827772848" Received: from lab-ah.igk.intel.com ([10.102.138.202]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Mar 2023 00:24:45 -0700 From: Andrzej Hajda Date: Wed, 29 Mar 2023 09:24:15 +0200 Subject: [PATCH v6 4/8] lib/ref_tracker: remove warnings in case of allocation failure MIME-Version: 1.0 Message-Id: <20230224-track_gt-v6-4-0dc8601fd02f@intel.com> References: <20230224-track_gt-v6-0-0dc8601fd02f@intel.com> In-Reply-To: <20230224-track_gt-v6-0-0dc8601fd02f@intel.com> To: Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , David Airlie , Daniel Vetter Cc: linux-kernel@vger.kernel.org, intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Chris Wilson , netdev@vger.kernel.org, Eric Dumazet , Jakub Kicinski , Dmitry Vyukov , "David S. Miller" , Andi Shyti , Andrzej Hajda X-Mailer: b4 0.11.1 X-Spam-Status: No, score=-2.5 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE autolearn=unavailable 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761686883348477942?= X-GMAIL-MSGID: =?utf-8?q?1761686883348477942?= Library can handle allocation failures. To avoid allocation warnings __GFP_NOWARN has been added everywhere. Moreover GFP_ATOMIC has been replaced with GFP_NOWAIT in case of stack allocation on tracker free call. Signed-off-by: Andrzej Hajda Reviewed-by: Andi Shyti --- lib/ref_tracker.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/ref_tracker.c b/lib/ref_tracker.c index cce4614b07940f..cf5609b1ca7936 100644 --- a/lib/ref_tracker.c +++ b/lib/ref_tracker.c @@ -189,7 +189,7 @@ int ref_tracker_alloc(struct ref_tracker_dir *dir, unsigned long entries[REF_TRACKER_STACK_ENTRIES]; struct ref_tracker *tracker; unsigned int nr_entries; - gfp_t gfp_mask = gfp; + gfp_t gfp_mask = gfp | __GFP_NOWARN; unsigned long flags; WARN_ON_ONCE(dir->dead); @@ -237,7 +237,8 @@ int ref_tracker_free(struct ref_tracker_dir *dir, return -EEXIST; } nr_entries = stack_trace_save(entries, ARRAY_SIZE(entries), 1); - stack_handle = stack_depot_save(entries, nr_entries, GFP_ATOMIC); + stack_handle = stack_depot_save(entries, nr_entries, + GFP_NOWAIT | __GFP_NOWARN); spin_lock_irqsave(&dir->lock, flags); if (tracker->dead) {