Received: by 2002:ab2:7b86:0:b0:1f7:5705:b850 with SMTP id q6csp569472lqh; Sat, 4 May 2024 12:25:58 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWJ7MC1POnRVYStVdPsZJsVbkThTJtNfnmT0YecS2HeJ3/FAK4GEVGMfh9q5Md6i/5JIqpmzggkGNwyHYULenT4VhbjTNxPvO3S5r5DlQ== X-Google-Smtp-Source: AGHT+IFQzlE/neWV8TsFCw9DUrSnnn/jUNPqh3tpXa96wl1YEjxcJBnVtWokIl1v9aNz6rKBFXlY X-Received: by 2002:a05:620a:27c9:b0:792:8002:c2f2 with SMTP id i9-20020a05620a27c900b007928002c2f2mr6770545qkp.37.1714850758095; Sat, 04 May 2024 12:25:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714850758; cv=pass; d=google.com; s=arc-20160816; b=kkUh/shtRpATh7nVr1v0o3clUELd4b5Xz93klNQSdbDWln0UHDl6z2b6dqb2zs0R3S Xd2WzNKe09mcweDWwEX9FYdrvnHBczgQUaHZblJBBKRvgwAbZpzdb872KKO/WEBQKmeW Rf/rwLmLwCOpJSMEGABlsG++MyD9Yjb7FHNKmS/bJ9n1YLWrje86NMsZVAqV8owCA0PS IQ6JPtYWjSltfdONmYkrOs9ZklStn1lNC1ZoVSK7/T5+kCgBFhyVdy40c4KoDtGLR6th BXROM4FJtdTdvkkNVExcIzUoLKOBpX7NZ2drpafTHrNGgzFJN407s1Fg/ECy3FiVwIWx HKIg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :dkim-signature; bh=AzVGPeqOyogGFMBV1vFo5TD/D71MQY/fRBSu9alNMnY=; fh=Hg9nwXAoqxtmjcscHO3e69WsqVTXw9c/AwDe7oy1bgA=; b=kK6hDFYe7T5oPst2Uvwey6qAw+fXjVZgNUSGEkjfdZhFCDNrC1wdLBhs1KrQTjw1zA RInIlGQb2iLyeMmpAMKbkzt7wyv/a3cNOk3rQNSGN7YEBncmpUhE09/spDV3xpQLs4EQ ny6Ak6h1z/9xXGup4gVUgH//9+C4bSHclTGYGqFay46S1ihsoW7TT1P32wPeVUbyrENo vgSArWS60WKlBhTOtHUmRu2WaOtNTNFEjhlkEHFM64/nv4Suqv30szT0JiN7RZBZVi5s 7J/oMmCQ9GIEhECxfgmufbX/p7sXwwS3rVUbtt50Hk2VHm3XhxvxboWavQUmBBPn5wj8 tLPg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=RrgZFY2e; arc=pass (i=1 spf=pass spfdomain=linuxfoundation.org dkim=pass dkdomain=linux-foundation.org); spf=pass (google.com: domain of linux-kernel+bounces-168803-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-168803-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id h12-20020ae9ec0c000000b00790f9caef16si5548604qkg.568.2024.05.04.12.25.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 May 2024 12:25:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-168803-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=RrgZFY2e; arc=pass (i=1 spf=pass spfdomain=linuxfoundation.org dkim=pass dkdomain=linux-foundation.org); spf=pass (google.com: domain of linux-kernel+bounces-168803-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-168803-linux.lists.archive=gmail.com@vger.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id CF8C31C20C74 for ; Sat, 4 May 2024 19:25:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0D3D984DE6; Sat, 4 May 2024 19:25:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="RrgZFY2e" Received: from mail-lj1-f172.google.com (mail-lj1-f172.google.com [209.85.208.172]) (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 49BD884D14 for ; Sat, 4 May 2024 19:25:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714850735; cv=none; b=KGSTVgJrfCNwTzuzsCf+fty/iOsSLLUIGLlpuF21rvgH0FN8FBnKXWA0fRJXVK+gnKh9ReXlwPj852qdI/QSmgaJwgx4vl0XxAe0jG32eVgonv+rJpRlzp/qROjjgwCzcPK8+5PN9LCQMgRkNO3Ur//nOUfG4hLIcAQEPZp0t48= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714850735; c=relaxed/simple; bh=uUacTIg3oW/tfHkZjrilybVkU6Zn95Viljlcv7l4baM=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=C4IjE1DMKBCz/eUxcR/UT+sysb5QNl2tdbj4fnHgTTUbuED9bI+1GWWcY3Iy6XfuiEUi1XjkoA0jku7YqfcIVywA544zsEfkGXArRvuqMSrOO64+ayltpNXZMa5ZLsjZYwDdHJu+ya3KkUQJMcgJ8osqYyn+1Uh4Y3felp7xBHA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org; spf=pass smtp.mailfrom=linuxfoundation.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=RrgZFY2e; arc=none smtp.client-ip=209.85.208.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linuxfoundation.org Received: by mail-lj1-f172.google.com with SMTP id 38308e7fff4ca-2e20f2db068so8260981fa.2 for ; Sat, 04 May 2024 12:25:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; t=1714850731; x=1715455531; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=AzVGPeqOyogGFMBV1vFo5TD/D71MQY/fRBSu9alNMnY=; b=RrgZFY2eEqCJVOFKIxrCdFzH5j28NY7VWbiQJ2l6IwFSnCa4EAnEqWsMlyvn1n18c8 BXsLvzkM9bpSW1hwYue5lpbDUAsYOguwlw1w0xVxPRAkBo684GAE81fHAmOfigFRhtwD Fwpua38jCm47yek/t0nGrqvNrd59mYhuq1fJI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714850731; x=1715455531; h=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=AzVGPeqOyogGFMBV1vFo5TD/D71MQY/fRBSu9alNMnY=; b=fXSmozjhcQvZvQJD53xgJmVjYMhWdLPRNR57HbFGBs3CTDf5DMBFv8cOKR6+jUhvuY Sl4L72EMfn8raX/3WzC03qZw/y3tV0UEIoN41Qe7g4gZhs1LGzNCa7yBLabeMOedXleg TA9sgQT7i5HtFYfxYvp9dvfqhx9+APT2UX5VJhgGZcr3vm34c1O7S39XzMMD/uCnVaW3 PhaQKy88N1s1VMhtHxu97cqLgvVenZu0hKSgOtmXI5ObVysG8DNUWEy65Zs0pYPE7oQ0 FGbK0FLF64rWR6vRCSQQDmbx29lK6QK+Nt8XZxxNYBp7GBrITxkq2eFvTflEpsU6aurR d9fg== X-Forwarded-Encrypted: i=1; AJvYcCWU/MG6BDcqfvjd1fodY2haradAaw9GFx0zpp5MjrMQL7jz+A0tqU1+EmjuFtfLUhfjNSSrRQwtB65mcEgYu/8DbvtbvlToJ1iG23pv X-Gm-Message-State: AOJu0YylZizQHVsQ9Js4+ZM6Qo64wk9pNGGAgk6PrbtPTlLRWvbV6vR0 20VGJp/TOMEr0/TFB1k818NmLi/IkrKD4/JNFaQQ7rkNYr67atGI3PuJpXdGVHvJW10M5isqHt5 VSPSwiA== X-Received: by 2002:a2e:9dd1:0:b0:2df:a8e1:c24 with SMTP id x17-20020a2e9dd1000000b002dfa8e10c24mr4022674ljj.34.1714850731261; Sat, 04 May 2024 12:25:31 -0700 (PDT) Received: from mail-ej1-f53.google.com (mail-ej1-f53.google.com. [209.85.218.53]) by smtp.gmail.com with ESMTPSA id h25-20020a0564020e9900b00572cfb37bd6sm2369272eda.8.2024.05.04.12.25.29 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 04 May 2024 12:25:29 -0700 (PDT) Received: by mail-ej1-f53.google.com with SMTP id a640c23a62f3a-a556d22fa93so144534566b.3 for ; Sat, 04 May 2024 12:25:29 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCX7xzESF7yHQzYcSYaJEygGcxRNXbBuEYCllA9HbDYZtWRmqg9kgiHUsZVuFVQ1oRRJh3QRM2RexVlPRcLy8drqb162LzNhs42hxyxM X-Received: by 2002:a17:906:5fd5:b0:a59:9e55:748d with SMTP id k21-20020a1709065fd500b00a599e55748dmr2531564ejv.35.1714850729561; Sat, 04 May 2024 12:25:29 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <1c886023-ae61-46ba-bb3c-b460c30de937@paulmck-laptop> <2beaba9f-6f83-4a7c-8835-fe5fe88a006c@paulmck-laptop> <3f2c415d-dc7e-4647-9002-4beb804d885c@paulmck-laptop> <7aab574e-b6ba-4038-802f-2d64af09d802@paulmck-laptop> In-Reply-To: From: Linus Torvalds Date: Sat, 4 May 2024 12:25:12 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3] tty: tty_io: remove hung_up_tty_fops To: paulmck@kernel.org 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 Content-Type: text/plain; charset="UTF-8" On Sat, 4 May 2024 at 12:11, Linus Torvalds wrote: > > Anyway, the above are all normal optimizations that compilers > *already* do, and the only real issue is that with memory ordering, > the "dominance" thing will need to take into account the ordering > requirements of other memory operations with stricter memory ordering > in between. So, for example, if you have > > __atomic_store_n(ptr,1, RELAXED); > __atomic_load_n(otherptr,2, ACQUIRE); > __atomic_store_n(ptr,2, RELAXED); > > then the second store doesn't dominate the first store, because > there's a stricter memory ordering instruction in between. Actually, that was a bad example, because in that pattern, the second store does actually dominate (the second store can not move up beyond the ACQUIRE, but the first store can indeed move down after it, so dominance analysis does actually allow the second store to strictly dominate the first one). So the ACQUIRE would need to be SEQ for my example to be valid. Of course, usually the barrier that stops domination is something entirely different. Even without an actual conditional (which is almost certainly the most common reason why dominance goes away), it might be a function call (which could do any arbitrary memory ordering operations - there was a clang bug in this very case) or something like an explicit full memory barrier. Anyway, take that email as a "written in the MUA on the fly". There might be other thinkos in there. But I think the big picture was right. Linus