Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp2045832rdd; Thu, 11 Jan 2024 18:55:59 -0800 (PST) X-Google-Smtp-Source: AGHT+IHsOAze4kpfXCF7g3XNvJ2p1QHW2eFm5PSuGnt4CTGPpSk5Ge8DOKB4HVmmgzLEoQjxjxvl X-Received: by 2002:a92:dc91:0:b0:360:7fd4:bac3 with SMTP id c17-20020a92dc91000000b003607fd4bac3mr355549iln.46.1705028158972; Thu, 11 Jan 2024 18:55:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705028158; cv=none; d=google.com; s=arc-20160816; b=OmX+iKlAdfOIraYIpaulvovq8Y6euY/dwNF808HTOj0GC3fGh4ZDpFuqH7s/LbPmJe ZEuw6UJUMd7NTpicOA448NJBvKd3L8iT/CcvlmFcVNRPxQwh8dVF5+6e2guET+9STfid 7x8kGLPubSYjy4hWCrxY3L9Q0yHu0BIDb/PyyDv8yaYN1UjDDwL4ZTQUdwMHn5p/4EcS R/nUJ7ePTPTkCSj/nkZvLNaatxBpnfPcNtH3IG7/mwjWnkaRBdQB49si6eqpK2oX8U9Q Lk2Udd/5LzRHhV0PxDrWcCYnDaZlLXGpPtZfkc7R+zw5MBJFtAwQBH/b10+vA7Vtjw/y 9ngQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:references:to:from :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature :dkim-filter; bh=uK0/9rbfDfcAI/GGyRYe4b5BWbtxjK6N6VZfagVqrDE=; fh=qHP3wJ+kPe9iglO5BfpI8v3nsWqJyynNMhZ80n6a6/A=; b=nLClpQ741U5TgbS+xAs+lqT8MIXIn6kaU7X/MNnW5rVw8lMM/J69vLQxdZS84rejn0 4BktTJcFqZTL1HxAaOICEV3R+Z+CjFaE9j8TvF3ojFzTmD1gL0WOdzsKvI8n/g6fwqD3 +/BzFrL/H6awPkbeasJOEEwzTQbWpZHAOtNjoKADosivYLZ1efTTNkswyV1tY1hnUIP+ MvjS6u3GGdiWTyFuaJpZbn8vlPEQd35G7JHw/+B1ysQRX5CvuVCZw4mbo7yfPtXlIctU Pg2j+uLQVAgz/5YeXEHb/o0jB0Rdkf+0yIVfwhSMT4DCO7Qdnqu2PnMeU1kwPX99p7t3 buCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zytor.com header.s=2023121201 header.b=QaoTr9z2; spf=pass (google.com: domain of linux-kernel+bounces-24249-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-24249-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zytor.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id b4-20020a6567c4000000b005cee0fe93aesi2281531pgs.472.2024.01.11.18.55.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Jan 2024 18:55:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-24249-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@zytor.com header.s=2023121201 header.b=QaoTr9z2; spf=pass (google.com: domain of linux-kernel+bounces-24249-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-24249-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zytor.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 021E12834AA for ; Fri, 12 Jan 2024 02:55:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CF5AE63F; Fri, 12 Jan 2024 02:54:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=zytor.com header.i=@zytor.com header.b="QaoTr9z2" Received: from mail.zytor.com (terminus.zytor.com [198.137.202.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4C7D0C151 for ; Fri, 12 Jan 2024 02:54:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zytor.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=zytor.com Received: from [IPV6:2601:646:8002:4641:eb14:ad94:2806:1c1a] ([IPv6:2601:646:8002:4641:eb14:ad94:2806:1c1a]) (authenticated bits=0) by mail.zytor.com (8.17.2/8.17.1) with ESMTPSA id 40C2skmQ060187 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NO); Thu, 11 Jan 2024 18:54:46 -0800 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.zytor.com 40C2skmQ060187 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2023121201; t=1705028087; bh=uK0/9rbfDfcAI/GGyRYe4b5BWbtxjK6N6VZfagVqrDE=; h=Date:Subject:From:To:References:In-Reply-To:From; b=QaoTr9z22PwK9nPBDrsNqpSc5YA67jS7MSgMLqTQD8QkuDSUderJTN6oKqVQ7mWsn AMEfL+1Ys0TBWRRhkY6+hCPRyE3SxdfNwNz8AcyDJETRgsWiBp7xr6S4bSUnHdOL3b HKKdcKsCDNnSrDVl5c14J4Agoa32y7VBTwQsFsyCRfqLfniH1JWqFTV5bLG+imJDXl 3fUFl8NI2rsCPHQisFkwoLyEZSPmkVaNBJ9GGsOrpLT3ALXj1FgjzhUJhzlgQxJKtc djMqKwbvMAmnR+j4FmeZkt6hRsIE3/LgTyQjykn5j0M3rxpdKhVrim3vzL9DYFyy3L gFeGgK7wm8fIg== Message-ID: <49231a98-d39f-4920-8d9f-e60aa014f518@zytor.com> Date: Thu, 11 Jan 2024 18:54:41 -0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 00/45] C++: Convert the kernel to C++ Content-Language: en-US From: "H. Peter Anvin" To: David Howells , linux-kernel@vger.kernel.org, pinskia@gmail.com References: <152261521484.30503.16131389653845029164.stgit@warthog.procyon.org.uk> <3465e0c6-f5b2-4c42-95eb-29361481f805@zytor.com> In-Reply-To: <3465e0c6-f5b2-4c42-95eb-29361481f805@zytor.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit One thing I forgot to mention that would be quite useful is careful use of namespaces. For example, putting init functions in their own namespace would have not only make it a lot harder to call init functions from non-init functions by mistake (calling init::func() explicitly is a highly visible "I really do mean to do this." However, it also let us do separate init versions of functions like cpu_feature_enable() that contain optimizations that aren't actually usable at init time (alternatives have not been applied.) The idea is *not* to change the code, but rather the compiler will simply prefer init:: functions from inside other init:: functions (a direct consequence of how namespaces work.) -hpa