Message ID | 20230224-track_gt-v7-4-11f08358c1ec@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 b10csp1003615vqo; Fri, 21 Apr 2023 04:48:28 -0700 (PDT) X-Google-Smtp-Source: AKy350a6H4dlsc5HGvE1Qe5pyGvsJl1MWWCYkkSQJ5WD+IVts1W8pHzY11P1OmTWVdDZDMryqNO7 X-Received: by 2002:a17:90a:ea07:b0:240:d3b7:e850 with SMTP id w7-20020a17090aea0700b00240d3b7e850mr4109862pjy.49.1682077708388; Fri, 21 Apr 2023 04:48:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682077708; cv=none; d=google.com; s=arc-20160816; b=ZYRkM13xNFg09NiJxMrRYWVgBOGADVUXTmwO2fSFISJQF5acfewXp+/6nKUvBDYDvh WpcP0uKSA7Oz9fVvxFbXqVk30c+uO+gaQCFwqcHA/6UvIhJl45U+zvUN0rRLhkm7dNFl w31Wh5qj1Ujx4YX9yoLi8F333POtNNIs5xLLV+b//fwt7m439E71PMAyGiQ0TsgDFdeh FI6XzZGcXdt7h0jArrGljaIbFmjIvfI6l+bgO2bC71VN5f5Xt10kJcq2ZyexMCQFjy0D s1Kk8K35qtBZ6mF2WX6SPfQHssC8A7C4RF5B0dvnKd3A+h+Rp4sSSjKVe+zm9nB0RQhi dl3A== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b17-20020a170903229100b001a6e58380f6si4493222plh.523.2023.04.21.04.48.13; Fri, 21 Apr 2023 04:48:28 -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 S231710AbjDULfy (ORCPT <rfc822;cjcooper78@gmail.com> + 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 <rfc822;linux-kernel@vger.kernel.org>); 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 <andrzej.hajda@intel.com> 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 <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>, 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.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: <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?1763786315552073100?= X-GMAIL-MSGID: =?utf-8?q?1763786315552073100?= |
Series |
drm/i915: use ref_tracker library for tracking wakerefs
|
|
Commit Message
Andrzej Hajda
April 21, 2023, 11:35 a.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(-)
Comments
On Fri, Apr 21, 2023 at 1:35 PM Andrzej Hajda <andrzej.hajda@intel.com> wrote: > > 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> Thanks.
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) {