Received: by 2002:ab2:2441:0:b0:1f3:1f8c:d0c6 with SMTP id k1csp100347lqe; Thu, 4 Apr 2024 00:21:07 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX38Pci2/eWEwxjSh7LgAGTN0WKs2a6H7dt7tYNBOJehJLdQzVVTA6lSTK5qvMQhzmtW8p0nWtOfPbQJNXb7kyKkLRXBa24FfQV5WHgHQ== X-Google-Smtp-Source: AGHT+IFxq/S5wanbh1iEY1aV8KjNFiH6/Ewcl5e6fER5tnD85dfu3iO9eI9rNg20bqVgnkFlnFcV X-Received: by 2002:a05:6830:1507:b0:6e7:3b8:edb0 with SMTP id k7-20020a056830150700b006e703b8edb0mr1471259otp.34.1712215267620; Thu, 04 Apr 2024 00:21:07 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712215267; cv=pass; d=google.com; s=arc-20160816; b=1FFNtEFsHpusFniyPk9ABBwxVkdGNuxg3M0HMfUwu/TEMhXjO5sq0QmKuHDBFM3REr 8xONEoqo/TovFVy5NUGhXUJ61J/rB/dTtFoNQDEFHiuHqb+wRVnDvQPMUz6Y9ihPsCki 6fA/LPufQ7gw53/f44OeObu8088SHWIPbM17y1T2fQeMDyDlqElHCTMhL4U8vJBG+Bjt +YZXpC0wW8tJH3aofocfz8YUbOwfWP3OFMIa1t8Sa2CO8peOpXDuTYbmjkKDvOUBxu0+ a+BOHe4PejIY2kAoCSgpAmkoKczeD9FZiIr2mKblzwRR1U3jD/3tU6nOtL9bYJJBgdYQ jgHA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id; bh=k+Oz2WFuRzVIAZ8tgWzZkqSGhWFj2FrDDvCCFBXlm/w=; fh=48udRT1DdKsmniSI5zoAOdD7ywAOlyVZeCIALVsAtZA=; b=V5HhwbZGR3GTQKbrg38inrOt8qheRnQyRTLCxkykQBHyMeYYI38y6P8u1utV2rAUpw ci0ruHVa1P4/9ajHQC8+/uvnIk8b71I4L4Fd60q9Fe7nRuLbVcxdupRLOdfuZDf1Ex8j HSfHMlLuT/rkfliPetg1WH+wWBAb7JAxsRZ6lARBntV1OM96KV3g/3SH480sn4+uSUBi duQitr0o3ppyzFJVOPw7olhDxcPki5ct++nJVMQfAutQzac2fXJGamd27fphbA+RrtmA /sliQVohXkdgd0tdwPkjg2JLA+6Jj5VRmPTKt0B94mvS3qEiWZPdMgguJXbGwUS6ey6S V/2w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=suse.cz); spf=pass (google.com: domain of linux-kernel+bounces-131014-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-131014-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id j3-20020a63b603000000b005e838ab5bf9si14886007pgf.627.2024.04.04.00.21.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Apr 2024 00:21:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-131014-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=suse.cz); spf=pass (google.com: domain of linux-kernel+bounces-131014-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-131014-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 34C51B21657 for ; Thu, 4 Apr 2024 07:12:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 62F6955E4B; Thu, 4 Apr 2024 07:11:56 +0000 (UTC) Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 22CE054904 for ; Thu, 4 Apr 2024 07:11:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712214715; cv=none; b=JsRMCktyzQ8sBadZLoxa1ZnFleT9ex1Hmd2ql4UyAqAyp/9rQHWOMExZGO/iEcLsUByqWVNqGIjtkhpSWAqNvNy3TH8NL/7MBFnxhmdsKmPy5PUxJ9C0qK8xSiGdFawsOKbDsr8JjabcI83AsvvTOiEhag4S1I9JP5muRdoKkSM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712214715; c=relaxed/simple; bh=vrTEJeary/4cyPyvxfOrSOmOb1ppo4SBWKptctBOYUU=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=IiDCpX6TDyBBPWCABkGlNAsYLqO8Pyo4WuvnUc85wYOs3CWQSYsTnWwYU0ofDX64jFGoeFHDJwWUAjRROzA65TxU+u2R7EXRHzJkF1o6UpYXO0EGxKaP43KtSl6I9PrECRWbYui/un2iytjr/G4OpkbKRMEDdwezCx4O2DGJbXM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz; spf=pass smtp.mailfrom=suse.cz; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.cz Received: from imap2.dmz-prg2.suse.org (imap2.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:98]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 7ED913763B; Thu, 4 Apr 2024 07:11:52 +0000 (UTC) Authentication-Results: smtp-out1.suse.de; none Received: from imap2.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap2.dmz-prg2.suse.org (Postfix) with ESMTPS id 69EB7139E8; Thu, 4 Apr 2024 07:11:52 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap2.dmz-prg2.suse.org with ESMTPSA id CG+KGbhSDmZTdAAAn2gu4w (envelope-from ); Thu, 04 Apr 2024 07:11:52 +0000 Message-ID: Date: Thu, 4 Apr 2024 09:11:52 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 4/4] mm,page_owner: Fix printing of stack records To: Oscar Salvador , Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Michal Hocko , Marco Elver , Andrey Konovalov , Alexander Potapenko , Alexandre Ghiti References: <20240404070702.2744-1-osalvador@suse.de> <20240404070702.2744-5-osalvador@suse.de> Content-Language: en-US From: Vlastimil Babka Autocrypt: addr=vbabka@suse.cz; keydata= xsFNBFZdmxYBEADsw/SiUSjB0dM+vSh95UkgcHjzEVBlby/Fg+g42O7LAEkCYXi/vvq31JTB KxRWDHX0R2tgpFDXHnzZcQywawu8eSq0LxzxFNYMvtB7s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3R1JtVdgwEdr+NEciEfYl0O19VpLE/PZxP4wX PWnhf5WjdoNI1Xec+RcJ5p/pSel0jnvBX8L2cmniYnmI883NhtGZsEWj++wyKiS4NranDFlA HdDM3b4lUth1pTtABKQ1YuTvehj7EfoWD3bv9kuGZGPrAeFNiHPdOT7DaXKeHpW9homgtBxj 8aX/UkSvEGJKUEbFL9cVa5tzyialGkSiZJNkWgeHe+jEcfRT6pJZOJidSCdzvJpbdJmm+eED w9XOLH1IIWh7RURU7G1iOfEfmImFeC3cbbS73LQEFGe1urxvIH5K/7vX+FkNcr9ujwWuPE9b 1C2o4i/yZPLXIVy387EjA6GZMqvQUFuSTs/GeBcv0NjIQi8867H3uLjz+mQy63fAitsDwLmR EP+ylKVEKb0Q2A== In-Reply-To: <20240404070702.2744-5-osalvador@suse.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Rspamd-Action: no action X-Spam-Flag: NO X-Spamd-Result: default: False [-4.00 / 50.00]; REPLY(-4.00)[] X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spam-Score: -4.00 X-Spam-Level: X-Rspamd-Queue-Id: 7ED913763B On 4/4/24 9:07 AM, Oscar Salvador wrote: > When seq_* code sees that its buffer overflowed, it re-allocates a bigger > onecand calls seq_operations->start() callback again. > stack_start() naively though that if it got called again, it meant that the > old record got already printed so it returned the next object, but that is > not true. > > The consequence of that is that every time stack_stop() -> stack_start() > get called because we needed a bigger buffer, stack_start() will skip > entries, and those will not be printed. > > Fix it by not advancing to the next object in stack_start(). > > Fixes: 765973a09803 ("mm,page_owner: display all stacks and their count") > Signed-off-by: Oscar Salvador Reviewed-by: Vlastimil Babka > --- > mm/page_owner.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/mm/page_owner.c b/mm/page_owner.c > index b4476f45b376..9bef0b442863 100644 > --- a/mm/page_owner.c > +++ b/mm/page_owner.c > @@ -872,13 +872,11 @@ static void *stack_start(struct seq_file *m, loff_t *ppos) > * value of stack_list. > */ > stack = smp_load_acquire(&stack_list); > + m->private = stack; > } else { > stack = m->private; > - stack = stack->next; > } > > - m->private = stack; > - > return stack; > } >