Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1047554pxb; Tue, 9 Feb 2021 21:22:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJwD+NPDwIOnffnd9oxXExDMpIIrXGlbVVdZCW44nN29EBZuXi+7q9AlOi4j7hDiCMPMjM9p X-Received: by 2002:a17:906:503:: with SMTP id j3mr1255667eja.172.1612934531212; Tue, 09 Feb 2021 21:22:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612934531; cv=none; d=google.com; s=arc-20160816; b=eM0iuFdsyAR9/l9vBV3FrzLBlew/Et5sOkI7rWoCXvkVLTnGBBcPADHFBGV6ghg2DT NaJLg3epk6BA8fV47LISPPV2m/gLH+UaUSx8pKOjdezfXi0zVfK3EvZ/xMKo92TwSdsS FSwO8m0M3xYmxrepBmJZEMT+IVXJ+CtXMbVOxlGF1vAyxElXy7nF/bsSYw3uk/YW/PM0 BT9Wea+GEqZ9yknCtj1ItrPl7RhGdwcGIkvpSC17Iwp+OSJ9zdppG6fVG0OJpH/QXz72 fGIXQmSKtP9L5f9d/Ww3nDW6Fns01FPZ6EX0ovEcv4MzLYW/hWDYY9n8nIh5KhubFGB4 xqNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=NT5My67JE83c8tAQ8Vj7O5VdNPEkjvw0Ln0YAFM1sgc=; b=nZrO8WEkZMYKEo6yoOrgsS4dycYSfvAuIQA6/0EvGFohUxcZnJ41CyKwdGB0qJ8wMA XrPyWeJK9DST+FcpZjbr/rxRvSrybcXXviyqvn2gjgEyAJAEbhEITJ9wkfM8a3yMDab8 Uf/cuUrGSxidMvhZD6FokNdJcHXEdvNZWsWmQH8kl1uwjoR4BzfsqUSIAOlQ83tmkTlg XJC8+iz5mjD74qj8yQngDKIlcK2IIMo+zC8S71PQZeXwRT7UFIoM+rKNGZAxx33xVn7i AaghufgDzXlhPvnnnlG57ZttE7fjaLubJBHzAElIXIk6V2TjNCGNCquZKtOQkI2Yx/rN Svpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=DmFSBCWK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cw9si608213ejb.734.2021.02.09.21.21.48; Tue, 09 Feb 2021 21:22:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=DmFSBCWK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231984AbhBIO63 (ORCPT + 99 others); Tue, 9 Feb 2021 09:58:29 -0500 Received: from mx2.suse.de ([195.135.220.15]:46826 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231576AbhBIO62 (ORCPT ); Tue, 9 Feb 2021 09:58:28 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1612882661; 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=NT5My67JE83c8tAQ8Vj7O5VdNPEkjvw0Ln0YAFM1sgc=; b=DmFSBCWKMuwLh62B0GyHFP86vFiEERQKvPAVLlLH7/QvzDqlqOq4BiRSAmY/Gb+F9QBW/y O2+gt58hpWIAHwj2BaiDlTSjPQm11giinGHuVnb2d198F333Kkt4qNYoZULj9hD60StZgd hxVCDOXOU5Xuz/koVQemOXEPW03Pj2U= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 9851BB201; Tue, 9 Feb 2021 14:57:41 +0000 (UTC) Date: Tue, 9 Feb 2021 15:57:38 +0100 From: Petr Mladek To: Andy Shevchenko Cc: Yafang Shao , willy@infradead.org, david@redhat.com, linmiaohe@huawei.com, vbabka@suse.cz, cl@linux.com, penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com, akpm@linux-foundation.org, rostedt@goodmis.org, sergey.senozhatsky@gmail.com, joe@perches.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 3/3] vsprintf: dump full information of page flags in pGp Message-ID: References: <20210209105613.42747-1-laoar.shao@gmail.com> <20210209105613.42747-4-laoar.shao@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 2021-02-09 16:16:01, Andy Shevchenko wrote: > On Tue, Feb 09, 2021 at 02:53:53PM +0100, Petr Mladek wrote: > > On Tue 2021-02-09 18:56:13, Yafang Shao wrote: > > ... > > > I am sorry for my ignorance. I am not familiar with MM. > > But it is pretty hard to understand what call does what. > > > > I have found the following comment in include/linux/page_flags.h: > > > > * The page flags field is split into two parts, the main flags area > > * which extends from the low bits upwards, and the fields area which > > * extends from the high bits downwards. > > > > Sigh, I know that you already reworked this several times because > > people "nitpicked" about the code style. But it seems that it > > rather diverged instead of converged. > > > > What about the following? > > Isn't is some like v1 or v2? Yes. And people suggested only some micro-optimizations and reported few small bugs there. But the code was heavily reworked in v3 to support the new %pGp[bl] variants. It also added the trick with the bitmap which invalidated all the previous suggestions. v3 and v4 review focused on behavior changes. We finally agreed on it. Let's give it more cycle and clean up the code after so many shuffles. > > Note: It is inpired by the names "main area" and "fields area" > > mentioned in the above comment from page_flags.h. > > I have later realized that "page_flags_layout" actually made > > sense as well. Feel free to rename page_flags_fileds > > back to page_flags_layout. > > > > Anyway, this is my proposal: > > What about to create a one format_flags() function which accepts new data > structure and do something like > > buf = format_flags(main_area); > buf = format_flags(fields_area); > return buf; I am not sure that it would make things easier. The handling of the main area is trivial and reuses existing structures. The handling of the fields area seems to be much more complicated. Best Regards, Petr