Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp2108967rwr; Fri, 21 Apr 2023 04:37:12 -0700 (PDT) X-Google-Smtp-Source: AKy350aj9TwpymoSfr37CLzPtL1aK8Raiyy2W4poMdosVa8x3w3iX4ql0Vamdlfk/O+ObwZEUOih X-Received: by 2002:a17:903:2304:b0:1a9:1b4:9fdd with SMTP id d4-20020a170903230400b001a901b49fddmr5572934plh.2.1682077031695; Fri, 21 Apr 2023 04:37:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682077031; cv=none; d=google.com; s=arc-20160816; b=RodffAvjhG2VREKxKkOocyfGhII1TyHBWcCYfh3QZKbXgqxgu+7C9LQdcKRev//OKg 6mI+LwHGr3h5nwfz4zt7ns9C+VQYSMZK83WLNJMlhxNbOGB0fk06sxa2tY37eGSJLcMU gROdzATm0sLyWrEot8HCY8tz3CC32aXR3GwJTtvlC4+FhXPktGbuAjcV7TKiTkUKoRnf +WaK9pta5qlyt0ON2kdAxoysUvnoV8gpvlqTLp38B5ju7eqGNdzKXaTnKL15IbK0gw5+ Omt1KcAGU6l6VeGB+bhbsK7O79e671fHivC0H7Nw4zs9kB/I8z1mhnj1M+WPmb5WmOel 4KZA== 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=tf5LUQQl2Tv0kyJjfr4mgr6wF/5AIaEki+j26Db5EfwQ2T3DWuyowUMN4olwAlfjJ/ YekC0KPZhkMUXmrjc/ndnlh7uuTInO3VPyFSxKI3gqlXCNqiRXw67UScu3Te7k6bUVCB HlUY7547hrV/J17bbGWsGt+94yLHpeIpDjJWaK4Kpn0e8VwCJTS5B9TTnwWSsM1mjQTB cKfRMhuUDANIylfEcsuMT6GdNvI8u0wKW+LzLJuafyZIEq1/axmxxNQWajnUxyhYvjyt CGNRoWtqLv11yP35LoZZNYwjWRwMR7i0CZxJYEs9iSsas7DYD7xmWNsd7lRmsQ+oqSzZ O6JQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=UUcKzkEP; 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 x6-20020a170902a38600b001a1deff6062si3900169pla.281.2023.04.21.04.36.59; Fri, 21 Apr 2023 04:37:11 -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=UUcKzkEP; 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 S231880AbjDULfy (ORCPT + 99 others); Fri, 21 Apr 2023 07:35:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58590 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231778AbjDULfo (ORCPT ); Fri, 21 Apr 2023 07:35:44 -0400 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0E974C66B; Fri, 21 Apr 2023 04:35:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1682076933; x=1713612933; h=from:date:subject:mime-version:content-transfer-encoding: message-id:references:in-reply-to:to:cc; bh=V3l4oFrTXgNaHDsFH5ny9LhlqFRgL1aXxFRyebnTRqc=; b=UUcKzkEPDmaTyMUSw4yf7QxccGqHgXY/cuHxEOIxV2W46seGFR897jNw 8hNoYIrDx8VxbQqR6b0xMzrGNbeN4SOiwAsxsw8C+J5w9GnfDK2LqYfsY 11O+YmweFrq3SlB7TKB62zoBf00gmUqV5DFqGLyZ90ZwSkwCp/42P20YU fXwOt0Jex93bFGnomW5dB+Dr/e4996I5Z0J2YeeumVeOnGfQRd/hzm2AW tEjVgh/p1A5SYlt06V/lMSoCVLar9XevNjQc4035DU81zIpZYOKXGlgUF ritHe5fi4t7NwEpZu99+O9fEqsO3Ea6cPTq1FhgsTdHomi6/IjCQyApQg Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10686"; a="432249899" X-IronPort-AV: E=Sophos;i="5.99,214,1677571200"; d="scan'208";a="432249899" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Apr 2023 04:35:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10686"; a="642489666" X-IronPort-AV: E=Sophos;i="5.99,214,1677571200"; d="scan'208";a="642489666" Received: from lab-ah.igk.intel.com ([10.102.138.202]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Apr 2023 04:35:28 -0700 From: Andrzej Hajda Date: Fri, 21 Apr 2023 13:35:07 +0200 Subject: [PATCH v7 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-v7-4-11f08358c1ec@intel.com> References: <20230224-track_gt-v7-0-11f08358c1ec@intel.com> In-Reply-To: <20230224-track_gt-v7-0-11f08358c1ec@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=-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,URIBL_BLOCKED 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 --- 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