From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (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 AD61A235C01 for ; Mon, 13 Jul 2026 05:17:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.156.1 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783919867; cv=none; b=QgY5IFKmXjp7jxojcBRIFkSj6J4WAqzUKFKhhhNrHvA3cyqiJkSPsnjGkUEn4sX/70mKK2eXOMspf6MICOjDxXv041lqhNM1k8yeqhN+tIQx/ebzVvQbHBE6PZzYRvEgpRLwrKLSlzpPbUwfJ8wXrT/MN/BTmz78XqAeo1kLcZ8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783919867; c=relaxed/simple; bh=ihmMZ8bhhN24Q87Kl3bte4ZXC3fU/W4M+tNvEmKBFqQ=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=PYc/lPT38jrnTY1wUQYntgdr2hQXvZQ6v3gwy5ojpRJe+SQfoJ4Txzli/vrLmhehM1D7niGp8dY/rn5+U6ltDGD6MjxClvt+j/xz5/DfSJjWAdy10po8oXO46oO9z6ZMmNo1uH8O8nbKCw77HpTfaVJS1Xc8VYteAah/MMy8Kck= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com; spf=pass smtp.mailfrom=linux.ibm.com; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b=OAJYpRpv; arc=none smtp.client-ip=148.163.156.1 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="OAJYpRpv" Received: from pps.filterd (m0356517.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 66D3Crsp1314437; Mon, 13 Jul 2026 05:17:22 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pp1; bh=TW8VNn hfPRV14pn1GehuTQWqIZX3zXVF1sDBC/XYgTE=; b=OAJYpRpv0v/UN/xQ923j7r glY+7/pRkuto0vF4uS5A4987DvbV4aM2DqwEWysH/tXjD76jLCxLIdUhXF9FLmfn xXahxLgC/r1CNnVojWwj0wA93lPdUM9YxxP2O3GcIPozpw6Zov4uvRAWGZpXGHFF +driBIXs0n2TCmJ4EW+sAoNiUEKfkvSQTW3gANCSMItHWUbFIih3TACvDTnnnQmH 8wHOvXarQKrM94Vd8kv7v7C4m9HnioHD8MO6bm4aNkpVUwYRwoY/OqVQh5eIQN7L HJBpYKJ+WbVhGVbYhc5Pysgmr6uuOVtHCxZM1D9pJemOudDV5VTBGRyXeNCAcxog == Received: from ppma11.dal12v.mail.ibm.com (db.9e.1632.ip4.static.sl-reverse.com [50.22.158.219]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4fbegsxtpc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 13 Jul 2026 05:17:22 +0000 (GMT) Received: from pps.filterd (ppma11.dal12v.mail.ibm.com [127.0.0.1]) by ppma11.dal12v.mail.ibm.com (8.18.1.7/8.18.1.7) with ESMTP id 66D54bl3012286; Mon, 13 Jul 2026 05:17:21 GMT Received: from smtprelay04.dal12v.mail.ibm.com ([172.16.1.6]) by ppma11.dal12v.mail.ibm.com (PPS) with ESMTPS id 4fc2uxuv52-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 13 Jul 2026 05:17:21 +0000 (GMT) Received: from smtpav02.wdc07v.mail.ibm.com (smtpav02.wdc07v.mail.ibm.com [10.39.53.229]) by smtprelay04.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 66D5HKUB54198566 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 13 Jul 2026 05:17:20 GMT Received: from smtpav02.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A40325805C; Mon, 13 Jul 2026 05:17:20 +0000 (GMT) Received: from smtpav02.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9805F5805B; Mon, 13 Jul 2026 05:17:17 +0000 (GMT) Received: from [9.123.7.57] (unknown [9.123.7.57]) by smtpav02.wdc07v.mail.ibm.com (Postfix) with ESMTP; Mon, 13 Jul 2026 05:17:17 +0000 (GMT) Message-ID: <78b030be-878f-4c71-8288-66fc19d71512@linux.ibm.com> Date: Mon, 13 Jul 2026 10:47:16 +0530 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 v3 14/18] list: Permit context-unguarded access with list_empty_careful() To: Marco Elver Cc: Christoph Hellwig , linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, kbusch@kernel.org, sagi@grimberg.me, axboe@fb.com, bvanassche@acm.org, gjoyce@linux.ibm.com References: <20260706141452.3008233-1-nilay@linux.ibm.com> <20260706141452.3008233-15-nilay@linux.ibm.com> <20260709063020.GC18056@lst.de> <1e72d8d2-ecfb-42c8-9ba4-97cf70f8b70b@linux.ibm.com> Content-Language: en-US From: Nilay Shroff In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-Reinject: loops=2 maxloops=12 X-Proofpoint-ORIG-GUID: fWMQPe69dFKHGfyOii4sfC7g1HqrZs1X X-Proofpoint-Spam-Info: AW1haW4tMjYwNzEzMDA1MSBTYWx0ZWRfXwV14/oWAwNe0 v4v7q1xUDC66vASLFfQPOK+XfvonsVUqtZB0t9ahu7P3EkiOkGkW+gSVVtvtHxh4mORqiozQ3Za +cB5rtY1QtQqPw/ILbIZRaoEaorEN+0= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzEzMDA1MSBTYWx0ZWRfXwYrD6PahvUO9 5E/HaRPsJdZP441ebT0oJB4ur3XpSq4klR2g+WsI2BPqnwXnY8wy8MtwIamr/D97MDha232am2a sXbklUPObSfuFuyzK3MoNNAmERa9ZGiPpjfJa983xSuiNUyKlXI8DZk7k9J/VNAMqgw+dMLhzhO eiuAXuInqJKee4rSc+wwPlo7+De363KKpWVoLwiyBxGXALq6T+AUjHZdTpomjpxPQ89K/8qdOlM Ud8zD7thFGZAUfh0Ncob+BkdWLGZDgYA3PtTd19lOCVNoCL6QYM6x7tSjTqzXKIWE4iAgoQ2Ebw Fp28P8Fsna/+oE2REMCSJd9F48EkHJd7EsUuoaGkP1tbsmRModdxVC0fT+6B93BhqVltPw6GkGf 4yLIrIfJ1wN/6Ut+KAMimScEaSPYBAlHHLIwAE1+D7wRC7vD7NLW21ES8XFVoFXfwQTzkVcQ0Wx CD+/lhabQp2ZYLQwCYA== X-Authority-Analysis: v=2.4 cv=IqMutr/g c=1 sm=1 tr=0 ts=6a5474e2 cx=c_pps a=aDMHemPKRhS1OARIsFnwRA==:117 a=aDMHemPKRhS1OARIsFnwRA==:17 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=U7nrCbtTmkRpXpFmAIza:22 a=VnNF1IyMAAAA:8 a=1XWaLZrsAAAA:8 a=MeiAZp4Fa1qTV6vacYcA:9 a=QEXdDO2ut3YA:10 X-Proofpoint-GUID: pQV957vY4xfbnxmUQT-cULwKMEcVN361 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-07-13_01,2026-07-10_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 clxscore=1015 impostorscore=0 malwarescore=0 adultscore=0 phishscore=0 suspectscore=0 priorityscore=1501 bulkscore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607130051 On 7/12/26 3:29 AM, Marco Elver wrote: > On Fri, 10 Jul 2026 at 10:10, Nilay Shroff wrote: >> >> Hi Marco, >> >> On 7/9/26 12:00 PM, Christoph Hellwig wrote: >>> On Mon, Jul 06, 2026 at 07:44:16PM +0530, Nilay Shroff wrote: >>>> From: Marco Elver >>>> >>>> With Context Analysis (viz. Clang's Thread Safety Analysis), list_heads >>>> that are __guarded_by(..) require holding the appropriate context lock >>>> when accessing and manipulating them via the list API. Because Clang's >>>> warning diagnostics do not perform inter-procedural analysis, this is >>>> enforced by Clang with -Wthread-safety-pointer in the caller at the call >>>> boundary; a warning is produced when passing a pointer to a guarded >>>> variable without holding the appropriate context locks: >>> >>> Same thing here, maybe try to get this to Linus late in the current >>> window as it's trivial and makes dependency management much easier. > > It's not a bug fix, more of a feature, so I don't think this should be > sent in a post-rc1 PR (and Linus would likely reject it). > >>> If that doesn't work, move it to the front of the series. >>> >> Would it be possible for you to send a pull request for Linus directly, or >> would it need to go through another maintainer? > > Needs another maintainer. > >> If you're able to send it directly, we also have patch 09/18 in this >> series that should go to Linus. In that case, I'd suggest including both >> patches in the same pull request. > > list has no de-facto maintainer, so anyone could take it. My guess is > it could go through tip/locking/core since it's related to Context > Analysis... > > ... alas, this is more complex than it needs to be, esp. given it's > borderline to get this merged post-rc1. > >> Otherwise, as Christoph suggested, I'll move these patches to the >> beginning of the series in the next revision. > > I'd just move it to the beginning on the respin, given what I said above. > Okay so then I'd move it at the beginning while I spin next revision. Thanks, --Nilay