Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp4444356pxb; Mon, 21 Feb 2022 21:49:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJxqTw5/B9B4dhsNt7sjC3bW9vOantgifkdBrgiMp19prX9Bnq2L8OG/hIyJIMP7NmpFDTNY X-Received: by 2002:a05:6a00:22c8:b0:4e1:cb76:2e58 with SMTP id f8-20020a056a0022c800b004e1cb762e58mr22070974pfj.47.1645508968129; Mon, 21 Feb 2022 21:49:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645508968; cv=none; d=google.com; s=arc-20160816; b=hdUPQEczWTox84VYWYasOUuDd7CUBAhLlRfnkTAlqZSrCgWWRw8oaS+K9hUf0nR3Ai 8HhFrDhCalCMhnzqBSRc0U3BY/Ar2Pp0DJSZHKrEwKCMvIlrj8r+04psM07iNp99EgbA Q3OVcPNuXHUCC2JmX5FbGHWa9lKERPJPU9dUEWLnvx5P7VC3k7MF0Abn0geRSmdRoryS O5gKCYh7YP4Cfj5SiUOqDvvp/IuV5mXmpidP+OEXSC8pbQv+3dSjmgv9N4mF9+y6j8XU pwfq7w6SXTPE3i5tqzGNab6NAQ6uvm8NMEVvEJglnYgdMrm/cdK0fBIAmb3XScgtq7oZ 37IA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=3lC+GIB4kzAe3ece369swUyKHnvK/S1h9xrQbJ/8q+w=; b=ShKURC3gkig4zE5BVc57q5IfT7TpMvvIg0/j/ucpUdyvBCA7PdbS/v2XqPHi4UEuT+ LASv3IKFcchfTOzMAfAYInrr7MhZne/UE+062uQGVA4kDoZeQdyOZjTldQMC2T6S9nsl 2f8Xb0TiL/6nx/WILf7GPrT8GYC9/5txEq73Oa0yOwrADskBrJaL/frMMf1o1v+VUSbX 4Ye8LShsf5zmAIeKq8kBpu19d1uMeSo7xyLDo+gwMJCHNPZaWPa1mJROfxR5D2EMZAWA qkOzsd/X92IQkv3pffKwDj3in1ZeXm7oXzux9lnB6xHdxEpYJB8fSeNPzRdBtKIJpFPW LU8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=GOHpLflJ; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id o20si19059923pgv.148.2022.02.21.21.49.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Feb 2022 21:49:28 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=GOHpLflJ; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0200FDCE3F; Mon, 21 Feb 2022 21:13:20 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230349AbiBUXyu (ORCPT + 99 others); Mon, 21 Feb 2022 18:54:50 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:42156 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237311AbiBUXys (ORCPT ); Mon, 21 Feb 2022 18:54:48 -0500 Received: from mail-yb1-xb2e.google.com (mail-yb1-xb2e.google.com [IPv6:2607:f8b0:4864:20::b2e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9BFCB1A3B1 for ; Mon, 21 Feb 2022 15:54:24 -0800 (PST) Received: by mail-yb1-xb2e.google.com with SMTP id y6so37534040ybc.5 for ; Mon, 21 Feb 2022 15:54:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=3lC+GIB4kzAe3ece369swUyKHnvK/S1h9xrQbJ/8q+w=; b=GOHpLflJrqC43QFF/5GQvG7V2qEcPuaQvtK5vbSduDp5b1yp3G7IW6vFy9EFQmifR3 R3K6rvushU3hJCS+Q6RbNcy7Y3MCAD1xh9DmsmuJ2Cuki5Tpvo/WJIioUd+G4028WrXV 6EuITKbzai/dr+E7N6V+RpaG1AFgkgkp6ZhZ8BaDO2LbPeNApEd5+THSlbqAL01gEya8 0Xor7hYcueU2c9Tbn4MBzNzpxCXuancOC8749h9QPVjrrHJ3E6H1ilmIQGjh55yX4Tre yHb37zO9WMY3AhiVF9UhNZkRfPoZ3Oq5BjEJAfTtRCAwySv7PvxrLqZhsd9hjmo9PsV4 R69A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=3lC+GIB4kzAe3ece369swUyKHnvK/S1h9xrQbJ/8q+w=; b=E52G/I7BhJdrDdPqeYRkY9FJA326eCrDHZGdIpXSVgQr2OHIriwNKeoT6Swq2dk5nU sy0DUyE3hXIeDXue9crXv5Rwb2sj9wBU2v6MAgBhxXlLhH4ZGDWGemu+GFuTapvLWJM7 TNp26WItTOwGRiBsCfBxlnI5dmTzT0unv6PpGexu+nP+Aq1QFBzUYKmoy3ZISv+tCG6v LWMvPtUhrPnuwm2F2BLJlsYO0MVuSE9Ws/jrtt9YxNWxCnKfOERDmF8AO5AbkqLs3XGJ gzjpZMn6GIMD7W9ILnSEEBIweMumSOPgm33uwK1wuW4/jYQ4ubLj9ekBJd1ORB91bO2h n3/g== X-Gm-Message-State: AOAM5338pA1p1SGksDb6pWPN+nFksKlaltjZQu3E79q5ACnjaGPxCNnm MFlJFBHnzryinYinN3z5ZcWM6L1aSSULUdcIJUvBxA== X-Received: by 2002:a25:a28d:0:b0:623:fa1b:3eb7 with SMTP id c13-20020a25a28d000000b00623fa1b3eb7mr21159078ybi.387.1645487663454; Mon, 21 Feb 2022 15:54:23 -0800 (PST) MIME-Version: 1.0 References: <20220221232542.1481315-1-andrzej.hajda@intel.com> <20220221232542.1481315-8-andrzej.hajda@intel.com> In-Reply-To: <20220221232542.1481315-8-andrzej.hajda@intel.com> From: Eric Dumazet Date: Mon, 21 Feb 2022 15:54:12 -0800 Message-ID: Subject: Re: [PATCH v3 07/11] lib/ref_tracker: remove warnings in case of allocation failure To: Andrzej Hajda Cc: LKML , intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, netdev , Jani Nikula , Daniel Vetter , Lucas De Marchi , Chris Wilson , Dmitry Vyukov , Jakub Kicinski Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.5 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=no 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 On Mon, Feb 21, 2022 at 3:26 PM Andrzej Hajda 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 > --- > 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; SGTM > 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); Last time I looked at this, __GFP_NOWARN was enforced in __stack_depot_save() > > spin_lock_irqsave(&dir->lock, flags); > if (tracker->dead) { > -- > 2.25.1 >