Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp4291179rwd; Tue, 30 May 2023 03:22:20 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4Rr5O6QHiZhfL/4VM2GCFbS7lR9Sj6owkA/sazBxcJ38D2MPig0thrBjXRL5cxm6Fq07ul X-Received: by 2002:a17:902:ce82:b0:1af:f751:1be9 with SMTP id f2-20020a170902ce8200b001aff7511be9mr2085531plg.32.1685442140501; Tue, 30 May 2023 03:22:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685442140; cv=none; d=google.com; s=arc-20160816; b=GboOrYyHjtH3EDb/kxNy7kRB2IfMzf6DYRORM/hu0jMSibjJokkKYWrXpyB9sXbmr6 UEbN6N5UdkMa+rSH6ORjm3uXTydztCj8VHd5trWxiM3peULWm1G2tKuoucX77ZCXNArh ZCNnfeklDD2v9dsBNs9vtlGaU5d7HSF3ipype9+5194pM9E4mit3I6tGPTuo+JbUrmCw LB4siUB0pNT8ASNj/+VgSSPmxw9dNtnJZUo0ljL9Bip06g6Akbp2cbRAjrKDQkIXhnTZ CRBPaJIIHU1JSPT+ORKPjJ6dPcE82XEDtcRveWMVT00hqzXkUWoy44siPj+9h4y0hBC4 m2yg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=xeYQzy8I8pwOViOP/HJ+F7u2H1xbPr3lN5quU+4f7GI=; b=W1jwR07ClT1EBmvT9+cUDWzypWxgvCXfQoNBwbnD1Tv2L7pyylYhop1g29eznLg9Zq pbMDdvXh51LdtlN68VvuJZGIpAATkTxed+EB2yi+LpB/M3mFG9bJgs8IldZ6PoeIE5sl nWIeXpA7vWiq44L5AISvdpUDF8yoj+0kXH4HVPZd8D7lJH20s+M7O7lOsOCdwaGckrNz Mo3UmjwUXOtqA0U3/jKabK3+YYmpQ650i3RBq374A+p2Sciz0X4KLa9CK8xsx+2/ia+K jaiIH80eOTmdx9zz1Al2SQT31kHaSwvb52uqpUvLvyF0qELV2+gS+fhYZEy4Sv3H7NRO h3UA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b="PgqzK/hD"; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q17-20020a170902b11100b001b04a6330a1si1709470plr.170.2023.05.30.03.22.06; Tue, 30 May 2023 03:22:20 -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=@google.com header.s=20221208 header.b="PgqzK/hD"; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229716AbjE3KHP (ORCPT + 99 others); Tue, 30 May 2023 06:07:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43446 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231365AbjE3KGz (ORCPT ); Tue, 30 May 2023 06:06:55 -0400 Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 81B8AFC for ; Tue, 30 May 2023 03:06:32 -0700 (PDT) Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-3f6a6b9bebdso118775e9.0 for ; Tue, 30 May 2023 03:06:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1685441191; x=1688033191; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=xeYQzy8I8pwOViOP/HJ+F7u2H1xbPr3lN5quU+4f7GI=; b=PgqzK/hDW97iHLuc12AnnGitFwZr9hSLSjrvf5dZrUtXqAUaJ6NBwun4VRCu4wjqxe x3Y5N5Nr/ki6Epm5adFpLENYX0/JuMy4YCdWhwU7I36XtDMQ6xDyqBaIVUUT9FIoqpbH TmBAZlSmRMWSpG1FkvwQ9GfuEuDLoQ29TkvSRyQZoa5oYQkCsq0nU3xPJqzjnm3DJAhk Fb8f7pg2FwiJdshufIpGD90dCMZEV7LaR8heyS+OwijLOEhWBF4NdvyGx8OY7/7b4M4s 3MlBuQZDzMjsd6MY6L0F29A7PUAAoDzyVeuDL6h+aQB4uUuR4EpyBdHDjyB7xSpqgf+v ANLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685441191; x=1688033191; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xeYQzy8I8pwOViOP/HJ+F7u2H1xbPr3lN5quU+4f7GI=; b=GBCSWCOQWtZ1KAlTCo7mNUVCR+oVwx6It8P39BgZ7Jk3V5qjqZYsStl7XfS3XXS+OO 74ithAUVWQUDYZH6AfGGmExCfSjXH33a2yEXXV1sLJ3kT+T4BHb0riH7y2o0IETaJw/C Fpo8SQsktjOlH/cLFCM+IPbvUTBEucRqYtzPLGMIaWlRYiQt72aaKYeBnZ9axo4Cc0uY uGrTxmY8SJOgX0cU9dh6IQ7f9yid2C1hpMFiXCIYgzle3ogvSpOx4eMaFTXquKVIT51h r0xgWOJ8AS8gTu2j8vbSExqYlQUvgR0kvBBir796X+foHNACRp7KBcOeviYGkx2JWyMj 2biw== X-Gm-Message-State: AC+VfDwJFiL8ZnxCW1ROfWZKrDSQKzCIDKogxEYxF2s5hG6M8teCf2B2 jC6AjiGl/EJIiIfE7Xl1At9AcfYKA184EF1GO1iT4w== X-Received: by 2002:a05:600c:1906:b0:3f1:9a3d:4f7f with SMTP id j6-20020a05600c190600b003f19a3d4f7fmr94999wmq.1.1685441190893; Tue, 30 May 2023 03:06:30 -0700 (PDT) MIME-Version: 1.0 References: <5fa8dfeb-8eb6-0de0-a335-e0b4336c29e0@I-love.SAKURA.ne.jp> <20230529190526.65d13658@kernel.org> In-Reply-To: From: Eric Dumazet Date: Tue, 30 May 2023 12:06:19 +0200 Message-ID: Subject: Re: [PATCH] ref_tracker: add stack_depot_save() failure handling to ref_tracker_alloc() To: Tetsuo Handa Cc: Jakub Kicinski , Dmitry Vyukov , "David S. Miller" , LKML Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL 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 On Tue, May 30, 2023 at 11:52=E2=80=AFAM Tetsuo Handa wrote: > > On 2023/05/30 16:22, Eric Dumazet wrote: > >>> Therefore, assume that stack_depot_save(GFP_KERNEL | __GFP_NOFAIL) fr= om > >>> ref_tracker_alloc() can silently fail, and emit "unreliable refcount > >>> tracker." message. > > > > Note: I never assumed stack_depot_save() would enforce/use NOFAIL. > > Hmm, I misread this function. > > if (gfp & __GFP_DIRECT_RECLAIM) > gfp_mask |=3D __GFP_NOFAIL; // Or'ing to "gfp_mask" than = "gfp". > *trackerp =3D tracker =3D kzalloc(sizeof(*tracker), gfp_mask); //= <=3D This is "gfp_mask". > tracker->alloc_stack_handle =3D stack_depot_save(entries, nr_entr= ies, gfp); // <=3D This is "gfp". > > So, stack_depot_save(GFP_KERNEL | __GFP_NOFAIL) is not happening. Yes.1 > > Then, question becomes whether we want tracker->alloc_stack_handle !=3D N= ULL or not. > If tracker->alloc_stack_handle =3D=3D NULL is still useful, this patch wi= ll be useless... > I think it is useful to have the tracker (as Jakub hinted). It is better than nothing. We even might be able to allocate memory later for the free_stack_handle which could give us developers enough clues for bug hunting. Thanks.