Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp5712515pxb; Mon, 28 Mar 2022 16:37:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyldbjbezrALK1eSMP8lbiULfanNWHCtq9lG6apjR2WbAKzAnlGdP0jDI+qbP6ssRlUMXj8 X-Received: by 2002:a9d:4798:0:b0:5b2:3791:beb7 with SMTP id b24-20020a9d4798000000b005b23791beb7mr10717745otf.123.1648510672212; Mon, 28 Mar 2022 16:37:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648510672; cv=none; d=google.com; s=arc-20160816; b=gObpd6yJ8UkH6dcWOBAJYKDtiOakFM6TqBKEz+OAnNVnVo3lMLzGmEEslvSAKV+bDl Uk6sOl39pG+Q0mfhScdo2VbRRBSbcSeZDbTUjy9ZAV3pEFVbKCYVWn/u4gazvi4zeIbm SAke032mrmuIaj0YQX61nRSVnqPANpgsSx3QeUfAvfTKtiK20Yw8rr8vbaGzyYR9Zb+3 uBfmZUdsNrjhqfkwHbXkZPZi3frRqIIm4jlOUiAV7A8MjaMrsFmsEItR4hEXQTNkS3J1 J6H/KoNxKC/J+nSGk2LgEwAlHAmbR/A/ig7YUHPFr44G3X6onCyNK74CaKfbGNDdog0k L+aA== 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=U9j9t01F+ucI6Et2jJhTVqbcgEOCuGM/GuyWi4T98rM=; b=V+DXwVhwKs9JOmpLz7mufMiPJGtfIqAOJzsK+QLNDEQOQruyV7Fm/YdEfp7xOlVhgq GvWGJ83rVTX09CN0ETSIF3wmKBO+fnorR1bDAtWPnN3RE/4LqxlQ0L5k+JtMgNMWvZfY e0Z50A+Ck6/OAV/cfS495bL8bVKg+O8JhCeA5F/kzsYiqeAw1bdAoxLBrMkrw+iMyXaU eQgctARJpEujZ4QcGrYz5/kNjeRZozjmGwjGTqksJnzKn9OrqR2Sa3md10eszlHnlq77 h0GBjputP8Y3u+4CfPhwe5GOlEWXfWO5q2JvHrIS7mBBWyp1rVlEo6xm566ctpmQvm7K oOog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=CNtXdsuM; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id t23-20020a05683022f700b005cda3d7e933si11465491otc.97.2022.03.28.16.37.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Mar 2022 16:37:52 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=CNtXdsuM; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5EEDDBC3D; Mon, 28 Mar 2022 16:04:20 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230226AbiC1XFv (ORCPT + 99 others); Mon, 28 Mar 2022 19:05:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51372 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230204AbiC1XFt (ORCPT ); Mon, 28 Mar 2022 19:05:49 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E733928E20; Mon, 28 Mar 2022 16:04:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=U9j9t01F+ucI6Et2jJhTVqbcgEOCuGM/GuyWi4T98rM=; b=CNtXdsuMNOMSUAjqig33jMXU09 QAGFaqPIE6KsDSJDokCRuC0x7PB7MIIJ5INQAR7du+Be1jhsc8kDcqNxWvI+J9GqxvvpuYdWdfzop tYX20LihE1CVIIvXmTFuaZUZ4xiJ/Eq1DIq5LgJ1wTLxTjceHWety3Pv5Zm7AsI08ti4EVEAnouGi icxhai1XUr8Im2sexpiP0XIvN7laIfau3HV3UMudIhUrR9FX+LzOWWTGDd7+g37S93Y83hYfwutEl QJxLRPVKsMM9V5RFSsPIPsjaRaWnVEyzZ67iURDlbvXsI8t1D06Cs6BJOmCDJXRhIkPGsJ+zyjk6+ 00ZcN5cg==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nYyP3-00HLby-SO; Mon, 28 Mar 2022 23:04:01 +0000 Date: Tue, 29 Mar 2022 00:04:01 +0100 From: Matthew Wilcox To: Hugh Dickins Cc: Stephen Rothwell , Andrew Morton , Linux Kernel Mailing List , Linux Next Mailing List Subject: Re: linux-next: build warnings after merge of the akpm-current tree Message-ID: References: <20220209170245.08968c92@canb.auug.org.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE 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 Wed, Feb 09, 2022 at 08:03:26AM -0800, Hugh Dickins wrote: > On Wed, 9 Feb 2022, Stephen Rothwell wrote: > > include/linux/mm_types.h:272: warning: Function parameter or member '__filler' not described in 'folio' > > include/linux/mm_types.h:272: warning: Function parameter or member 'mlock_count' not described in 'folio' > > Thank you for including the patches and reporting this, Stephen. > Is this a warning you can live with for a week or two? > > I've never tried generating htmldocs (I'm tempted just to replace a few > "/**"s by "/*"s!), and I'm fairly sure Matthew will have strong feelings > about how this new union (or not) will be better foliated - me messing > around with doc output here is unlikely to be helpful at this moment. I have a substantial question, and then some formatting / appearance questions. The first is, what does mlock_count represent for a multi-page folio that is partially mlocked? If you allocate an order-9 page then mmap() 13 pages of it and mlockall(), does mlock_count increase by 1, 13 or 512? Then we have a tradeoff between prettiness of the source code and prettiness of the htmldocs. At one maximum, we can make it look like this in the htmldocs: struct folio { unsigned long flags; struct list_head lru; unsigned int mlock_count; struct address_space *mapping; pgoff_t index; void *private; atomic_t _mapcount; atomic_t _refcount; #ifdef CONFIG_MEMCG; unsigned long memcg_data; #endif; }; but at the cost of making the source code look like this: struct folio { /* private: don't document the anon union */ union { struct { /* public: */ unsigned long flags; /* private: */ union { /* public: */ struct list_head lru; /* private: */ struct { void *__filler; /* public: */ unsigned int mlock_count; /* private: */ }; }; /* public: */ struct address_space *mapping; At the other extreme, the htmldocs can look more complicated: struct folio { unsigned long flags; union { struct list_head lru; struct { unsigned int mlock_count; }; }; struct address_space *mapping; pgoff_t index; void *private; atomic_t _mapcount; atomic_t _refcount; #ifdef CONFIG_MEMCG; unsigned long memcg_data; #endif; }; with the source code changes being merely: @@ -227,6 +227,7 @@ struct page { * struct folio - Represents a contiguous set of bytes. * @flags: Identical to the page flags. * @lru: Least Recently Used list; tracks how recently this folio was used. + * @mlock_count: Number of times any page in this folio is mlocked. * @mapping: The file this page belongs to, or refers to the anon_vma for * anonymous memory. * @index: Offset within the file, in units of pages. For anonymous memory, @@ -256,7 +257,9 @@ struct folio { union { struct list_head lru; struct { + /* private: */ void *__filler; + /* public: */ unsigned int mlock_count; }; }; Various steps in between are possible, such as removing the anonymous struct from the documentation, but leaving the union. We could also choose to document __filler, but that seems like a poor choice to me. Anyway, that's all arguable and not really too important. My mild preference is for the private/public markers around __filler alone, but I'll happily abide by the preferences of others. The important part is what mlock_count really means. We can be reasonably verbose here (two or three lines of text, I'd suggest).