Message ID | 20230224-track_gt-v8-4-4b6517e61be6@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 b10csp3037657vqo; Mon, 24 Apr 2023 15:25:11 -0700 (PDT) X-Google-Smtp-Source: AKy350Z6diqdY0ISxH1p2srJ+f8TTUxJAnJbpMSVktD+QlU6N3udhHOn1zwuECZ1uZOlZwkFGKlE X-Received: by 2002:a17:902:ea03:b0:1a6:961e:fcfe with SMTP id s3-20020a170902ea0300b001a6961efcfemr19230030plg.30.1682375111148; Mon, 24 Apr 2023 15:25:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682375111; cv=none; d=google.com; s=arc-20160816; b=LU+R6/yqKJ7UDbB3Mc1O744XF7QkfoH9QUnz/x2AS18SlqMEpbfORIyYwx4aY/PxiR 1vcXpD0mqDpAdFvP7JNTmWoK1wSdDtECB8hBKzKSfFc9BNR9inJsf6qeUAFC5H7S8b2c UitTQWTRJury5KnIEoFhxQ427qlgqrOxdCQ4+GIc7zzM0VHGqM1kSRdP5gZpxQJi3woD Y/x+R98hkGiB98nat1lj/kp4p7WfT5Ay91Wy3DYRb1Uktlq8FulAaASyq9EwlDK3uKzK A1YPsDt3IiTIuiD+2bNuqsnRP466mPeDOcr/6G9T+wcDh67TUGJdltyKz2/MucKHqSJD HNUg== 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=kJXpH+wik3uP2g5wUqL3qtZwznfw9ci6JLorCqLgbzI=; b=v2oYZrT4WdrVMBFH+hCR9CEXwnbef2wjMMWPhB5X7kpSSL3yNrD+tB0xWTyMtZRz2l s16CpBVsgLSPF75URkKCxrP9RHS5sHb4VAC0N8LCbnw9h6xNjRQ+/R2Nc5DN9F1eYnyn EAiav1F1jGHI3A//XE8hkBNOn51N2EhoXGfIytUodOtE9L98nH7/oAXqRv3KnDZgQHsE rJYeP9keJN7J6MFIF9Po7GA4Qau/UBRIrPVilrHbqwqfOUteQ5plkNp3UufGcg7jU8QF ulJway1UF+KcJdTm+9i5Q9Mji3iW1lb4PIOq1eyCArl14Y7keEsi4CfvyLSI6DvATUQf cP6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ORKByxqB; 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 lk16-20020a17090308d000b001a216572122si12449055plb.285.2023.04.24.15.24.56; Mon, 24 Apr 2023 15:25: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=ORKByxqB; 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 S233226AbjDXWGb (ORCPT <rfc822;fengqi706@gmail.com> + 99 others); Mon, 24 Apr 2023 18:06:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56288 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233182AbjDXWGQ (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 24 Apr 2023 18:06:16 -0400 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1908D8A40; Mon, 24 Apr 2023 15:06:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1682373967; x=1713909967; h=from:date:subject:mime-version:content-transfer-encoding: message-id:references:in-reply-to:to:cc; bh=aF+00fMmCxB5g2z9dZZXQyc7aZrPeManS84M0BOgQmc=; b=ORKByxqBPUjhYAArNQa8k4UBVM5OxY1JwAOAagCPK/PpC0Jz0/zo++9k iuNRrl992qYdFA7TaHcd+LZj+5+ftp6GQOqEsPSX719PBVIrHeE7ohxId D3aKxrewj+ZFboAxWJCCV/CYVJHazqvnZF+cNeHjUqlm7jev+5T90m0a5 2/kmB0SP/VW6q9jPSEBsNz0Sh5t9lcmeK13r4Jo+5WkikMGepEKXw0JBj PIoWQft/TBPj0wAbAf4rYv0CkJ3Xgx/51nlIzxjFCoDK2PeG43qde0bKd ZAMfl2SF3aPW5jO3D8FrmaUGsImAHdWSaI3WJeGuxKWSQUNOsX71YW7az A==; X-IronPort-AV: E=McAfee;i="6600,9927,10690"; a="335473719" X-IronPort-AV: E=Sophos;i="5.99,223,1677571200"; d="scan'208";a="335473719" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Apr 2023 15:06:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10690"; a="939500256" X-IronPort-AV: E=Sophos;i="5.99,223,1677571200"; d="scan'208";a="939500256" Received: from lab-ah.igk.intel.com ([10.102.138.202]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Apr 2023 15:06:03 -0700 From: Andrzej Hajda <andrzej.hajda@intel.com> Date: Tue, 25 Apr 2023 00:05:41 +0200 Subject: [PATCH v8 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-v8-4-4b6517e61be6@intel.com> References: <20230224-track_gt-v8-0-4b6517e61be6@intel.com> In-Reply-To: <20230224-track_gt-v8-0-4b6517e61be6@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>, Eric Dumazet <edumazet@google.com> 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, Jakub Kicinski <kuba@kernel.org>, Dmitry Vyukov <dvyukov@google.com>, "David S. Miller" <davem@davemloft.net>, Andi Shyti <andi.shyti@linux.intel.com>, Andrzej Hajda <andrzej.hajda@intel.com> X-Mailer: b4 0.11.1 X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,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: <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?1764098164279341703?= X-GMAIL-MSGID: =?utf-8?q?1764098164279341703?= |
Series |
drm/i915: use ref_tracker library for tracking wakerefs
|
|
Commit Message
Andrzej Hajda
April 24, 2023, 10:05 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> Reviewed-by: Eric Dumazet <edumazet@google.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) {