From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-lf1-f43.google.com (mail-lf1-f43.google.com [209.85.167.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 015EE26A1DF for ; Thu, 6 Mar 2025 19:16:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741288580; cv=none; b=ecPIjJ75+0EBv5cCqoYKkhsZ9oDVaqo7JS0u92YGg0hgA5UDMt9Afcqg4mrpgwZz6Tw4Hb71tUitK1RqA0F6b+7TAshAywucTR8OpSuUlu9uiO2Vg+Lj5oC/sfCHmGF3kUiDj9IKoynPzMEWzmF0hhfkyE4suKkJ90R7B/rGgH8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741288580; c=relaxed/simple; bh=q2hPBFkNdaK4S3iQuw7LOrhtKH0/q3Oertms5sis28U=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=ZX/8V6nbVTDE28tEqQXwwhETsCG8LD5V9SkLvfNS5JCOtSlq8QubJ7ssOVHpQQSLIfXnbQZ4tIl1drdMEloADf6EN4V9nnHmh2frKrEzZ/dITrRNuY52Ts+R6BkfE9g0vsQ8w6a7AWCSbVFT5rsrUMgvDBdnDJGkfzljIFO6lMM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=St5lUXnn; arc=none smtp.client-ip=209.85.167.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="St5lUXnn" Received: by mail-lf1-f43.google.com with SMTP id 2adb3069b0e04-5496078888eso1239705e87.0 for ; Thu, 06 Mar 2025 11:16:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1741288574; x=1741893374; darn=lists.linux.dev; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=3zWv5vfgOjb/x6VCa5m+Ij1S1ZZkHOGvhDIcER6Dvj4=; b=St5lUXnnus5mz4/5kNutE2IsptW8BdZyGB+1T6Vg/+zRhAbPO5/u4YZl9FwUlsavD0 h2FZ7G1QY5DbBKeoFZ2quOB2WyG5Ii9aWqJDDq1WoTcd5Cmils/rxuq87vQlk+MRbJuq QsU5tQA6po0TfvGnS1hELVBvQxnbhK0lQ2Oj+9jOt/+O/0sNlo+kzaRAmNwUA9yg72H1 ZGz9SvGxaKnCOwcs4ieAz2hstWUuacZgE7twITKCHeN+RQl46s3Lp+9HZtf5U02WpgqV TVV9u1KA0P0vxHjfZlFvJZTNjxWCgAog93RfTZyOAy/wb8TzpnK8LizP9XzkUOca9m6g 4NTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741288574; x=1741893374; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3zWv5vfgOjb/x6VCa5m+Ij1S1ZZkHOGvhDIcER6Dvj4=; b=Z9mm9wVd6Odlyqc++qnCQlUHEFwnkIORFgdCL+s5DWC3gHDhEnq1qnVefHmuMOZAAb lDaVM850nwhPokrApfin829/s7kxK5xWVlEZ3L3+8yz0glBo7IFriZczyJc8dGkn1cmJ pw5Z2t5ygvMHFmI/2ypDO6r41FVVPI7XR0VKXAGZwhp4y61kA7jra+VJ3c8mkU4GgnLK ePImbi0e3SrNaFO4oYAdqsB3CWCR9wPeZ2TWaAnvi0IS+NE+7PpKafMrPhKhB8QaWzBA 38Fw/YHqBmecGZu0QYDzjl+MrDXPOcBh3RzIxFLep+oMNggfJH6k02HTwcB5PG/uWlWi 8/Iw== X-Forwarded-Encrypted: i=1; AJvYcCWF/d3wCZEN0hPBL9UqFrwmmjhxxL6I3xxFunnCgZ4WGaF8wFYRnFsnBDQ/WY+qmElHw7XKkrPN@lists.linux.dev X-Gm-Message-State: AOJu0Ywa3YRVaccZmIyZ02GCastptJTnIrwLKMOJCYudX6Ak86vbpnaj R40kD3g75BeShx3rlNo2+xi4nZ16LV3HbkiLys/3iBbaJUwZk8yyNswAcK5lFdGaHjk5xLKKsB3 tR3ou2SRdzG6PJSL6nsm6mrsrdHc= X-Gm-Gg: ASbGncvtLfOh4Nx3/5xcbpSHrjoXmEaj3dgw4zTkMsIuLZgAfiw7AQjXU4/FV7wCqZL ays6qSYonRVhWN0l3Ky0RGtZvY8XcCtt/9Y81zoS22lzihacaSL7ZVhzRGVG7zR1iBLTW1uWgzc VmrD8XJ0Rva6pAetTehXMJHt4etw== X-Google-Smtp-Source: AGHT+IH0/6rfvsSTjj6Oho1kqCGlqCatvY17T4k/5nKHZE91YXjib3mpD3ttoqN2cRr2pmaWptEyM20iYuRcS8FKznI= X-Received: by 2002:a05:6512:1245:b0:545:5d:a5cd with SMTP id 2adb3069b0e04-54990e2c073mr127331e87.6.1741288573786; Thu, 06 Mar 2025 11:16:13 -0800 (PST) Precedence: bulk X-Mailing-List: ksummit@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <6pwjvkejyw2wjxobu6ffeyolkk2fppuuvyrzqpigchqzhclnhm@v5zhfpmirk2c> <5d7363b0-785c-4101-8047-27cb7afb0364@ralfj.de> In-Reply-To: From: Ventura Jack Date: Thu, 6 Mar 2025 12:16:00 -0700 X-Gm-Features: AQ5f1JottkKmRWm9d9-3BOGDaY6aX18jU7z4bz0wmQr9-3z_OciBPEKZEX-A_TU Message-ID: Subject: Re: C aggregate passing (Rust kernel policy) To: Linus Torvalds Cc: Kent Overstreet , Martin Uecker , Ralf Jung , "Paul E. McKenney" , Alice Ryhl , Gary Guo , airlied@gmail.com, boqun.feng@gmail.com, david.laight.linux@gmail.com, ej@inai.de, gregkh@linuxfoundation.org, hch@infradead.org, hpa@zytor.com, ksummit@lists.linux.dev, linux-kernel@vger.kernel.org, miguel.ojeda.sandonis@gmail.com, rust-for-linux@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Feb 26, 2025 at 4:17=E2=80=AFPM Linus Torvalds wrote: > > On Wed, 26 Feb 2025 at 14:27, Kent Overstreet = wrote: > > > > This is another one that's entirely eliminated due to W^X references. > > Are you saying rust cannot have global flags? > > That seems unlikely. And broken if so. > > > IOW: if you're writing code where rematerializing reads is even a > > _concern_ in Rust, then you had to drop to unsafe {} to do it - and you= r > > code is broken, and yes it will have UB. > > If you need to drop to unsafe mode just to read a global flag that may > be set concurrently, you're doing something wrong as a language > designer. > > And if your language then rematerializes reads, the language is shit. > > Really. > > Linus Rust does allow global mutable flags, but some kinds of them are very heavily discouraged, even in unsafe Rust. https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references= .html Best, VJ.