Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp6172043rwr; Mon, 24 Apr 2023 15:08:59 -0700 (PDT) X-Google-Smtp-Source: AKy350Z581mMiOzRJVPFzCixWREcWNuae1BiRV0RGQnStoY/9VT7tdQFegrorEHF6PKDYQToLx9V X-Received: by 2002:a05:6a20:7d8e:b0:f2:bfe1:4867 with SMTP id v14-20020a056a207d8e00b000f2bfe14867mr12807040pzj.17.1682374138874; Mon, 24 Apr 2023 15:08:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682374138; cv=none; d=google.com; s=arc-20160816; b=XSmgzu02r+uRKGyW4L7Oce1kNljsVaBAhM5JEOPGKCGUZQWr+2LZxz+vg7tMhxbgG7 8/gim1RckvrQmDz0xBy/G3Ichb3Mjw1F9uckuFjVUsKMVLhs2ZB/KmMfVdG8FnAJfJdV xjpHNafUQdZdVtuXsTFX5AkwOKzfpbrhHtWb3icwerDaC4yz60NsYtAHrlvi5rIIyh5D 5fmD/A2UK2Yvm6utbDBNy9ouCEY/n+QmCN4KQFJ6x8GVmwdBqWxdinQdkKYycSqFvy2p Ll1hatIj4NPlR8CzZXb5vzS3sV7NmwnnxjDaEJtZ54UquGRBjTfj2oiqR63SL+Wn7a8o bEhA== 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=kJXpH+wik3uP2g5wUqL3qtZwznfw9ci6JLorCqLgbzI=; b=v2oYZrT4WdrVMBFH+hCR9CEXwnbef2wjMMWPhB5X7kpSSL3yNrD+tB0xWTyMtZRz2l s16CpBVsgLSPF75URkKCxrP9RHS5sHb4VAC0N8LCbnw9h6xNjRQ+/R2Nc5DN9F1eYnyn EAiav1F1jGHI3A//XE8hkBNOn51N2EhoXGfIytUodOtE9L98nH7/oAXqRv3KnDZgQHsE rJYeP9keJN7J6MFIF9Po7GA4Qau/UBRIrPVilrHbqwqfOUteQ5plkNp3UufGcg7jU8QF ulJway1UF+KcJdTm+9i5Q9Mji3iW1lb4PIOq1eyCArl14Y7keEsi4CfvyLSI6DvATUQf cP6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ORKByxqB; 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 r2-20020a632b02000000b0051ace49decbsi11691411pgr.769.2023.04.24.15.08.45; Mon, 24 Apr 2023 15:08:58 -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=ORKByxqB; 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 S233223AbjDXWGb (ORCPT + 99 others); Mon, 24 Apr 2023 18:06:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56288 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233182AbjDXWGQ (ORCPT ); Mon, 24 Apr 2023 18:06:16 -0400 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1908D8A40; Mon, 24 Apr 2023 15:06:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1682373967; x=1713909967; h=from:date:subject:mime-version:content-transfer-encoding: message-id:references:in-reply-to:to:cc; bh=aF+00fMmCxB5g2z9dZZXQyc7aZrPeManS84M0BOgQmc=; b=ORKByxqBPUjhYAArNQa8k4UBVM5OxY1JwAOAagCPK/PpC0Jz0/zo++9k iuNRrl992qYdFA7TaHcd+LZj+5+ftp6GQOqEsPSX719PBVIrHeE7ohxId D3aKxrewj+ZFboAxWJCCV/CYVJHazqvnZF+cNeHjUqlm7jev+5T90m0a5 2/kmB0SP/VW6q9jPSEBsNz0Sh5t9lcmeK13r4Jo+5WkikMGepEKXw0JBj PIoWQft/TBPj0wAbAf4rYv0CkJ3Xgx/51nlIzxjFCoDK2PeG43qde0bKd ZAMfl2SF3aPW5jO3D8FrmaUGsImAHdWSaI3WJeGuxKWSQUNOsX71YW7az A==; X-IronPort-AV: E=McAfee;i="6600,9927,10690"; a="335473719" X-IronPort-AV: E=Sophos;i="5.99,223,1677571200"; d="scan'208";a="335473719" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Apr 2023 15:06:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10690"; a="939500256" X-IronPort-AV: E=Sophos;i="5.99,223,1677571200"; d="scan'208";a="939500256" Received: from lab-ah.igk.intel.com ([10.102.138.202]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Apr 2023 15:06:03 -0700 From: Andrzej Hajda Date: Tue, 25 Apr 2023 00:05:41 +0200 Subject: [PATCH v8 4/7] 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-v8-4-4b6517e61be6@intel.com> References: <20230224-track_gt-v8-0-4b6517e61be6@intel.com> In-Reply-To: <20230224-track_gt-v8-0-4b6517e61be6@intel.com> To: Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , David Airlie , Daniel Vetter , Eric Dumazet Cc: linux-kernel@vger.kernel.org, intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Chris Wilson , netdev@vger.kernel.org, Jakub Kicinski , Dmitry Vyukov , "David S. Miller" , Andi Shyti , Andrzej Hajda X-Mailer: b4 0.11.1 X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00,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, T_SCC_BODY_TEXT_LINE 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 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 Reviewed-by: Eric Dumazet --- 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