Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp623051rwb; Sun, 6 Nov 2022 11:00:00 -0800 (PST) X-Google-Smtp-Source: AMsMyM72oqloWLixpk9iilXQDh1i3Oayc0xs2YUWiT5dYuyWED+nHyrtcv5x+QaYX1wojoMLB+Yk X-Received: by 2002:a17:907:805:b0:782:1a0d:337f with SMTP id wv5-20020a170907080500b007821a0d337fmr45109833ejb.475.1667761200128; Sun, 06 Nov 2022 11:00:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667761200; cv=none; d=google.com; s=arc-20160816; b=quLWH06Eq6EXH8cSWvpeFDKOWUWACjGteEjWam1uaMmSWVV2yoBZxwZL4a2OOn/ImC +xfxTqmlo9iLxs1SQGlCAB0SXZNjALYEjAypTk5x2xa+D00uqDcbElI4RPM28AzFMFNY 6QsQkLZ44d/h6BaQ0vsL7k8eAJQR7Pp7i0dTYChLk8WkiYyu6jnOcEr6Mf3b2y9HJJfI timxv1FVVqDOntoNuTUAtk0DLAyeLa+AiCYF6CqlFlKlMcR9k9khNXIZiD2PwbFGpQ+Z YKjHLIdonqL1FYTjHUwW2kt5C626QLgjnu5qM98sLVcu/YjzWJ2hBpKBSvzXflmPr7AP FPNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id; bh=J1iCjVxYAAC7GOcSTj8mwXIJCBzOfUFrKaWn1dmkRpg=; b=Ot//7cdsyVZDRD4LpH7vf6nFUlFqfJHAPZBSTUajqT1ZanlyEaeeXe37FBBsA99AVx AFiWoXG1cnI5kVZFEiIOOxOJqgJPOKwqsW7S0gcQEDpWQPFVwxLYTnCW+8eJEI7o/lb5 SGk2xKHuDXHLOOCFOoZBR1o79RjrE1xALYtK1l6eMQqkFWcVdPgZVtznFMsEfEj+h/ht 2eMMCxJ6wlpKNrOQS1f8A+fr/9bK9iNu+PZtd5b7kdAeMHEzmY7qBK8hrn+J1Ip2EoYw bxujfDKSq3FbiIatjJZsZ9zJduVAMn2fT2zdiFWd2aGNPcftbROAt5Zousjpnc3bgJVe SiWw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l13-20020a170906794d00b007ae6ba5f344si350448ejo.53.2022.11.06.10.59.37; Sun, 06 Nov 2022 11:00:00 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230251AbiKFSEi convert rfc822-to-8bit (ORCPT + 96 others); Sun, 6 Nov 2022 13:04:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52330 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229919AbiKFSEg (ORCPT ); Sun, 6 Nov 2022 13:04:36 -0500 Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 390D026F8; Sun, 6 Nov 2022 10:04:36 -0800 (PST) Received: from omf18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 224DBA01AD; Sun, 6 Nov 2022 18:04:33 +0000 (UTC) Received: from [HIDDEN] (Authenticated sender: joe@perches.com) by omf18.hostedemail.com (Postfix) with ESMTPA id 76E7230; Sun, 6 Nov 2022 18:04:06 +0000 (UTC) Message-ID: Subject: Re: [RFC v2 3/3] mm, printk: introduce new format %pGt for page_type From: Joe Perches To: Hyeonggon Yoo <42.hyeyoo@gmail.com>, linux-mm@kvack.org Cc: Andrew Morton , Christoph Lameter , Pekka Enberg , David Rientjes , Vlastimil Babka , Naoya Horiguchi , Miaohe Lin , Matthew Wilcox , Minchan Kim , Mel Gorman , Andrea Arcangeli , Dan Williams , Hugh Dickins , Muchun Song , David Hildenbrand , Petr Mladek , Steven Rostedt , Sergey Senozhatsky , Andy Shevchenko , Rasmus Villemoes , Jonathan Corbet , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Date: Sun, 06 Nov 2022 10:04:25 -0800 In-Reply-To: <20221106140355.294845-4-42.hyeyoo@gmail.com> References: <20221106140355.294845-1-42.hyeyoo@gmail.com> <20221106140355.294845-4-42.hyeyoo@gmail.com> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8BIT User-Agent: Evolution 3.44.4 (3.44.4-2.fc36) MIME-Version: 1.0 X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00,FORGED_SPF_HELO, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS, SPF_NONE,UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.6 X-Stat-Signature: btrbetsb33g9g991fgia9znt4oaqtubf X-Rspamd-Server: rspamout01 X-Rspamd-Queue-Id: 76E7230 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Session-ID: U2FsdGVkX1/TDiNWGzwXgd/sBaXkZIB0ArMrI/YeeY0= X-HE-Tag: 1667757846-282636 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 Sun, 2022-11-06 at 23:03 +0900, Hyeonggon Yoo wrote: > dump_page() uses %pGp format to print 'flags' field of struct page. > As some page flags (e.g. PG_buddy, see page-flags.h for more details) > are set in page_type field, introduce %pGt format which provides > human readable output of page_type. And use it in dump_page(). [] > diff --git a/lib/vsprintf.c b/lib/vsprintf.c [] > @@ -2056,6 +2056,28 @@ char *format_page_flags(char *buf, char *end, unsigned long flags) > return buf; > } > > +static noinline_for_stack ? > +char *format_page_type(char *buf, char *end, unsigned int page_type) > +{ > + if (!(page_type & PAGE_TYPE_BASE)) > + return string(buf, end, "no type for user-mapped page", default_str_spec); Might be better with something like '%pGt: no type..."