Received: by 2002:ab2:7b86:0:b0:1f7:5705:b850 with SMTP id q6csp546658lqh; Sat, 4 May 2024 11:18:51 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW5dX1pSO4RazfA5EN+SakmgLpCwobfgM5kbgbxKUuUU80L4/kW//BA9RZvmKqOpo0FqYAKCIr+0537sqvtA3qRbBB7uqYAtLpHDBVbXw== X-Google-Smtp-Source: AGHT+IGAJNEYrg4lBqmhMhhxE8cceQHztgdHzjFSpE/QqLy9JJT/BudoUVyyY0UwblnNd0qRnUvv X-Received: by 2002:a17:907:20e2:b0:a59:9c58:763a with SMTP id rh2-20020a17090720e200b00a599c58763amr2814754ejb.46.1714846731281; Sat, 04 May 2024 11:18:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714846731; cv=pass; d=google.com; s=arc-20160816; b=NJWrTVwa5lHbP6J3XYYFiwyFp3oj/Zkxj/b2ak57DQqm4C4L2TNaAdI1ybXqyQ7O6X EPTw7HYTq13hMYaHW5ois+De1UVf/VPv1txySSjUfPkcT1LgGrmPiRAQ9axDDtppUvI4 w4UnUdTKyiM7X8mD0rCEdSTtL72w2uclMY4dCmaJ1Utm+jUaD+8QCXPL4XfTNL09Ghoq SvfQDulXtYv/7vY6pU6N8fdzoI4nQA2eIOHRTAXZ7xJLsq71hEw7pvbnaRLIsMBdXhqn twKUrsrUd8pfMQN9TK/bqJZbdTSHQQb8bupkgVVvmctvHTw9CUhQmxhY16pbB+mPlo8e ujRw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=bugBK4bVicVwJ/p8uME17lVc/KJdVPTAuYANbZgGvfE=; fh=XIehMoNIABZYw4jPMqUUb62eeH1uYrkMesD703g1lX8=; b=e6JBJ9I7OrLwVdbiKAVv/0Et7/TwaQ+7tnHKrw3y41HdmERb6vAvaxBk+Ee6JCcZ6l mnk8atubESLXNKokQPJIP4PVbRVUpVUGv2/jN2v3b+uKlJv7Krneqn3CLb+RV2T7/SYf sTjKktLFxq8AuTzgpHYupcpxSmjZkQHQ2dltM5z/dXTVqkppMqsCyk+qI+SFGyWQtDw4 1Z/3vy2K+HO53UzHMI5QTWjrQtMzT4+mHGKB8/Ow4DwwL0FfRpU9l7C4kd/+b2CsKtxv V4krSyLRcwG1IiqOhxMhRbt4hUgL3z/3c49pD0USQ1SnZ4xld+HYy7cvG0uu6czG0R5Y DdEw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VNT9yiUN; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-168779-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-168779-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id ji7-20020a170907980700b00a558d5be38bsi3154885ejc.793.2024.05.04.11.18.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 May 2024 11:18:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-168779-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VNT9yiUN; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-168779-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-168779-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 080611F219C1 for ; Sat, 4 May 2024 18:18:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E395F7174F; Sat, 4 May 2024 18:18:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="VNT9yiUN" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 146F35FB9A for ; Sat, 4 May 2024 18:18:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714846725; cv=none; b=N/sOEGyMfUM9sqZsceUU4XxOteQohVvkbe0bWnt0ePyVujJwPy7sy7MGe60f29CUwTGlFePSW9ynJSDh/sZiPZ4LDQGoiQHAHJmp1gOTKHNqi+Zv+K7yqMU6G3AL4O1qeLgMY4DMwsd5CnrHqk6LGP4dpn0NnadMSNvNvoxtdDo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714846725; c=relaxed/simple; bh=ZZwtGJIgqjmUgNmfD8u3kEp9oydtVn0LPqjsXEarNXg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Oz0Ug7hYfBNm+8PP27G3fMT4e0w+YuMIelb5T0IVRfN5ZQG4Mk7mjDeuw06GphV+VmcpGJ++QHE16B7fbsx9sUPQR2EHUCjQGEf7/HeKCaul4g/KuNyeMOpy5rnf/xgEHqcvKCzGEx9mjOqCQZwRR1oTrrkp8q7XVWRGOCoyb6g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=VNT9yiUN; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 726A9C072AA; Sat, 4 May 2024 18:18:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714846724; bh=ZZwtGJIgqjmUgNmfD8u3kEp9oydtVn0LPqjsXEarNXg=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=VNT9yiUNCAqaXsyaa2D4OrJyJcYrE6NJDoWeT0AzdV3Bid7BCa8dM98IOSGN00XJY 9n5huuFRPJ6Yx1Sh87ysrVRy27y0a5mTHuAba6XDZKcgJiD0vaoC67d98FM4MEyUZs 7RwG+S5GqYlObOkEbQ6hJEbV64EXkXemVQjHi8rQm63Jaltvi6SuGTZfNF55Qsn7+p RoHEOSoJMoEubAizhM6CN4LGeLSvODN4g6UwHV05kx/dPq+c7+eKzPcFHqdI4vUT3J x2HQrlz8H+dCaGCcBzaHAOqaR2nhnZTR2MLouAAdRT2+owtY8bEirSY3rHUokrD1Eo X1yVyJ2Qz4N8w== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 077C3CE0F69; Sat, 4 May 2024 11:18:44 -0700 (PDT) Date: Sat, 4 May 2024 11:18:43 -0700 From: "Paul E. McKenney" To: Linus Torvalds Cc: Boqun Feng , Marco Elver , Tetsuo Handa , Greg Kroah-Hartman , Dmitry Vyukov , syzbot , linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com, Nathan Chancellor , Arnd Bergmann , Al Viro , Jiri Slaby Subject: Re: [PATCH v3] tty: tty_io: remove hung_up_tty_fops Message-ID: <7aab574e-b6ba-4038-802f-2d64af09d802@paulmck-laptop> Reply-To: paulmck@kernel.org References: <1c886023-ae61-46ba-bb3c-b460c30de937@paulmck-laptop> <2beaba9f-6f83-4a7c-8835-fe5fe88a006c@paulmck-laptop> <3f2c415d-dc7e-4647-9002-4beb804d885c@paulmck-laptop> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Sat, May 04, 2024 at 10:50:29AM -0700, Linus Torvalds wrote: > On Fri, 3 May 2024 at 22:08, Paul E. McKenney wrote: > > > > You are right, this is going to need some arch-specific code for a few > > of the architectures. Hey, I was hoping!!! > > > > The compilers do not currently optimize these things, but things appear > > to me to be heading in that direction. > > Ok, so it sounds like right now it makes no sense - presumably > __atomic_load_n() doesn't actually generate better code than > READ_ONCE() does as-is, and we have the issue with having to make it > per-architecture anyway. > > But maybe in a couple of years we can revisit this when / if it > actually generates better code and is more widely applicable. Completely agreed. Here is my current thoughts for possible optimizations of non-volatile memory_order_relaxed atomics: o Loads from the same variable that can legitimately be reordered to be adjacent to one another can be fused into a single load. o Stores to the same variable that can legitimately be reordered to be adjacent to one another can be replaced by the last store in the series. o Loads and stores may not be invented. o The only way that a computation based on the value from a given load can instead use some other load is if the two loads are fused into a single load. Anything that I am missing? Thanx, Paul