Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp987661rdg; Wed, 11 Oct 2023 10:52:46 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFDLGX0yLP0q7Jt7yjjXntH//jpX+DEGuP2qaYSuao88/nmnttpFGI7+imjSZv8GhFwlDr0 X-Received: by 2002:a05:6871:a407:b0:1e9:54a3:9884 with SMTP id vz7-20020a056871a40700b001e954a39884mr6443621oab.15.1697046765787; Wed, 11 Oct 2023 10:52:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697046765; cv=none; d=google.com; s=arc-20160816; b=EWPPSkAdtFfzc7WPkGjw/Zb81/SmJxFeb3ZBXP6hZB9m9QKxEF8hI994h+7pFwqM8L kfjNKTReI6z0U4AfGHV7E4tgaL7+YbMTuA4BFYvIzwakpeJa/sO1Yg+rRqQNcMaPycUm QOhoCA6ir/OD9es7PVQoGqZ9RSXnPJXLJbo2OpeDmhhXhaQ8h3JR5jrzgqOdNoc9ky23 YSR82PnNpHwmORCFfJqrKh+iE7/pumyDN5jx7JAM5f9E4KvfAtcICosRuL2FHfDpLH7k WZE9FF6c9X+g9ffaTF5+WksCTAIBE0CxZgWYAGhR6OtyOBmVtpu1bj4PPbyaRGGPT890 DdGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=ZGl21MOBfkP1+P7xVTdd9271KitNJH2gTTxiXzDzkX4=; fh=mKu8LavDMUKdOgGc00Xawe8/Cawqq3y1ARu8W8cWNlc=; b=rH6KBOW0ls1d0EUXov2HPLaG1Zgo7NPgEbuhifkScl8LSyh4JJxHTS9clqUCgH/QR4 3a4AWZH6pu/lafTWJnPCAdV1Ydvmy30ZjsTo4mpzCbO0PHNPo/Vl+28rfICFKWhbz5k9 oOVGu1C6f47kkQ/DvFWcvVgb8EvHKU+mQ3dTqQBM6kaDo8zLmnrbrTq0xZTTolJVTF47 3AT43jpXSCzlZJluA6Kle9GL8sqgOpWnzzzR878u+O0NIbtPGak5dzCEgJti2CD8BbvJ rWFDiWN3EPos+AR02OhofsXUUCu+49mIOLphg6RklDYq67/FHJh0tY2EczPXV3iX/gHr ikPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=Iy+wfx9x; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id i135-20020a636d8d000000b0057745d87b4csi264707pgc.526.2023.10.11.10.52.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 10:52:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=Iy+wfx9x; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 40F8480763D7; Wed, 11 Oct 2023 10:52:43 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232010AbjJKRwf (ORCPT + 99 others); Wed, 11 Oct 2023 13:52:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56544 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229900AbjJKRwe (ORCPT ); Wed, 11 Oct 2023 13:52:34 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D72CB8F for ; Wed, 11 Oct 2023 10:52:33 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C7178C433C8; Wed, 11 Oct 2023 17:52:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1697046753; bh=0gxXft5Dmd/xRZK1WzgEBNDiWxqzsx2oS4+h+BmCYqU=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Iy+wfx9x+yTJATOATcp98r5KNcZxUID/VRAgEhg+oe81hvpc1Dwk9xggv9a5qiagZ 7YRFbZv07Wra1O2MF4XPLHZVXGdk1txr/5cqCO1S8XaNhagStHAF8CvJ6qNCx9Uxrv luTR6ZF4UQBwqIT0D8qYcIg0bEczzRqJJ8hTP/2o= Date: Wed, 11 Oct 2023 10:52:11 -0700 From: Andrew Morton To: Alexey Dobriyan Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH] *: mark stuff as __ro_after_init Message-Id: <20231011105211.3135013317249184bcc81982@linux-foundation.org> In-Reply-To: <4f6bb9c0-abba-4ee4-a7aa-89265e886817@p183> References: <4f6bb9c0-abba-4ee4-a7aa-89265e886817@p183> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Wed, 11 Oct 2023 10:52:43 -0700 (PDT) On Wed, 11 Oct 2023 19:55:00 +0300 Alexey Dobriyan wrote: > __read_mostly predates __ro_after_init. Many variables which are marked > __read_mostly should have been __ro_after_init from day 1. > > Also, mark some stuff as "const" and "__init" while I'm at it. I did this: From: Andrew Morton Subject: mark-stuff-as-__ro_after_init-fix Date: Wed Oct 11 10:46:42 AM PDT 2023 revert sysctl_nr_open_min, sysctl_nr_open_max changes due to arm warning arm allnoconfig: fs/file_table.c:137:35: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers] 137 | .extra1 = &sysctl_nr_open_min, | ^ fs/file_table.c:138:35: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers] 138 | .extra2 = &sysctl_nr_open_max, | ^ Cc: Alexey Dobriyan Signed-off-by: Andrew Morton --- fs/file.c | 4 ++-- include/linux/file.h | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) --- a/fs/file.c~mark-stuff-as-__ro_after_init-fix +++ a/fs/file.c @@ -25,10 +25,10 @@ #include "internal.h" unsigned int sysctl_nr_open __read_mostly = 1024*1024; -const unsigned int sysctl_nr_open_min = BITS_PER_LONG; +unsigned int sysctl_nr_open_min = BITS_PER_LONG; /* our min() is unusable in constant expressions ;-/ */ #define __const_min(x, y) ((x) < (y) ? (x) : (y)) -const unsigned int sysctl_nr_open_max = +unsigned int sysctl_nr_open_max = __const_min(INT_MAX, ~(size_t)0/sizeof(void *)) & -BITS_PER_LONG; static void __free_fdtable(struct fdtable *fdt) --- a/include/linux/file.h~mark-stuff-as-__ro_after_init-fix +++ a/include/linux/file.h @@ -113,7 +113,6 @@ int receive_fd_replace(int new_fd, struc extern void flush_delayed_fput(void); extern void __fput_sync(struct file *); -extern const unsigned int sysctl_nr_open_min; -extern const unsigned int sysctl_nr_open_max; +extern unsigned int sysctl_nr_open_min, sysctl_nr_open_max; #endif /* __LINUX_FILE_H */ _