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 X-Spam-Level: X-Spam-Status: No, score=-7.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C0093C433E0 for ; Thu, 21 Jan 2021 12:48:34 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 4CA90239FD for ; Thu, 21 Jan 2021 12:48:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4CA90239FD Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 6C7F66B0007; Thu, 21 Jan 2021 07:48:33 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 678896B0008; Thu, 21 Jan 2021 07:48:33 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 568066B000A; Thu, 21 Jan 2021 07:48:33 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0036.hostedemail.com [216.40.44.36]) by kanga.kvack.org (Postfix) with ESMTP id 3FEF06B0007 for ; Thu, 21 Jan 2021 07:48:33 -0500 (EST) Received: from smtpin20.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 07B2E180AD81F for ; Thu, 21 Jan 2021 12:48:33 +0000 (UTC) X-FDA: 77729760906.20.burst22_5e133f427563 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin20.hostedemail.com (Postfix) with ESMTP id D5410180C07A3 for ; Thu, 21 Jan 2021 12:48:32 +0000 (UTC) X-HE-Tag: burst22_5e133f427563 X-Filterd-Recvd-Size: 3022 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf36.hostedemail.com (Postfix) with ESMTP for ; Thu, 21 Jan 2021 12:48:32 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 1CC5423A01; Thu, 21 Jan 2021 12:48:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1611233311; bh=gLBZ7oIpe4JqnDbPBI/B1Zlmga9NbjcRNWLoXqmmt/Q=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=t8zT771FvzWVLMViNI1FkbfkOnv/sOEZdK2gPYaYI2hZb3wZERrPo/yN0gxEJGMhY w6nq0IJSB+ARpx62eOTR1jllZOp1kNO5Aufl1jvFxlsIte7d6xgKsCLEsJcBY8cjLO L7g+Mow3w3fQb3dQ8hq8fWL9TvxKlqJhLeNAkPJjsokn59SJleo5k17GG8cniM6WXb AgoVklXAflBSf9MQWv/zeFNyG4ZVAAZM3t1+YZkrKGbnnu6NM3wXiAzqD5dTNl2vgj i3g6M2WYCu4leCNMAFkdHaavEIx8aOyJNOlGtX1/MQcCgrr2jgUmvyxvSbqB2kt/PP 8DbVYEjiY2SPA== Date: Thu, 21 Jan 2021 12:48:25 +0000 From: Will Deacon To: Nick Desaulniers Cc: LKML , Linux Memory Management List , Linux ARM , Catalin Marinas , Jan Kara , Minchan Kim , Andrew Morton , "Kirill A . Shutemov" , Linus Torvalds , Vinayak Menon , Hugh Dickins , kernel-team Subject: Re: [PATCH v4 4/8] mm: Move immutable fields of 'struct vm_fault' into anonymous struct Message-ID: <20210121124825.GB22123@willie-the-truck> References: <20210120173612.20913-1-will@kernel.org> <20210120173612.20913-5-will@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) 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 Wed, Jan 20, 2021 at 10:13:37AM -0800, Nick Desaulniers wrote: > On Wed, Jan 20, 2021 at 9:36 AM Will Deacon wrote: > > > > 'struct vm_fault' contains both information about the fault being > > serviced alongside mutable fields contributing to the state of the > > fault-handling logic. Unfortunately, the distinction between the two is > > not clear-cut, and a number of callers end up manipulating the structure > > temporarily before restoring it when returning. > > > > Try to clean this up by moving the immutable fault information into an > > anonymous struct, which will later be marked as 'const'. GCC will then > > complain (with an error) about modification of these fields after they > > have been initialised, although LLVM currently allows them without even > > a warning: > > > > https://bugs.llvm.org/show_bug.cgi?id=48755 > > I think this paragraph+link would be better on patch 8/8. Agreed, I'll move it. Will