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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2ACF2ECAAD5 for ; Sun, 4 Sep 2022 00:44:19 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7C7158016C; Sat, 3 Sep 2022 20:44:18 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7759E8015A; Sat, 3 Sep 2022 20:44:18 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5EF318016C; Sat, 3 Sep 2022 20:44:18 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 4CA2B8015A for ; Sat, 3 Sep 2022 20:44:18 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 16ADD120408 for ; Sun, 4 Sep 2022 00:44:18 +0000 (UTC) X-FDA: 79872556596.26.61F8CD4 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf15.hostedemail.com (Postfix) with ESMTP id 9C4F8A005B for ; Sun, 4 Sep 2022 00:44:16 +0000 (UTC) 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=VgZUWonFXghhtt5ROODmAtF6XCElehYl9WEnTRMkU4U=; b=p2tNiPV8B4Owk+I9S9LGcb0Ffl arPOj+UxtZPvVjBQ8PbxtYNKdy9TR4rR750Bsp7PJeuLGtR4f+VTpp6ICPG0enO5jIuZPbumLhBaU CA3f9Oe9wVFhkDZ7KdpfA/inhmyzoXZK/svLmgRjV/ogPM319dOv1yulWti7PPabUpJqQhdGytPDR 897QCDJsrzdxbA6Q453LKr7LNzqWmEGlIWO1COt32cV7q8LtQZaWNQCi//VpakH1sCbJ6lZkFWc06 cb0d3bLCYuqN1AP9hotBL1yIqXvOHWKOb76aqorBeam3AfiDrM9Z3xwd5jaDXnFzkBxOKwZPA+gfk hmORN3+w==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1oUdkF-008HRm-1Z; Sun, 04 Sep 2022 00:44:15 +0000 Date: Sun, 4 Sep 2022 01:44:14 +0100 From: Matthew Wilcox To: Andrew Morton Cc: linux-mm@kvack.org Subject: Re: [PATCH v2 02/57] mm: Add the first tail page to struct folio Message-ID: References: <20220902194653.1739778-1-willy@infradead.org> <20220902194653.1739778-3-willy@infradead.org> <20220902162830.dbf5291da3570017414544eb@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220902162830.dbf5291da3570017414544eb@linux-foundation.org> ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=p2tNiPV8; spf=none (imf15.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1662252257; a=rsa-sha256; cv=none; b=7WiTqEKJLJmaEVMhGGzGVgP9LzMhkIrfoIVUhtmoBVgmSszR2LSNLeeYjPdqH/p6amE4EO fuRwQ6Pf1Zelh6RHDuLteg8i3Cimrx74IRiYBBGOB2sjX3lvxu8PT1AQATeBziZhLpHeiK w4t/BRPo+GZ39nepD/aT31WGp54F8Jg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1662252257; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=VgZUWonFXghhtt5ROODmAtF6XCElehYl9WEnTRMkU4U=; b=l7ZKXTyJo5YuFNp3lNoes2T5D2hj2199gnEkT1+gpsOoQJYkfINKJCSdJGn1AIlF619cYi YuUIc4pi3JnY2JofFlkMONN7ve2qlwMDmpsoaofcEVUQy+WqvIxYnTiHNe132MnzIszE0G lXrDmnLMWvRmiSx4DVArMfoJQOzESb4= X-Rspam-User: Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=p2tNiPV8; spf=none (imf15.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 9C4F8A005B X-Stat-Signature: 8wbdr6yqkragn1ymdqykcq7tf3ak6qud X-HE-Tag: 1662252256-960542 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 Fri, Sep 02, 2022 at 04:28:30PM -0700, Andrew Morton wrote: > On Fri, 2 Sep 2022 20:45:58 +0100 "Matthew Wilcox (Oracle)" wrote: > > > Some of the static checkers get confused by extracting the page from > > the folio and referring to fields in the first tail page. Adding these > > fields to struct folio lets us avoid doing that. It has the risk that > > people will refer to those fields without checking that the folio is > > actually a large folio, so prefix them with underscores and document > > the preferred function to use instead. > > > > Huh. Silly checkers. > > Which one(s)? I have a report from Coverity rendered as an image because apparently you have to have an authorised account. I applied for one back in April and that disappeared into a void. https://www.infradead.org/~willy/linux/image.png is what I was sent by someone who did get an account. I don't know that it's all that silly. Given: struct folio { union { ... struct page; } }; then referring to folio->page[1] seems like a pretty good thing to warn about. > > + unsigned long _flags_1; > > + unsigned long __head; > > + unsigned char _folio_dtor; > > + unsigned char _folio_order; > > + atomic_t _total_mapcount; > > + atomic_t _pincount; > > +#ifdef CONFIG_64BIT > > + unsigned int _folio_nr_pages; > > +#endif > > }; > > Do we really want to muck things up like this? Can it at least be > declared temporary until the checker(s?) are fixed? I'm more inclined to go the other way -- remove these elements from struct page. I can do some followup patches in that direction if you like?