Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp4409640pxb; Mon, 21 Feb 2022 20:40:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJxNYvIJ+gpJiLuXoN5iiRbuNJUmdSDWc5p38y4lzRqmD+ya56Gef5ZrNvaJ/4KaRITbbufB X-Received: by 2002:a17:90a:b398:b0:1bc:3ab0:cea7 with SMTP id e24-20020a17090ab39800b001bc3ab0cea7mr2261947pjr.222.1645504808732; Mon, 21 Feb 2022 20:40:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645504808; cv=none; d=google.com; s=arc-20160816; b=j14bk5S2d4UVSfSaEYHXnc4rGFG42ujAbF3iHaE0aoZKHCe3Dzk3aD+6e4zZL+vDcN MG0iPCyUQ7xQfX5+d/qB2ByyoN7PdWcxlCENCdj5rHGTscIaOGjA8cZKhY8L6xUm/jmC yicqigdqbU9lkyzW0c7obKa4c0uNk5Z1sq3WUn1LJeBapUtTpBRwgZFFMv05E5I27b+G uDt2Mt0FFAsoxiO77O/dKHZAPYA0AbZ4WKLiWbjutwXzB8IQ/urEj6t+FJpDzUdY97aN ORzhU6Ee5MuUr8ghel2wSo1zeGuKhXybfUXECTig0nREqq8DMAKJ8NqmFPF5QJf8BrqR TZ/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:organization :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=KeYqo4Iv0DxFajT6EK0D+BuGRFzU/S2w86hvep1F8QA=; b=oginDQ7VRDqXSan/ljG1+mwk/SEWQvnURFp0JxDT+7DGo/Ybc2g99f+iMOCMV6Iz2w 2ROklFhm8k7iaqCzY3Xv10wqF8n3i6OVY9SLE3OL1Lc1hnjK3o3ILcneYFdcY/8Wx1wN THlzbQ+BX1JUbAUECW1PfmG803g38ghKdIHxI9QIXWE6zFmlSnQX91yIn5iAel3+mN1f sXfoUNr0APezaNpRAWFvU8G+EYfoZfDkTzp9+aiJA7gDZe5UfgYv2P8jeNpuedog2dew JHT053CUbhY6H6lviLR7FMWlM99SxR6POqcttE0+iG+jah5BfLat810TPXyhkW0qv9Au +4xQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=V6knBkcb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id m8si31465677pls.500.2022.02.21.20.40.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Feb 2022 20:40:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=V6knBkcb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0137BA1BDB; Mon, 21 Feb 2022 20:27:11 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236814AbiBUX1B (ORCPT + 99 others); Mon, 21 Feb 2022 18:27:01 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:40846 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236787AbiBUX0k (ORCPT ); Mon, 21 Feb 2022 18:26:40 -0500 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3615D24F0C; Mon, 21 Feb 2022 15:26:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1645485977; x=1677021977; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=2rbHPotT4d3VveAdnF6hqk3OexpJY7+ajj6Stm674Oc=; b=V6knBkcb7sq7fmnx4KRhNhknbZmlwMhnpCKqHiwG5lFZhuFsnGAHtxLF 3czIWXTk4VayTK08NKiZgCEwRsNsgTdASgKNflX89kyrVusT5lPb37F+k 6zAc/peDTMa8Ysq7dZVSne4Fi0mt7/hZ08YdTUgl6dfSS73n7APFGWc8m nVhrzL5De19eSLdZCYCFx8hf5Rkd4u9zeW7aDmOQQ995igD+YHvG6VvGl 9cQLJNwTHaf+f0A2GO4ewomPjx2Gh3Wtf6Anc/WxOAh+uRvHlLnjYi8s4 GZjPoH/Nbs25IZzdkQKyJstAnHkFMrO9lU9ZuRx7ctCwyyO+8WTDYduNm g==; X-IronPort-AV: E=McAfee;i="6200,9189,10265"; a="338011904" X-IronPort-AV: E=Sophos;i="5.88,386,1635231600"; d="scan'208";a="338011904" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Feb 2022 15:26:17 -0800 X-IronPort-AV: E=Sophos;i="5.88,386,1635231600"; d="scan'208";a="706397046" Received: from lab-ah.igk.intel.com ([10.91.215.196]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Feb 2022 15:26:14 -0800 From: Andrzej Hajda To: linux-kernel@vger.kernel.org, intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, netdev Cc: Andrzej Hajda , Jani Nikula , Daniel Vetter , Lucas De Marchi , Chris Wilson , Eric Dumazet , Dmitry Vyukov , Jakub Kicinski Subject: [PATCH v3 07/11] lib/ref_tracker: remove warnings in case of allocation failure Date: Tue, 22 Feb 2022 00:25:38 +0100 Message-Id: <20220221232542.1481315-8-andrzej.hajda@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220221232542.1481315-1-andrzej.hajda@intel.com> References: <20220221232542.1481315-1-andrzej.hajda@intel.com> MIME-Version: 1.0 Organization: Intel Technology Poland sp. z o.o. - ul. Slowackiego 173, 80-298 Gdansk - KRS 101882 - NIP 957-07-52-316 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,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 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 --- 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 2ef4596b6b36f..cae4498fcfd70 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.25.1