From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f172.google.com (mail-qk1-f172.google.com [209.85.222.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 CF439386550 for ; Thu, 9 Jul 2026 14:57:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783609035; cv=none; b=J1HyEude55sgnBcD5Qhid8d0hYS034bM6DOPZ+/v7Jy/bxDzL/z6JdP8MH5P9DBoJJOBjDDF4j/yiPzdpk1qFOoL0r3OXd9HEpz8TDR7RTPjCSbfEAK/SjOQ7DQUpMBVK0mmi/Vcf7xuTY9JSSymCWZW6L/JyNgQpA7AgDOvsXM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783609035; c=relaxed/simple; bh=tjgdvByW5WBZqyhrd7wFuCriBR6z1oBevpMfu6TVGNs=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=rG5aLTmTDBpUwLLdSRMtKbcFOyJwo5AXOXwYll1lqXSvxgD6JrJfO6Glub0DRW5Vm79HyB3uPFz1eIvJokvw8j/Gl0ErxUHtpxtSuQO599yU1/0ItSteEX22ARDjvyIxsgc61Wd2A1Qw8L1uTw25Y82E30Pjhq4dxqPP0Z+GsI8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=gourry.net; spf=pass smtp.mailfrom=gourry.net; dkim=pass (2048-bit key) header.d=gourry.net header.i=@gourry.net header.b=TCMqfGI7; arc=none smtp.client-ip=209.85.222.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=gourry.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gourry.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gourry.net header.i=@gourry.net header.b="TCMqfGI7" Received: by mail-qk1-f172.google.com with SMTP id af79cd13be357-92e5b048375so48720585a.1 for ; Thu, 09 Jul 2026 07:57:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gourry.net; s=google; t=1783609033; x=1784213833; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=cUc0YxX2OnLyX2sI3kys65ZvVtk8+5Y5AOwoYWzDFOM=; b=TCMqfGI7JdxQTtJlHSthwI0j8quYtYJeY8RBzzPK2VfrMHMjRiALGQ0Eiuwwj2B7VC RWwy1xBBzHUCe+qvPWlHySd/VMdwpNS8BNo76mQeWipiYA5ILkD3oK6pzEkF3sEeZqjt QkqssvgxLUbqdGJvMT9oDSZ8G59SLH6XimKp+HJE0x4SPHQvK+xZDI01ClfeapABqG0m 0Q8reXbl1XMca7Sxu4fDNtetFRtZGZW9I+6sll8tPglYtEklTIwrXkU8MHPl4NJejqx/ MLV1fIWuYt8JQJlGPzlpxHF6yIYSrGsatFAiu9srMIJ8Pbg/IBt25xOCMDI2rQjW3dW2 RVMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783609033; x=1784213833; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=cUc0YxX2OnLyX2sI3kys65ZvVtk8+5Y5AOwoYWzDFOM=; b=lhKnJOw1yobGBh/famOXUoN5QglsoidW3Dlxl+fp4CPley2ckOWX9zkasFIJzou0CQ ggHAUtY+TPjhb19nKOTJYGF+Y6MVaTcszHreuyQa9pONdSRm3g4SQ76EPyTpwfWp6zfQ mumhMnIFt1NZ4uxA6qg50vVj6J+O3Qz0N5Fk2U1cZDo0xGqpmXuKHG+0qgdEQ8NOtJzD PfixO3zrO/NdfpZWaZxqF7nBYnRYSK8pwIvuoUpFuyjLLG7d+rQie+P4f6XFI6NP1G6A Yj9NwbjXFZbzTSsQwmto6XjOe2CRsCWd1WinIQay27ltKXe0I6KjWQSBai7Lerk9xy5/ Xiqw== X-Forwarded-Encrypted: i=1; AHgh+RoE5ko3nRDjTOwqiZ6iifDiwbQA/94ZW88zbHolIavHomQ7XkyI71a6g/4zgr4XrAkr+QasgzmLzj7CuYs=@vger.kernel.org X-Gm-Message-State: AOJu0YyvuefSyh4GaR+VhIDmFYJaYu5vWA65KAASHj4wCcYINZXyM/TE nd8YxdN2HnDzf+VQfSyCyqKoYszNVkRbe+zlElLWbPeo8FMmHt0n0pv7cbFVbdV255w= X-Gm-Gg: AfdE7cmslTJmQVF3Up0f+C/zz53Slu2T6e2hEg69ovKEb90XoQbtUuxpc1VF6DRGgZh EjY6P+DnDtJRoCSipmtp4X8nrKma+w7/CjEhfaKFq9pkGJFtpNGghStDr1m805IJwDrHAFWeN19 YHqPG2ampODZwzQ/R6B5NLKgEgBCK9TKDWR/JRziYhv4igoFJU+HblubfzdWrzw/SlxWL1Y/pz3 THzzG1wBdSFEzt3t7BWO6R59CIMYJUQeUAB1iupOqD0twUs4Gc8HmHZl/rMIHpa1xeY0R89uFNO 07K52B4Mv41xMsJT9KBdUHIMMF8dRa4zsRlkasbYs/fm7fcAduySmDKBG2Lii9sSI01iPJjaCkW IqxSuee4+jPQFI+DsHhsHOGEPJfDcMjhsvsb+Z3/SWE2YtTV2WDJbN/Pf3xLXDc2+n8UUNoi/ns L1MFZ2y3frMWOmTdhQ3Yxw5uYOzWBYp+z9wMLy7ka/wwWi4v49Po2P4oFCPZ7Px7VMbRPV X-Received: by 2002:a05:620a:460f:b0:92d:e54e:72db with SMTP id af79cd13be357-92ecf54a01bmr728326285a.22.1783609032712; Thu, 09 Jul 2026 07:57:12 -0700 (PDT) Received: from gourry-fedora-PF4VCD3F (pool-173-79-60-52.washdc.fios.verizon.net. [173.79.60.52]) by smtp.gmail.com with ESMTPSA id af79cd13be357-92e90cedfe0sm1725553985a.43.2026.07.09.07.57.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jul 2026 07:57:12 -0700 (PDT) Date: Thu, 9 Jul 2026 10:57:07 -0400 From: Gregory Price To: Richard Cheng Cc: linux-mm@kvack.org, nvdimm@lists.linux.dev, linux-kernel@vger.kernel.org, linux-cxl@vger.kernel.org, driver-core@lists.linux.dev, linux-kselftest@vger.kernel.org, kernel-team@meta.com, david@kernel.org, osalvador@suse.de, gregkh@linuxfoundation.org, rafael@kernel.org, dakr@kernel.org, djbw@kernel.org, vishal.l.verma@intel.com, dave.jiang@intel.com, alison.schofield@intel.com, akpm@linux-foundation.org, ljs@kernel.org, liam@infradead.org, vbabka@kernel.org, rppt@kernel.org, surenb@google.com, mhocko@suse.com, shuah@kernel.org, iweiny@kernel.org, Smita.KoralahalliChannabasappa@amd.com, apopple@nvidia.com, Hannes Reinecke Subject: Re: [PATCH v6 09/10] dax/kmem: add sysfs interface for atomic whole-device hotplug Message-ID: References: <20260630211842.2252800-1-gourry@gourry.net> <20260630211842.2252800-10-gourry@gourry.net> 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 Thu, Jul 09, 2026 at 04:07:31PM +0800, Richard Cheng wrote: > > + if (dax_kmem_state_is_online(data->state)) { > > + dev_warn(dev, "Hotplug regions stuck online until reboot\n"); > > + any_hotremove_failed = true; > > + return; > > Hi Gregory, > > I suppose data->state is only updated when writing to the new daxX.Y/state file? > If the blocks are offlined through the old per-block interface, data->state > still says online and we will hit this early return. > Everything is leaked and a later rebind fails -EBUSY. > > Current behavior is using remove_memory(), and it succeeds on offlined blocks > and fails safely with -EBUSY on online ones, no offlining from unbind context > either way. > > Your changelog state "on unbind fallback to legacy if still online", but the > fallback only runs for data->state == MMOP_OFFLINE. > Maybe drop this early return and just try dax_kmem_remove_ranges() here too? > Hm, I think you are right. When doing some testing I bounced between tests which race with dax/state and block/state, and I missed the obvious case of the whole device being offline but dax/state being stale. I think this entire chunk actually just drops to: dax_kmem_remove_ranges(dev_dax, data); And the internal error catches the condition to the log. Thanks! I will spin a new version next week. ~Gregory