Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp227261rwl; Wed, 29 Mar 2023 00:28:10 -0700 (PDT) X-Google-Smtp-Source: AKy350ZQFrbIeyDS2yQzLbDfi2PPDR22KmFKtCVTwI6OXRjUay5QQW4E13Jk2ZZv0oexatk16Z6F X-Received: by 2002:a17:906:85c2:b0:88d:ba89:1837 with SMTP id i2-20020a17090685c200b0088dba891837mr1557544ejy.8.1680074889941; Wed, 29 Mar 2023 00:28:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680074889; cv=none; d=google.com; s=arc-20160816; b=d3X+WpIStf01P0FSKKcFbHzXjil70zrdA7otp1CQCW/W6wSHhp4FRhyW6GzjHquugb fs0Cz11NcmpuBwggYOWuE9ZQSn9hSvv7GsjCJu64JgzfvqKx7f+D4/VJWGQMY9F1nqsv HTr+tNZz05FVlLCVBpyPWUcPjLe8F2L6S5oGDzGee4KPWxC81xmtV7TFqCuE+HT6j4xF MWmRHPsFrNjlsbEK0LhXg6zqUjonpkzIZCS9ca7hbloe5cmzTxBcHWh25lyN88eC5Qwt hIj4Dwop12Zahm5NLqEi/GSgTV1fU+yNpy0V4/8e/6gfoo+WQQOZRqPpPyPje4f9YjcI 8aAg== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q16-20020a1709066b1000b009334da7a280si26027193ejr.693.2023.03.29.00.27.44; Wed, 29 Mar 2023 00:28:09 -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 S229987AbjC2H0t (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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit 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 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) { -- 2.34.1