Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp710857lqm; Wed, 1 May 2024 13:15:46 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX1QQz3znd/nelqTkG3aPNKPmuY1MkoiKgUzmgoIjkX9NGJJNJlTy6X5oLjJsMqpwUwZozJB0A+aNpXpN9sb/pqG1xkeGR6NoPZRPSVtA== X-Google-Smtp-Source: AGHT+IE+ZHsCJLR04Vxkm4sRYdjCbP83AvI6BOE8p68hbHODkJEc0GtHKUJTWLRdJdJABsavua6Y X-Received: by 2002:a17:902:6547:b0:1e0:b60f:5de3 with SMTP id d7-20020a170902654700b001e0b60f5de3mr911871pln.7.1714594545746; Wed, 01 May 2024 13:15:45 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714594545; cv=pass; d=google.com; s=arc-20160816; b=QcXLm+hjgylWvCL2akguNKQ2xYB1uuHWkQBxx/+ibJGKTO903phM6yCjNOs9WZBJ4b GumeE+luWdjLsv6fuan6uz7FggldQa0tMfxOxMth+5mvTctSiexJ9V4Yf0Kgb+kK65Ek VSZrpSOX9PRkVrwU6VpX05+HGyGUMBWMJDWIH9xO/CqbWuBQ3m9U9xMKV5VlR7rwUjjg DtMWoyhLBDe24ChAOwjh+bjylWrjtTE8aE3fjGkJMXD0aMtxlF1aFxda5JaSSRuG/Q14 mauUFYUy7PVnwpM4pwoyEG7aAMGMF76kO64bR/rUc6HNTm6P1FOetK1GbiXVOnDIxG/N VHlg== 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=+i1KmeojcJt62XLl7CnlLSmsjOhDVR/E3EtOZ1fd9k8=; fh=yKEk1U+A8CnI9Fsj4BxU0h1adzFMTs/B4vWF0xQQ2wQ=; b=tbWzc7up+PDcF8xZlkiwssMTtg9z8aHLnn0aWstAmhwzFYDg50Lp6L+pGDCncgQHAb W42QD9dDFeTK7F7xItIDmOBqxaGADKc0Krt4ukjMctIfv1mGFFUpHDvrqO+veu9Eg1hD Vp9vN6fnpXrh4LuhFMLyFRS+0dQJCbjUO95HY2z/Deuhnlu2Z/oQ93RuiZOvpoWeiEJz aW9Nys0wlv0J85vK1dxAd0JBRW3Uki9U5u1Qxts8GsUzO/BEH2dVh3mWEIdL+ozBjkqP pMf2pjo/AUlJhtj8OPMlSupO61nBvL0AZB8CYYlhMp2bBWEhtB9O9m2Vgz8QhFdxtqmm cq1A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="aP/dGSQJ"; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-165741-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-165741-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id h13-20020a170902f54d00b001eb56c98001si9262741plf.31.2024.05.01.13.15.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 May 2024 13:15:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-165741-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="aP/dGSQJ"; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-165741-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-165741-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 82711B228A9 for ; Wed, 1 May 2024 20:15:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0E03D1635A6; Wed, 1 May 2024 20:15:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="aP/dGSQJ" Received: from mail-ua1-f45.google.com (mail-ua1-f45.google.com [209.85.222.45]) (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 CA7CC42A96 for ; Wed, 1 May 2024 20:15:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714594533; cv=none; b=B56GfYo8NpIfh2W5KIItFqzdlZ4la9IRQfK+UcIvVvoFvcOB2exh6sm+A4dFNHUfex5VfRSxVk10iaZqRzb4iTaFj4NKEcHlCriNPYq149E/OA+MxTVEVPOdGa7v2F16H+WeZSid/NHIM5zt9XC839UMJmM3wqIDme6oK9I2N2M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714594533; c=relaxed/simple; bh=wiC/qwp1tn2QtLPL49mOBk5DgvjRW0eTkk2FnvD2dvI=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=gTXt211GmbHkCbM8See0px+blpciyKIku9biJipy12Y+8V2xEn/vIYMQBK3seOpNkkb+4OtM32RBKxD3DYFUJG30izUbVN3Zd/lJ7yFsDzX/B89AYFamy3Ut/F9JO5JmjnQD9+Q1aOh3sbXEH2u7BCFgshtWm89LB8at+trQnKg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=aP/dGSQJ; arc=none smtp.client-ip=209.85.222.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-ua1-f45.google.com with SMTP id a1e0cc1a2514c-7f395ac5b16so482308241.0 for ; Wed, 01 May 2024 13:15:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1714594531; x=1715199331; 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=+i1KmeojcJt62XLl7CnlLSmsjOhDVR/E3EtOZ1fd9k8=; b=aP/dGSQJ4L/wfBCOPwmR7uwjmqJ0pYAvN8cwCfriOLcmB05o3R9JNtx6/rq2LLUsq9 C14y9X2yvLqLOSuTt5pkjy7j5I1VDNlrAj1q8T+LLmDWGl99mqUfW5+zvfKqSK68x0n6 h58nuXZNflEgYq1IAehgXLntTeLTIUt5sM9nRDLweu1HL6KgLO9enVWKp36XogS4Prlb zuuxoOnebsIlWXzNFhlNi2Grxyxc5yCiCQLWSPrnhoE1IpoZKcU8BFl5E2DVV0JoJUQE IQLLfxklnDaFKWWbrsFU3q6moX6GzzHPnX3iWHjqGK9pVtL/rKF6nzSwrjA+HpZp0vVY ff8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714594531; x=1715199331; 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=+i1KmeojcJt62XLl7CnlLSmsjOhDVR/E3EtOZ1fd9k8=; b=LmVI/yJcOcWMnVD56Su833igz1KYegJNEoKB2ZUhfXZSWD4SUcU9TpkvIsHOK5sh4I 2CYyOxP8WBSNORzA5mqgvEzyPyXDTLMwDkoYAIjJUBqezaWKa5hdb1feTRB7KuDtsvkh dqiXwX8scxkZ9qoFkB21mvxWPwSrvG8ed5/rce6azmcZkir//L/FcaLHw+ASWZjk0a+a mX+fda2nhhal656rtXgUMTs3BKH0+PSXtTTiJbD8x6G0/KuIA3EbvNIPro/PGtFmHt+r KFHwf+RL+LaxwEnFpjw2n6mGh0tP6TsF9oasujzuRWyHpp8l1hN9WYzYgBZWAM11A2pG Mglg== X-Forwarded-Encrypted: i=1; AJvYcCXJKp6sGWf0Dp5/E2f627ik7ZdsWDY+PH7JbD6owyfK2qUVl1EALjrnq4MiH/YjX/OowgQwYq74ckwtBeARM9497Mq+ddOSOe0JLXvo X-Gm-Message-State: AOJu0YwYKhGMQgeHyDU5pBLQcD5qE4tUpWT1SBlNsjvpnpsFdIsxqnm0 XWcFF1/U1v+ZsWyfMUuG49pYxqJ/DY9iLlkMtBnwElVwGaFB7Df1QNNTpxTjFeCfh8gkHJy+Dto nANzpVVOyFrhyKAtqPTMngTNc2sUDa7wkNKNA X-Received: by 2002:a05:6122:d9d:b0:4da:a788:cad5 with SMTP id bc29-20020a0561220d9d00b004daa788cad5mr1334566vkb.5.1714594530088; Wed, 01 May 2024 13:15:30 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <8edbd558-a05f-c775-4d0c-09367e688682@I-love.SAKURA.ne.jp> <2023053048-saved-undated-9adf@gregkh> <18a58415-4aa9-4cba-97d2-b70384407313@I-love.SAKURA.ne.jp> <892324fc-9b75-4e8a-b3b6-cf3c5b4c3506@paulmck-laptop> In-Reply-To: <892324fc-9b75-4e8a-b3b6-cf3c5b4c3506@paulmck-laptop> From: Marco Elver Date: Wed, 1 May 2024 22:14:51 +0200 Message-ID: Subject: Re: [PATCH v3] tty: tty_io: remove hung_up_tty_fops To: paulmck@kernel.org Cc: Linus Torvalds , 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 Wed, 1 May 2024 at 21:02, Paul E. McKenney wrote: > > On Wed, May 01, 2024 at 11:56:26AM -0700, Linus Torvalds wrote: > > On Wed, 1 May 2024 at 11:46, Paul E. McKenney wrote: > > > > > > In short, I for one do greatly value KCSAN's help. Along with that of > > > a great many other tools, none of which are perfect, but all of which > > > are helpful. > > > > It's not that I don't value what KCSAN does, but I really think this > > is a KCSAN issue. > > > > I absolutely *detest* these crazy "randomly add data race annotations". > > > > Could we instead annotate particular structure fields? I don't want to > > mark things actually "volatile", because that then causes the compiler > > to generate absolutely horrendous code. But some KCSAN equivalent of > > "this field has data races, and we don't care" kind of annotation > > would be lovely.. > > That would give the poor sleep-deprived innocent bystander some way > to figure out which fields were shared, so that does sound like a good > improvement! > > I would naively expect that KCSAN's ability to handle volatile fields > would make this doable, but there is much that I do not know about > KCSAN internals. So I must defer to Marco on this one. This is relatively trivial: #ifdef __SANITIZE_THREAD__ #define __data_racy volatile #endif KCSAN will just ignore racy access to them (it will pretend they are "marked"). In some cases it might cause the compiler to complain if converting a volatile pointer to a non-volatile pointer, but I suspect that the corresponding pointer should then similarly be marked as __data_racy. The fact that without casting the attribute is "viral" is probably WAI even in this case. Do we want this kind of attribute? Thanks, -- Marco