Received: by 2002:ab2:7a55:0:b0:1f4:4a7d:290d with SMTP id u21csp321121lqp; Thu, 4 Apr 2024 14:25:12 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVGqHhm/XHIEWURHAvSiMMOZzU+Z8gfgY21Yjp4AfevfaVMPHj+ErLpyoBEUqcub44UcXAvmh4KwKPpp298is4b4ppq/Fpc33wbSIwc+w== X-Google-Smtp-Source: AGHT+IHL0f3ndZaKMgQPF03ZxYkWIVEimG/WJvlQRlGh+PwdROxf1W80vgTIHz4QbJg6njBxyKex X-Received: by 2002:a17:902:e546:b0:1e0:f550:82e2 with SMTP id n6-20020a170902e54600b001e0f55082e2mr948766plf.22.1712265912588; Thu, 04 Apr 2024 14:25:12 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712265912; cv=pass; d=google.com; s=arc-20160816; b=H98vVA2jMGc2ag+uLqQSR/jrmYq+FOC5j8m8CN6R3UeuIHk0Msj7gVCBIEAntKcdBK Ni9/iOzHhxGuLSrHvLuh+KeSOw+UifafBQ51XheP81ghxrqr9mrpxTsDZLR/EWc0ohl9 TSNqK85LsHJAVfUPFmxUi7PKjYbVM2nu+0QmIb6lHUgj7ZQXnepvIdA6EDmXrpqecqJ/ cS0y7bsCgANYSttrLMNvEFMjiFhf1qjTZ4hmZIeOWim3fdf4vIBK4puLL5N4TeaF6kv0 5zxiHPl9sv20BP8wf/3SGG3qSW8NfKCHCfgajj0+wVkdMDOzd/onPdS+noCEtgZoIMGo P3nw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=YrWzZcBnGNcpDY93UBj15XD5LuC1hWnAC72CuOynYes=; fh=ZmsqmnlklAIsm8qXYlF7rAAcSM8gYx885JYd/ZVKWQU=; b=n1kEITWsO/zQ8VrzPYpI4xRGMFDNgQV5CeBGgY+OSK6ZaDG1qsqbaBQdtoT3QA6Cg7 iRVPPt1h5pRMzCEkVIns3wPOjunSbBCBoV9pD4xAD7YBV9Ptyna2IA+nS8k4g+XEUQBQ nYIVN5uOKDfVGtcy61kozpaspg27SVSPQMRosYHw77R96JOxml7o+H5+z/jQLT6NUgLc 7WoSE47/FPZhaNA6RNqT39Rn9IRlPxpdldt5/PlIn3+5Vfadxs4Hd/9I1R7nUtk5eccq ST0jv+1tjWhBC6aw4rp3NyKsQRp6k62NsX5LggxyLQfjv0U9LC25wzuwNL9XgJdGVJi0 8jdQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b="vvT/rQWz"; arc=pass (i=1 dkim=pass dkdomain=linux-foundation.org); spf=pass (google.com: domain of linux-kernel+bounces-132137-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-132137-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id a13-20020a170902eccd00b001e2b394986dsi121428plh.442.2024.04.04.14.25.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Apr 2024 14:25:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-132137-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b="vvT/rQWz"; arc=pass (i=1 dkim=pass dkdomain=linux-foundation.org); spf=pass (google.com: domain of linux-kernel+bounces-132137-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-132137-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id E0739287E15 for ; Thu, 4 Apr 2024 21:24:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E45F813C8E6; Thu, 4 Apr 2024 21:23:28 +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="vvT/rQWz" 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 C9A2C13C81D; Thu, 4 Apr 2024 21:23:27 +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=1712265808; cv=none; b=k2mh6mNGLhBCnPSQj/djQ8nYFqM7opUz7TrYZjSVDtdlE0fglwe20lNCoK+UJGRsSqHKcy1pWL+zhAnlzq/NAzOptv8zLrcFV2+d5Jjb48t9PheX68UDNBJq9MDKt9hzVXJTahBToBSOp8i9OdVg8DNCcwsccQDnKdSiBFPXrAo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712265808; c=relaxed/simple; bh=mQV9wndFWdgcIzjox0OAtNgI94pyNZXkSBlBsQvwPbI=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=F0F3T0aSKffBN8i7GP9gDCT28/agMCFhBmNDogJ0SMoRdIpFosbMhbG0jewFRGO68odF3V4fgWQ6GqyeDQL6ZjyB4JxK3kpPxrxkuit1d82/y67BMsH1gy+wr6X0c5AnwM+2EahHGYtEI6Zeh8n2RGPlwLtlYK7P1MzcnlHEMHI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=vvT/rQWz; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 51408C433C7; Thu, 4 Apr 2024 21:23:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1712265807; bh=mQV9wndFWdgcIzjox0OAtNgI94pyNZXkSBlBsQvwPbI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=vvT/rQWzgJDr0V2xCe5oJnEkWOZJd3d2v4R5+z3ox1UnBdFPL8z47NK2/qafJ9FW5 W88A6MQWdUKe4MXiyYhJ8B/oPx/N3+C3OtecFrwPa7evbKBxKv5QIfACKONpkZS9OK vNwbAw2PxEb+WZhrtb8Cx63D1g5eNLyOrfxtNH8s= Date: Thu, 4 Apr 2024 14:23:26 -0700 From: Andrew Morton To: Vishal Verma Cc: Dan Williams , Dave Jiang , Alison Schofield , linux-mm@kvack.org, nvdimm@lists.linux.dev, linux-cxl@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] dax/bus.c: replace WARN_ON_ONCE() with lockdep asserts Message-Id: <20240404142326.b3d5b0f3f7b9f25f1a16288a@linux-foundation.org> In-Reply-To: <20240402-vv-dax_abi_fixes-v1-1-c3e0fdbafba5@intel.com> References: <20240402-vv-dax_abi_fixes-v1-1-c3e0fdbafba5@intel.com> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) 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-Transfer-Encoding: 7bit On Tue, 02 Apr 2024 00:24:28 -0600 Vishal Verma wrote: > In [1], Dan points out that all of the WARN_ON_ONCE() usage in the > referenced patch should be replaced with lockdep_assert_held(_write)(). > > Replace those, and additionally, replace a couple of other > WARN_ON_ONCE() introduced in the same patch for actual failure > cases (i.e. when acquiring a semaphore fails in a remove / unregister > path) with dev_WARN_ONCE() as is the precedent here. > > Recall that previously, unregistration paths was implicitly protected by > overloading the device lock, which the patch in [1] sought to remove. > This meant adding a semaphore acquisition in these unregistration paths. > Since that can fail, and it doesn't make sense to return errors from > these paths, retain the two instances of (now) dev_WARN_ONCE(). > > ... > > @@ -471,6 +471,7 @@ static void __unregister_dev_dax(void *dev) > > dev_dbg(dev, "%s\n", __func__); > > + lockdep_assert_held_write(&dax_region_rwsem); > kill_dev_dax(dev_dax); > device_del(dev); > free_dev_dax_ranges(dev_dax); This is new and unchangelogged? I'm taking Dan's reply to your patch as Not-A-Nack ;)