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=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS 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 D03ABC433E6 for ; Thu, 14 Jan 2021 19:10:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A013223B3E for ; Thu, 14 Jan 2021 19:10:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729962AbhANTKC (ORCPT ); Thu, 14 Jan 2021 14:10:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40982 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729950AbhANTKB (ORCPT ); Thu, 14 Jan 2021 14:10:01 -0500 Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com [IPv6:2a00:1450:4864:20::130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3F42CC061575 for ; Thu, 14 Jan 2021 11:09:21 -0800 (PST) Received: by mail-lf1-x130.google.com with SMTP id v67so9626443lfa.0 for ; Thu, 14 Jan 2021 11:09:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=JSFOf/M1xL/264JjP2cMg0iIIXj3yETLyQPUyKa74CY=; b=B76EQUji9gAB+zfxLKnpsCS1bruYEs8UE0K86b4ZZ4HnOVw2oDoZYKkLBaeiIM4QAz mONjjhdOwqqd67GGb7qSRXqRwSu3nqhcWj+4vkHjI362HcGbcUGfkK4a2r5IbTPwXyAU LX7ngQUjtOv+ApPsZBRKt+ekd7K/wWpMB+Gjc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=JSFOf/M1xL/264JjP2cMg0iIIXj3yETLyQPUyKa74CY=; b=rNnFZg2Ub8CRl8FfJvsiQ4c9yIdgHsGaywNeIJkiSL5at0ywWojTOPl/V2eYVKRZRY 7KQI88I/4SRtmcslJLktqtCf6qfjiSTDC1oBNDmOne4qo6IdoA7trBFauGScMcqyMwIe 9Cpy4ztc1ZxQCpGWLfcSNu2WjDLb7bNaX0LOEWsm0ZevkIxqW9TqE0Bw0WR5gouJG2m/ fp0QGZqlaoOjLh14DI2DMYAR2g7t8ocl0QZciS5t2KR6xMrNm0sTEjxy2Ui6PkUpP8dB y9aKBbU8el6ld9VoUiQrW8EyT4GOqpLo0c7p6RwaANXDldAM1dzZbk0MnYgMk4U72oQt ddOw== X-Gm-Message-State: AOAM5301SQp+Q0NZJ+i9xWrLPOKLdJJCk1F1P5zshgQfc7QCLgMFZZB7 0KVXg/tP5Uo5U4C28FmxMcWvQIHaiDxCFw== X-Google-Smtp-Source: ABdhPJx8jzU6TeJ1XCicWxncSdPzM6DiYZBV+RukSOcMOzrmqbeZrJqT9WdN/2DVhEiMHAgNdrrrqA== X-Received: by 2002:a19:844c:: with SMTP id g73mr3724563lfd.462.1610651359243; Thu, 14 Jan 2021 11:09:19 -0800 (PST) Received: from mail-lj1-f178.google.com (mail-lj1-f178.google.com. [209.85.208.178]) by smtp.gmail.com with ESMTPSA id i26sm305040lfl.309.2021.01.14.11.09.17 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 14 Jan 2021 11:09:18 -0800 (PST) Received: by mail-lj1-f178.google.com with SMTP id f17so7668709ljg.12 for ; Thu, 14 Jan 2021 11:09:17 -0800 (PST) X-Received: by 2002:a2e:6f17:: with SMTP id k23mr3659547ljc.411.1610651357370; Thu, 14 Jan 2021 11:09:17 -0800 (PST) MIME-Version: 1.0 References: <20210114175934.13070-1-will@kernel.org> <20210114175934.13070-5-will@kernel.org> <20210114190021.GB13135@willie-the-truck> In-Reply-To: <20210114190021.GB13135@willie-the-truck> From: Linus Torvalds Date: Thu, 14 Jan 2021 11:09:01 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC PATCH 4/8] mm: Separate fault info out of 'struct vm_fault' To: Will Deacon Cc: Linux Kernel Mailing List , Linux-MM , Linux ARM , Catalin Marinas , Jan Kara , Minchan Kim , Andrew Morton , "Kirill A . Shutemov" , Vinayak Menon , Hugh Dickins , Android Kernel Team Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 14, 2021 at 11:00 AM Will Deacon wrote: > > I tried that initially, but I found that I had to make all of the > members const to get it to work, at which point the anonymous struct > wasn't really adding anything. Did I just botch the syntax? I'm not sure what you tried. But this stupid test-case sure works for me: struct hello { const struct { unsigned long address; }; unsigned int flags; }; extern int fn(struct hello *); int test(void) { struct hello a = { .address = 1, }; a.flags = 0; return fn(&a); } and because "address" is in that unnamed constant struct, you can only set it within that initializer, and cannot do a.address = 0; without an error (the way you _can_ do "a.flags = 0"). I don't see naming the struct making a difference - apart from forcing that big rename patch, of course. But maybe we're talking about different issues? Linus 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=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS 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 02B03C433E0 for ; Thu, 14 Jan 2021 19:09:24 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 8D16123A58 for ; Thu, 14 Jan 2021 19:09:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8D16123A58 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id AE7C48D010E; Thu, 14 Jan 2021 14:09:22 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A97D58D00F0; Thu, 14 Jan 2021 14:09:22 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 986628D010E; Thu, 14 Jan 2021 14:09:22 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0212.hostedemail.com [216.40.44.212]) by kanga.kvack.org (Postfix) with ESMTP id 7F18A8D00F0 for ; Thu, 14 Jan 2021 14:09:22 -0500 (EST) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 28E9F3621 for ; Thu, 14 Jan 2021 19:09:22 +0000 (UTC) X-FDA: 77705318964.01.legs96_3c0d00127529 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin01.hostedemail.com (Postfix) with ESMTP id 066AA10051D21 for ; Thu, 14 Jan 2021 19:09:21 +0000 (UTC) X-HE-Tag: legs96_3c0d00127529 X-Filterd-Recvd-Size: 4714 Received: from mail-lj1-f169.google.com (mail-lj1-f169.google.com [209.85.208.169]) by imf44.hostedemail.com (Postfix) with ESMTP for ; Thu, 14 Jan 2021 19:09:21 +0000 (UTC) Received: by mail-lj1-f169.google.com with SMTP id w26so7715282ljo.4 for ; Thu, 14 Jan 2021 11:09:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=JSFOf/M1xL/264JjP2cMg0iIIXj3yETLyQPUyKa74CY=; b=B76EQUji9gAB+zfxLKnpsCS1bruYEs8UE0K86b4ZZ4HnOVw2oDoZYKkLBaeiIM4QAz mONjjhdOwqqd67GGb7qSRXqRwSu3nqhcWj+4vkHjI362HcGbcUGfkK4a2r5IbTPwXyAU LX7ngQUjtOv+ApPsZBRKt+ekd7K/wWpMB+Gjc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=JSFOf/M1xL/264JjP2cMg0iIIXj3yETLyQPUyKa74CY=; b=iiaofS+TsdcPEjF94mnLTS49X+TPs0ClOK63jCjK5N5SXKsUy7xrJJ2h5DgRiJm5jS gHxgKSeUUYF+kSSZdHVe0HPu3MIVtsnkJCypf3/7iyk9Xk7e2nBzhXDi2KrU1PhxxBSH nn1LZH4g5KnD1V2t4xH9Tb8MLJktL2sKdcSu5eDUP8ga9A+qjqwPR9j4nWYooIj6nz1v 2mTeLi3AXpN9p0WVLbjiq/6+BKS6RMa44cfBgM3kUvZQPSZdgTmzdlCwGcUkX4dTrIrr xUvNabe2/D7nyHqLMgdg3lRI4tunHdb83C615csHLF56pSW8PexdZ0jDwPBschKgaXVu S3cg== X-Gm-Message-State: AOAM530vHjF6xNeWMSgVP4ph1PGXoYxsoTi5qCO44bUGzHMD2HgYJ9LT nQkW/RThfb8hnBMjGm6Ed9Ky8rzeDcOamg== X-Google-Smtp-Source: ABdhPJy3Y8f0DajXze1hUt/CH9zpzx5d+mEd7DFPrEGz4yNKaIhTs3PSL6lO2DooU8T/wpN0MtsfVA== X-Received: by 2002:a2e:8013:: with SMTP id j19mr3657913ljg.434.1610651359283; Thu, 14 Jan 2021 11:09:19 -0800 (PST) Received: from mail-lj1-f173.google.com (mail-lj1-f173.google.com. [209.85.208.173]) by smtp.gmail.com with ESMTPSA id 5sm629701lfa.98.2021.01.14.11.09.17 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 14 Jan 2021 11:09:18 -0800 (PST) Received: by mail-lj1-f173.google.com with SMTP id p13so7740181ljg.2 for ; Thu, 14 Jan 2021 11:09:17 -0800 (PST) X-Received: by 2002:a2e:6f17:: with SMTP id k23mr3659547ljc.411.1610651357370; Thu, 14 Jan 2021 11:09:17 -0800 (PST) MIME-Version: 1.0 References: <20210114175934.13070-1-will@kernel.org> <20210114175934.13070-5-will@kernel.org> <20210114190021.GB13135@willie-the-truck> In-Reply-To: <20210114190021.GB13135@willie-the-truck> From: Linus Torvalds Date: Thu, 14 Jan 2021 11:09:01 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC PATCH 4/8] mm: Separate fault info out of 'struct vm_fault' To: Will Deacon Cc: Linux Kernel Mailing List , Linux-MM , Linux ARM , Catalin Marinas , Jan Kara , Minchan Kim , Andrew Morton , "Kirill A . Shutemov" , Vinayak Menon , Hugh Dickins , Android Kernel Team Content-Type: text/plain; charset="UTF-8" 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 Thu, Jan 14, 2021 at 11:00 AM Will Deacon wrote: > > I tried that initially, but I found that I had to make all of the > members const to get it to work, at which point the anonymous struct > wasn't really adding anything. Did I just botch the syntax? I'm not sure what you tried. But this stupid test-case sure works for me: struct hello { const struct { unsigned long address; }; unsigned int flags; }; extern int fn(struct hello *); int test(void) { struct hello a = { .address = 1, }; a.flags = 0; return fn(&a); } and because "address" is in that unnamed constant struct, you can only set it within that initializer, and cannot do a.address = 0; without an error (the way you _can_ do "a.flags = 0"). I don't see naming the struct making a difference - apart from forcing that big rename patch, of course. But maybe we're talking about different issues? Linus 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=-4.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 7FACBC433DB for ; Thu, 14 Jan 2021 19:10:37 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 217BD23B3E for ; Thu, 14 Jan 2021 19:10:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 217BD23B3E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=QgUzcpsn7ekcuyXghxHfU/COsXSC+KwqlfcvFfyTaXE=; b=INcESJuYf9c1sdT88o3/IUC1t 3YrzI2S3HaIa0v0wUfi9yy8gGXEaIaKFs3n5SH+Y/qGHJNhTSRzKws9up8uHqW6bj35EjCHYJmHoS t9UROl1XSfRHhpi7IXFQrCmbcHetnpHKGbIvYbe1oWRf89C/6r9wtk/MPeJ1hGhQg6QR5Tl1/mkAS NSrMaB5lN3CbCdF3NhD/aCSjID118blABYUzWquo5joJjasGFMh+3dzygZ7KqZQ5nrN08ZvZmIgQh LS+YT5AO3JGaVuFrwKq8DAM3yWSgdix34PNEIN/zbF6Iw12ky1fcqZALIOuWTylt5oO1Jn6/Y21w+ FwJ7diAGA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l07zo-0007Vc-9J; Thu, 14 Jan 2021 19:09:24 +0000 Received: from mail-lf1-x135.google.com ([2a00:1450:4864:20::135]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l07zl-0007Uu-E5 for linux-arm-kernel@lists.infradead.org; Thu, 14 Jan 2021 19:09:22 +0000 Received: by mail-lf1-x135.google.com with SMTP id x20so9560591lfe.12 for ; Thu, 14 Jan 2021 11:09:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=JSFOf/M1xL/264JjP2cMg0iIIXj3yETLyQPUyKa74CY=; b=B76EQUji9gAB+zfxLKnpsCS1bruYEs8UE0K86b4ZZ4HnOVw2oDoZYKkLBaeiIM4QAz mONjjhdOwqqd67GGb7qSRXqRwSu3nqhcWj+4vkHjI362HcGbcUGfkK4a2r5IbTPwXyAU LX7ngQUjtOv+ApPsZBRKt+ekd7K/wWpMB+Gjc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=JSFOf/M1xL/264JjP2cMg0iIIXj3yETLyQPUyKa74CY=; b=sYSm4jIONvBZ3NiW2CB0+alQn/riPsrZZFG6ZJljOBx2nNmvdGjocMfKqf1mhEeKjN xFLRaXNQXietzyWwbf2rNP21rXPMr6Ur+9sPtktnO2BguDcGLP/8zqWfTnq6BnlALNgO v4+NrT9tSI2uZQYNmtBWcjRqH79LJu7pa7B8m7yP5XOPXfBGffySHj5RnFTL3DBmRTZQ YQ/VI6mGy5YLPYZC0Rp+pl0EOzwV86CVKSzS3/JlkYpeE18ZiVJOEe6MqF3yjO3GK+mX 2CXMy0O5K+vG3QrFDShoiVSDNBJvCEKQQeTHXrt0RcUllLWe+0GSWlomq0lfjeEqsJOg vAQw== X-Gm-Message-State: AOAM5337gHWp+oaq+jBs5UzugwXjAT8AAopI6hBPCpykpHVyQeUv8BgO BS/NnDQ1ZvAJ2TTsuhfm0CUo/0lax5OAvw== X-Google-Smtp-Source: ABdhPJzoU+qAtJfayddoRZdnNC8h1iCMO09ews3jLHjDmYNdZ0S1R+HZnRxwhN8+0Z3IYdqsqAuWEw== X-Received: by 2002:a19:c158:: with SMTP id r85mr3649096lff.405.1610651359315; Thu, 14 Jan 2021 11:09:19 -0800 (PST) Received: from mail-lj1-f170.google.com (mail-lj1-f170.google.com. [209.85.208.170]) by smtp.gmail.com with ESMTPSA id x17sm644707lfg.0.2021.01.14.11.09.17 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 14 Jan 2021 11:09:18 -0800 (PST) Received: by mail-lj1-f170.google.com with SMTP id u11so7667723ljo.13 for ; Thu, 14 Jan 2021 11:09:17 -0800 (PST) X-Received: by 2002:a2e:6f17:: with SMTP id k23mr3659547ljc.411.1610651357370; Thu, 14 Jan 2021 11:09:17 -0800 (PST) MIME-Version: 1.0 References: <20210114175934.13070-1-will@kernel.org> <20210114175934.13070-5-will@kernel.org> <20210114190021.GB13135@willie-the-truck> In-Reply-To: <20210114190021.GB13135@willie-the-truck> From: Linus Torvalds Date: Thu, 14 Jan 2021 11:09:01 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC PATCH 4/8] mm: Separate fault info out of 'struct vm_fault' To: Will Deacon X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210114_140921_598467_04019757 X-CRM114-Status: GOOD ( 15.88 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jan Kara , Minchan Kim , Catalin Marinas , Hugh Dickins , Linux Kernel Mailing List , Linux-MM , Vinayak Menon , "Kirill A . Shutemov" , Andrew Morton , Android Kernel Team , Linux ARM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Jan 14, 2021 at 11:00 AM Will Deacon wrote: > > I tried that initially, but I found that I had to make all of the > members const to get it to work, at which point the anonymous struct > wasn't really adding anything. Did I just botch the syntax? I'm not sure what you tried. But this stupid test-case sure works for me: struct hello { const struct { unsigned long address; }; unsigned int flags; }; extern int fn(struct hello *); int test(void) { struct hello a = { .address = 1, }; a.flags = 0; return fn(&a); } and because "address" is in that unnamed constant struct, you can only set it within that initializer, and cannot do a.address = 0; without an error (the way you _can_ do "a.flags = 0"). I don't see naming the struct making a difference - apart from forcing that big rename patch, of course. But maybe we're talking about different issues? Linus _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel