From patchwork Tue Mar 28 15:15:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Hajda X-Patchwork-Id: 13191215 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 044EDC6FD18 for ; Tue, 28 Mar 2023 15:16:03 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F3DEC10E030; Tue, 28 Mar 2023 15:16:01 +0000 (UTC) Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4C7A910E91C; Tue, 28 Mar 2023 15:16:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1680016560; x=1711552560; h=from:date:subject:mime-version:content-transfer-encoding: message-id:references:in-reply-to:to:cc; bh=V3l4oFrTXgNaHDsFH5ny9LhlqFRgL1aXxFRyebnTRqc=; b=jQCfblzClk6TTuc/Hh1SL9TV79etJIcwuHXCdifX8SH4nGrkylbCHOW2 wc5rj10Qm28HMJRb5UkeEGUdN55pRj7JZiVPLdN5xD0d6lW3pRjcIrRuO l4zDjXTjIaIML0AYK8mMM412R6KvPf5bTJcAP1iKwwmlT6hEEAIr+qdad ZDJBQ7cYyI2VOMHWQ9YRQQTtgPRpt9fKBX5rY6VvzMSAhRZE7nX03KHVC 4hfmEjWxVctRSyMbBdNfqLQwQNFDUOBcBZoksyZJBgHncr2zj7fJaafHK 6rCfc6lnwidB0AyxaANXwDYcIBfeeQpxr9vs5Ao1MEEEhKv2KEcqKBcic Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10663"; a="403208690" X-IronPort-AV: E=Sophos;i="5.98,297,1673942400"; d="scan'208";a="403208690" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Mar 2023 08:15:59 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10663"; a="773181764" X-IronPort-AV: E=Sophos;i="5.98,297,1673942400"; d="scan'208";a="773181764" Received: from lab-ah.igk.intel.com ([10.102.138.202]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Mar 2023 08:15:56 -0700 From: Andrzej Hajda Date: Tue, 28 Mar 2023 17:15:27 +0200 Subject: [PATCH v5 4/8] lib/ref_tracker: remove warnings in case of allocation failure MIME-Version: 1.0 Message-Id: <20230224-track_gt-v5-4-77be86f2c872@intel.com> References: <20230224-track_gt-v5-0-77be86f2c872@intel.com> In-Reply-To: <20230224-track_gt-v5-0-77be86f2c872@intel.com> To: Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , David Airlie , Daniel Vetter X-Mailer: b4 0.11.1 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andi Shyti , netdev@vger.kernel.org, intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Chris Wilson , Eric Dumazet , Andrzej Hajda , Jakub Kicinski , "David S. Miller" , Dmitry Vyukov Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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) {