Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp125253rwb; Tue, 8 Nov 2022 23:30:47 -0800 (PST) X-Google-Smtp-Source: AMsMyM4pq8GROSUGs+XxJJxJiLXwM3mCsh2+OnUEs/2AwO+1Zyaek/M3fzJbqknso4p8VtCueBFk X-Received: by 2002:a05:6a00:cd:b0:56b:e5de:8b4f with SMTP id e13-20020a056a0000cd00b0056be5de8b4fmr1166435pfj.67.1667979047673; Tue, 08 Nov 2022 23:30:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667979047; cv=none; d=google.com; s=arc-20160816; b=TxSNn+DXBxfTn42vYElwypLJpoubK1S5rz5kdMBZsLSZJhNbFa09yOrNjyGonBntoi +TBHtdYOTQjM5gWtuGdFChVbErmX5TGmFqTJty9J8NpUmu6BunxdJMnNPlcnZvhdDVmx gbJj5kZ850eZw3d+GSMRd3S/E6L9WlDU7xiZeLuObo/BejN81o7SW+EEkiHgOMhlgIn6 YNrIa1luV09WeFva6qfBS4VHRZXrqcyq6o0VtUY308azxR8ytavYVzQDc9oFM+Mh9jMj zG9YsjTGhk49nLL1/lTv7pN7tTuJ8uamdhQdoIIfmCPtxuslD+oc34ssOpXrXSPFjgM8 NpkQ== 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=MhA2GM0MmHVgF5w//IL35OcuY4H3+4INJfbT7ZD2bYs=; b=wSMqvrdYbPfRLACxAb6ed6P79iH70S8t2EQlhKbf/BXNh/BnHqQ8GV20+zKVrjw4ny /kTVpL9c5P5GnAsE9z1spIeLNDxG68UBibo0Px3Zkj4MGM/3M8Cb2/Q6qLaVyXoAX0m1 PVM+bMiVnli5LTpw5BTexRCZ8JzgSfZtefjka9wjysb7p0iZLnDygA4k1v851Lp2P4fG j0Q8DjybUsUv39viK7RgD45t9y0zcnO77qY5O+f24N2MHSLckGHwQt7JBDUKHrPF/PeL gCFNA3cOyU6JRcYmR9u31bd9gaUQGvHWm7sDGNfB89TobeYyZQRNcJ4f3gYk8aBmQdUi J1gA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="TjZ8RFq/"; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g8-20020a631108000000b0044a0b2e174asi17223590pgl.83.2022.11.08.23.30.35; Tue, 08 Nov 2022 23:30:47 -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; dkim=pass header.i=@gmail.com header.s=20210112 header.b="TjZ8RFq/"; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229576AbiKIGOR (ORCPT + 93 others); Wed, 9 Nov 2022 01:14:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35126 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229448AbiKIGOP (ORCPT ); Wed, 9 Nov 2022 01:14:15 -0500 Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CEF53315; Tue, 8 Nov 2022 22:14:14 -0800 (PST) Received: by mail-pj1-x1033.google.com with SMTP id b11so15808363pjp.2; Tue, 08 Nov 2022 22:14:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=MhA2GM0MmHVgF5w//IL35OcuY4H3+4INJfbT7ZD2bYs=; b=TjZ8RFq/eIuwO/6zg8DWofiyQBOyrb0Ence+A7Yi6MeNz+Gy96a/7h6aR54BKoD1UI fHVUNoXlH/QoP+shqZgFFGBD/wHpuNc9pTTYWNHIFpXxq0ti0zekCenfRxFMXCPY24db ak5lbljB9t2PXOhqKyt0Mf021sPQw/oGasFJW8RuE6Rv9XtTCAuXCFFte+YsfZ994xo8 SIi3uir0P8qP37sU7TLu4Luehk4EQkS3bjJ3KBAfHSi6IuNUYcTwO1J9hj0gz57WqWUt 5Drs7DVeuiS+LK+TbV27iiWlDpjXdoHSF3gFh/EXXcSshtPL5Ip6FyrGhcGARkRNSARk PtHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=MhA2GM0MmHVgF5w//IL35OcuY4H3+4INJfbT7ZD2bYs=; b=rTFCHQqETuN9K2hrLpPwG6Lel3Xffv76BUbIqqeY1xmfw5HJUX+T3DDLeuAcsSXDVv ykW2YSEHyYIgQULClW9H4wRGaOduOyvWKUn9gCy2GRdnH0N6IJ0YIyakiEpZSE9D+4kG rGLQIEvaA27xZxDtK1A/imdsT4K1a00SVZqYKp+rjj2W699Fkk54iplRQk+mdBZhjuFI 5Y2a2TiysZBD97xWlcC8Jmd/pPcHm3ltbAqsI9wn6rw64T6Ya1GjsKMToDUzGWZQqkui YeZzE9pyRDCQmnASPIzOVEpy5UOZZYt7NdR7sB2/6eXWaaaAOkK6yWleA+EOFDmr9VIA itHA== X-Gm-Message-State: ACrzQf0enBoEnJU1Q4DIicmerMGkyA4qWw01gtZCWZAa/mVierE3E0Hn 6GS53AIFV7QijhCyV+yXpYE= X-Received: by 2002:a17:90a:c201:b0:216:ab2c:25b with SMTP id e1-20020a17090ac20100b00216ab2c025bmr29885616pjt.45.1667974454355; Tue, 08 Nov 2022 22:14:14 -0800 (PST) Received: from hyeyoo ([114.29.91.56]) by smtp.gmail.com with ESMTPSA id n15-20020a170902d2cf00b0018544ad1e8esm8131460plc.238.2022.11.08.22.14.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Nov 2022 22:14:13 -0800 (PST) Date: Wed, 9 Nov 2022 15:14:05 +0900 From: Hyeonggon Yoo <42.hyeyoo@gmail.com> To: Joe Perches Cc: linux-mm@kvack.org, 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 Subject: Re: [RFC v2 3/3] mm, printk: introduce new format %pGt for page_type Message-ID: References: <20221106140355.294845-1-42.hyeyoo@gmail.com> <20221106140355.294845-4-42.hyeyoo@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-0.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HK_RANDOM_ENVFROM, HK_RANDOM_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=no 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 Sun, Nov 06, 2022 at 10:04:25AM -0800, Joe Perches wrote: > 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 Thanks for looking at this. > > noinline_for_stack ? May I ask why, Does it have issues related to stack consumption? To Be Honest I'm a bit unsure what is purpose of this attribute. > > +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..." Will try something like "0x32()" when it has no type because it is mapped to userspace. -- Thanks, Hyeonggon