Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp3089424rwb; Mon, 5 Sep 2022 06:22:08 -0700 (PDT) X-Google-Smtp-Source: AA6agR4nQEktn07u/BpFAyLD7Fj+26t9mc+6ML4LTGTk5fd6YRF6+EBdH/o4bbSXrHLqyAkqOFUT X-Received: by 2002:a05:6402:550c:b0:443:7d15:d57f with SMTP id fi12-20020a056402550c00b004437d15d57fmr43153462edb.147.1662384128752; Mon, 05 Sep 2022 06:22:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662384128; cv=none; d=google.com; s=arc-20160816; b=XiDz3G5iy65rVTi2i41JgY3Qypc42YON2Q5UBfCkxkSY9r59H9QUvAYDDT0mA2fnrG VfFasW2WMd+ojSO7YtjCpuOyXGZUkRtVj0wS12Prn/lXzJnVlB+6fS0JnMsRXlqR4vOO ucHP4DcT8i8EaIMshIg5c8ouAu/2jaICYF0L2onkPLWnOjtNP0yOAPKgNlD9VRuyW4F8 02ud0r7UQ3WE7E5uc1xQUD9gTh3cYpGJQ+nW8r8MsmbSutZBGeDvHWDkJeylF3U4hFK+ vXuZt3hev9ig0KeszGo9QCKU/U30bMN6hb6Z2HVGc6xQvJ5pijR+TzA6QvMRlpo+gPwv IhJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=kJi7f6S+gKqA2Sy14qN2pIa8T6Q0eYoj0fHhvmu5wuI=; b=iKG/5Y7OX2suhyok1FZPvpBkQjs3mF9hj3QcMBE0Dr0Cphkikt10q7b0JAjcoxRxXK Igr0su6FTq6JCziPQeDILcEa7mZbOHkStG6Idt2UvV7nCYmrFE53mxVYPeBuHqzcMhNd wvsq6oWJFHjXfAL7QhrR3x7TEt8Q1PX2utE7otz/2IPtI3frRoSQmPP8+y1UvzYNuTnW uE3L5ejWwG0R8cbsdJ6nLaqB1CSpkpL3c8BzB3xMux+JA+hoaHRCnM0plI3vLJtvUyC2 /Jm3FUyqDMB0rgZcc9L1LJB3R4veWiAFM+403A+6yXPGujDnlFeLWs2yEP3UH0RnpcXz D/rA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b="on/CTDUc"; 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 z4-20020a170906434400b007315a1b0f97si5873874ejm.856.2022.09.05.06.21.27; Mon, 05 Sep 2022 06:22:08 -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=20210112 header.b="on/CTDUc"; 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 S231255AbiIENAo (ORCPT + 99 others); Mon, 5 Sep 2022 09:00:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41376 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236239AbiIENAh (ORCPT ); Mon, 5 Sep 2022 09:00:37 -0400 Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6CD1727CD1 for ; Mon, 5 Sep 2022 06:00:33 -0700 (PDT) Received: by mail-wr1-x434.google.com with SMTP id e13so11300585wrm.1 for ; Mon, 05 Sep 2022 06:00:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:from:to:cc:subject:date; bh=kJi7f6S+gKqA2Sy14qN2pIa8T6Q0eYoj0fHhvmu5wuI=; b=on/CTDUcmPLQAHC2qXTDeTgGZgrVME1lc2BHGRyNPtAl3CPT61/uWsOnGmsaNvO0rs GGlV6eLipjhZyDVpl/5CoY/d4GyojU21yrWcv0CI3lPVquuykqXqjhjXu0RmkWb8dXfX KQR4mRdcDoNM2T+Vb+3YwNvIK7VWjhijxYTcMNMhVXkzdd1ANxbn5hy1NyDD7Zhk4O/c OaJ/WHhwW7oBpS4Mlc7zpImzYRhTnBZukWNxzQkdWRT1hnyDRa0JW48xQg/C9piI2GHK 86zdltH8Qqgi3qY9nFTHiIue0RuvNgNOPb6QQQ34Xkps5yys21SPSOLVlg80Onn6+3ba GYMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date; bh=kJi7f6S+gKqA2Sy14qN2pIa8T6Q0eYoj0fHhvmu5wuI=; b=ZHTm3zFVC4PWgiXK84gI13cqtNKleE1ffRt2Ilx9s+dnQncGUtkddM2zQz2Nmh9MKI lEoKO+95RGap/ArNrE9lnInSHSicLmAXinoj8Kb5pV53TFlfWu6wuibA4a33NOzAcEVh mDKAUe7K32Od70z/n8iHlKTDl/gzYBiIY3heUNBKpKYrVKIycjwd5/rrQkGTXONoZh0m LYCKCliBGxitZ1psGfEdrjNo0heGGOA9S2zRCYteLmw7mq0sZWpYCEhkZNEDLo4nOcjM QpBXQiBu/iqWZ+BiXKkeW11Etnidm7A+3LAzq4SlbHjOYnfsv51uEsC8+XjHU0BvgBA5 aQjw== X-Gm-Message-State: ACgBeo1ug3N37GKRW3KdU9DSZXIVLLrUmJP7x1BmgzTwwbPZQm6KcEfB V/zWESRmz6QA5FwM0Ym+wM6YQek11MTIwQ== X-Received: by 2002:a05:6000:904:b0:21a:3dca:4297 with SMTP id bz4-20020a056000090400b0021a3dca4297mr24186501wrb.487.1662382831841; Mon, 05 Sep 2022 06:00:31 -0700 (PDT) Received: from elver.google.com ([2a00:79e0:9c:201:b57a:bbdd:c6f3:e092]) by smtp.gmail.com with ESMTPSA id m11-20020a056000180b00b002287d99b455sm3462322wrh.15.2022.09.05.06.00.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Sep 2022 06:00:31 -0700 (PDT) Date: Mon, 5 Sep 2022 15:00:24 +0200 From: Marco Elver To: Oscar Salvador Cc: Andrew Morton , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Michal Hocko , Vlastimil Babka , Eric Dumazet , Waiman Long , Suren Baghdasaryan , Andrey Konovalov , Alexander Potapenko Subject: Re: [PATCH v2 2/3] mm, page_owner: Add page_owner_stacks file to print out only stacks and their counter Message-ID: References: <20220905031012.4450-1-osalvador@suse.de> <20220905031012.4450-3-osalvador@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/2.2.6 (2022-06-05) 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 Mon, Sep 05, 2022 at 02:57PM +0200, Marco Elver wrote: [...] > > +{ > > + int i = *pos, ret = 0; > > + struct stack_record **stacks, *stack; > > + static struct stack_record *last = NULL; > > + unsigned long stack_table_entries = stack_hash_mask + 1; > > + > > + /* Continue from the last stack if we have one */ > > + if (last) { > > + stack = last->next; > > This is dead code? Oof, I just noticed that 'last' is static. Please avoid that, because it'll make this interface really tricky to use safely. I still don't quite understand why it needs to do this, and a kernel-doc comment would make this clearer.