Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp4355190pxb; Mon, 21 Feb 2022 18:55:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJzQv2ZWNoPn0YIMwKHNpl/tMmxcN4ABHy+poZiQ+fvpCg42DBE8qXUqLGI2Yvpe1LKgVf/c X-Received: by 2002:aa7:c251:0:b0:404:769b:adb3 with SMTP id y17-20020aa7c251000000b00404769badb3mr24848381edo.98.1645498552093; Mon, 21 Feb 2022 18:55:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645498552; cv=none; d=google.com; s=arc-20160816; b=y5K34RvIQipU6Jj4Coato4+pPi94zKm45c/jKK8gWSaoCmgpjHbKsNwtUvEj0hWXC4 Ulv00zy1abTvepRXir9v25M6gx1Ri9PjQSs3MVcD6Pj/GcKSryQmGXrYFKizcGxLDvs0 zDAIzcmnhFpQeXQ+PlTGt9+nvwwuCEXQc8+uZLUhrsUJNAjqLLT70AUo8kqkx6aBjxIX nLoBC/B1U+jZN0qtm+w+0UM788NpDWwn48f2Izd87huYpp9QgNvQ2p229mYHRvWE7/oi MAtXFRhKHsxWniWkytuwsy2TVQ5bYT5G+Tv08rzK3n0BxReU0d/1W8seaxSAsvcyfz/u +5SA== 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=fsirc0fYaoYh79jfZ9OyhvLw2YFiqAHMXrXpvGrtIKPb34L8qXZwSK+HG9eZac9q6P DYRxV0Y7b/tIx2ZAxG7R2ARno6zXr+H34v16FboV6ZVBTQI6yk+tSBs1zDqEjPhyTmiK hjDBdqWCLY3z7bfxBsb6Jq50M2kowoSlu3LhV6sEIuARuko/b+NA1xgHAjaAwQxl7Gre mBd11PisiLoDwfP4B5v8epG3bllpI0bRaThXM6gAVuYjAoZrGdGPzas9SVJKakxxX02i VWRpPoBLN+CTnM5ncMhAvhVnEmGj113PKh94nHDnDV90JaJWJuxNaRLHSDprAl1X/vDg BsOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=bUSDeOko; 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 sc26si10775820ejc.923.2022.02.21.18.55.29; Mon, 21 Feb 2022 18:55:52 -0800 (PST) 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=bUSDeOko; 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 S236631AbiBUXTG (ORCPT + 99 others); Mon, 21 Feb 2022 18:19:06 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:33824 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236480AbiBUXSk (ORCPT ); Mon, 21 Feb 2022 18:18:40 -0500 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9EA4A24F30; Mon, 21 Feb 2022 15:18:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1645485492; x=1677021492; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=2rbHPotT4d3VveAdnF6hqk3OexpJY7+ajj6Stm674Oc=; b=bUSDeOko8aQWJiStkQK/B0FHeVZ7PKXyiqaVNtvlNKr3h/JfWQr//VUi I37LXMUZ58lgbfSaGx7Xj47jebz4rVAfWCG8zQBub56xnVN1tt6DB/+ga yyYTk88W/GdK0iyk2lpuSTSysIotPlhaxkHImKvCsA+s3N0e/HBRyGBIS a6J0V7M/zmQZxjbbZTRzhLn3KOOHlt6gqbs4+8TvPp5TWEzcRz2LRgaTb DwGRxBSGA259QXK/Wea0MFl6w3lLfLMRykW6JLlW+9ZjD051ed/RwFwQx L9A+4l/3z65rqzWnBBDc8Z0tqXu9rDK5TWYAAnELHMA5ZrTjQCWDT20Ag g==; X-IronPort-AV: E=McAfee;i="6200,9189,10265"; a="251530456" X-IronPort-AV: E=Sophos;i="5.88,386,1635231600"; d="scan'208";a="251530456" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Feb 2022 15:18:12 -0800 X-IronPort-AV: E=Sophos;i="5.88,386,1635231600"; d="scan'208";a="638694575" Received: from lab-ah.igk.intel.com ([10.91.215.196]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Feb 2022 15:18:09 -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 v2 07/11] lib/ref_tracker: remove warnings in case of allocation failure Date: Tue, 22 Feb 2022 00:16:59 +0100 Message-Id: <20220221231705.1481059-18-andrzej.hajda@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220221231705.1481059-1-andrzej.hajda@intel.com> References: <20220221231705.1481059-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=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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 --- 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