Message ID | 20230224-track_gt-v5-4-77be86f2c872@intel.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2312948vqo; Tue, 28 Mar 2023 08:39:05 -0700 (PDT) X-Google-Smtp-Source: AKy350bRCGHemK1XnYhqAaG2kOYB302fMkW6sJvRmhCc+x+uCHdqSclM4vfqlwOXoqgnRYnbTFaK X-Received: by 2002:a17:906:768a:b0:930:be60:ce0c with SMTP id o10-20020a170906768a00b00930be60ce0cmr17189912ejm.71.1680017945365; Tue, 28 Mar 2023 08:39:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680017945; cv=none; d=google.com; s=arc-20160816; b=YggV+YduKz+/lr+7ZRcd3VQUz8jR0QhVHjvMpIXMA4pNttf28yWhQGYcmn8V4sNwoE wLjk+yxL6z6Y7x/3EsPLHu+Tn8TdE7/X/sP5gIa+GdHGO3mogbSqrhDy6550S/3swfpe 7kkTNQwxePw19TX3Y/QrDwTnmDKsXk/Xb+qxe0pSf2MEOA1QAv5HFih+NZnBLf92rBsY S7njhr/YzsFyQHuI2wLs6oN5++UOGnkHUTm9Q48WHdRpa7eZuEALTe7k1GJfrv5MN9oe V2ArA1W1Jq76cqNBsquJkGRFuhweAYWnEafizyDB+LjE1AxPVhFZSajMjHNsAdRLUbyy Trrw== 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=j9P5KnHAoB1za6VOUoPK88btN5BF3rLvnIBn3HoPQffD6PKWkddiPsz2PkGsQi2Jqw 2pJuG8bbnFFAKLVzKI4qfvohqx5ffrwWZfshoCIA8fK0s2oSF5O/8yDCMu5SnFsXtGen Lhe+UkbO1RqXLPKElMLvwXBlc1O6UQn914ija3HwpC+A09IyEXbhPuM5Gq7+SajCzoCU oZI73Vviev+IuhjdOBu14nLjQZwb+jJtNQKc4hbG3/sE8Q7G1UIXRClTQuBZqe8Y90ZH fSUD7AGE2qMahFN89oniaUrD8oyB2l6EFAm374FYne7GsaIFcwqHPQ3W4BkIKgnY5Q3i MmhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=KL7XwqF6; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w4-20020aa7d284000000b004fe9bb8eb0asi29804614edq.587.2023.03.28.08.38.40; Tue, 28 Mar 2023 08:39:05 -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=KL7XwqF6; 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 S234009AbjC1PSS (ORCPT <rfc822;rua109.linux@gmail.com> + 99 others); Tue, 28 Mar 2023 11:18:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55044 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230346AbjC1PRn (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 28 Mar 2023 11:17:43 -0400 Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 76BFAEB78; Tue, 28 Mar 2023 08:16:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1680016609; x=1711552609; h=from:date:subject:mime-version:content-transfer-encoding: message-id:references:in-reply-to:to:cc; bh=V3l4oFrTXgNaHDsFH5ny9LhlqFRgL1aXxFRyebnTRqc=; b=KL7XwqF6TkSV1/5HIh8nOR4qMTpZpQAJmac17MzESTu76AW5iEh3QZsR 33s7uWN6a7wMU2cZ4mOX/QWmcv1+97jMUiGwrJkUPGRRUV2P6S4vC9EFb lT0amzSLeYTYFQq52ZKdAPJ0se34ecGdb8b8gj6+K9ZBkxmsf7XpvSFDb U6/GoGHiQBMDXWtrSwNopSYfzf00xp32Lw2t01RNyluo9rRPrpqYLI0Yp zmPQoJQO0pBkVadJJaUJziywjeKXik8rx5S2lRW1oyn1AhL5lG3377ERq jcV9iU2fbA9aJLFEUMmB1PNcHBS7aqlLefl1kzZcn/ALvmHzvDTqLw3W4 w==; X-IronPort-AV: E=McAfee;i="6600,9927,10663"; a="403208688" X-IronPort-AV: E=Sophos;i="5.98,297,1673942400"; d="scan'208";a="403208688" 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 <andrzej.hajda@intel.com> 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit 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 <jani.nikula@linux.intel.com>, Joonas Lahtinen <joonas.lahtinen@linux.intel.com>, Rodrigo Vivi <rodrigo.vivi@intel.com>, Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>, David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch> Cc: linux-kernel@vger.kernel.org, intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Chris Wilson <chris@chris-wilson.co.uk>, netdev@vger.kernel.org, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Dmitry Vyukov <dvyukov@google.com>, "David S. Miller" <davem@davemloft.net>, Andrzej Hajda <andrzej.hajda@intel.com>, Andi Shyti <andi.shyti@linux.intel.com> X-Mailer: b4 0.11.1 X-Spam-Status: No, score=-2.5 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE autolearn=unavailable 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761626497177133770?= X-GMAIL-MSGID: =?utf-8?q?1761626497177133770?= |
Series |
drm/i915: use ref_tracker library for tracking wakerefs
|
|
Commit Message
Andrzej Hajda
March 28, 2023, 3:15 p.m. UTC
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 <andrzej.hajda@intel.com> Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com> --- 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) {