From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3CE5AC433EF for ; Fri, 15 Oct 2021 10:22:29 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id AFE4861027 for ; Fri, 15 Oct 2021 10:22:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org AFE4861027 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id BA9F094000C; Fri, 15 Oct 2021 06:22:27 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B59DE940009; Fri, 15 Oct 2021 06:22:27 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A488C94000C; Fri, 15 Oct 2021 06:22:27 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0135.hostedemail.com [216.40.44.135]) by kanga.kvack.org (Postfix) with ESMTP id 98878940009 for ; Fri, 15 Oct 2021 06:22:27 -0400 (EDT) Received: from smtpin05.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 3B1E0183C03F1 for ; Fri, 15 Oct 2021 10:22:27 +0000 (UTC) X-FDA: 78698282334.05.60B5D85 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by imf05.hostedemail.com (Postfix) with ESMTP id 3105E50CF087 for ; Fri, 15 Oct 2021 10:22:25 +0000 (UTC) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id A8F3521A62; Fri, 15 Oct 2021 10:22:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1634293345; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=x1ni5GSu4alsWrIC08dr8xAv6nTXEzdDK7lt9Rzj20o=; b=so4LgDKN6loIkqTBKtAGS0SDdne0H98J14m0wenWGhWU7/9ZbIMXlAFzH1h6b2OhPYm4AF zvMZ5UBOMRCiwf7qOIe87sU5mntZlKRPVgD1RDF49VC9gbf7EQkkP3ORZmMm9JgUkHOamk C/hWCecL2yXcqaBP47RFNIeQa1oI0NA= Received: from suse.cz (unknown [10.100.224.162]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 8C9E6A3B81; Fri, 15 Oct 2021 10:22:25 +0000 (UTC) Date: Fri, 15 Oct 2021 12:22:25 +0200 From: Petr Mladek To: "Kirill A. Shutemov" Cc: "Matthew Wilcox (Oracle)" , Yafang Shao , Sergey Senozhatsky , linux-mm@kvack.org, Vlastimil Babka , Rasmus Villemoes Subject: Re: [PATCH 2/5] test_printf: Assign all flags to page_flags Message-ID: References: <20211012182647.1605095-1-willy@infradead.org> <20211012182647.1605095-3-willy@infradead.org> <20211013092530.iidcseycqkn2b3vm@box.shutemov.name> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211013092530.iidcseycqkn2b3vm@box.shutemov.name> X-Rspamd-Queue-Id: 3105E50CF087 X-Stat-Signature: uowb5p3x9zdy6h7xgg9fy6d75w1gi4wb Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=so4LgDKN; dmarc=pass (policy=quarantine) header.from=suse.com; spf=pass (imf05.hostedemail.com: domain of pmladek@suse.com designates 195.135.220.28 as permitted sender) smtp.mailfrom=pmladek@suse.com X-Rspamd-Server: rspam02 X-HE-Tag: 1634293345-29085 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed 2021-10-13 12:25:30, Kirill A. Shutemov wrote: > On Tue, Oct 12, 2021 at 07:26:44PM +0100, Matthew Wilcox (Oracle) wrote: > > Even unknown flags should be passed to %pGp so that we can test what it > > does with them (today: nothing). > > > > Signed-off-by: Matthew Wilcox (Oracle) > > --- > > lib/test_printf.c | 6 ++---- > > 1 file changed, 2 insertions(+), 4 deletions(-) > > > > diff --git a/lib/test_printf.c b/lib/test_printf.c > > index a52c1c3a55ba..f744b0498672 100644 > > --- a/lib/test_printf.c > > +++ b/lib/test_printf.c > > @@ -608,14 +608,12 @@ page_flags_test(int section, int node, int zone, int last_cpupid, > > int kasan_tag, int flags, const char *name, char *cmp_buf) > > { > > unsigned long values[] = {section, node, zone, last_cpupid, kasan_tag}; > > - unsigned long page_flags = 0; > > + unsigned long page_flags = flags; > > unsigned long size = 0; > > bool append = false; > > int i; > > > > - flags &= PAGEFLAGS_MASK; > > - if (flags) { > > - page_flags |= flags; > > + if (flags & PAGEFLAGS_MASK) { > > snprintf(cmp_buf + size, BUF_SIZE - size, "%s", name); > > size = strlen(cmp_buf); > > #if SECTIONS_WIDTH || NODES_WIDTH || ZONES_WIDTH || \ > > Do we even need 'page_flags'? Can't we do everything on 'flags' directly? I have to say that the meaning of "flags" and "page_flags" variable is far from clear [*] It would be worth documentation how they are supposed to be used. I am going to comment more on this in the 5th patch. Best Regards, Petr [*] Shame on me. I did not pay much attention to the test code when reviewing the original code.