From mboxrd@z Thu Jan 1 00:00:00 1970 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 B3466481AB9 for ; Mon, 18 May 2026 16:31:25 +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=1779121885; cv=none; b=VlTSUWaqPXpRakO2o0ZLqkiIGdzmrUpEyPtAKcLlKljJqZV0fFo45/eKaTEIll2caI4w7BAMWuTsaQaEMjz1Y5BsKzG5gCFv3ExFjk/qxqWLCz2105zDp6R3pmN+WXl7mbgxUJHr+qe0NsXSI9MZjhWxPPlThUfwSbBNxR9nlgk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779121885; c=relaxed/simple; bh=pJ8LBebLK73jQzMKkLyf4advK34I4By53h0iAorap3A=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=Mv8C5SIfYRopU1/pksJTowkHVuGWK8MUknj/udqIqTuHZyUAbDkBlwEU1f4q3fk1CbgkXToFL0IfCC/lZIJ57LCDJsN93DxWJlGrVK1DK8OtFi1hJ2EcEvaW68WzGcAtH+kKacVBQkvlV0M+blQxRCIZIKMwzAe3XVSA0sZ6eAU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=nQ5ZEOpH; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="nQ5ZEOpH" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B13C8C2BCC6; Mon, 18 May 2026 16:31:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1779121885; bh=pJ8LBebLK73jQzMKkLyf4advK34I4By53h0iAorap3A=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=nQ5ZEOpHmIdxwUF3whCwUQGwdWtAzj7kpBubJ/5tUgrVZHyUchg5jaibhxtgk8N0c J/qombQpJSf7C0xq6W7etvIikMU4mCv7EYQ5SkKwNbNn7roCx4zjtyBIRBZ/Apigzl vhIwadfZl6BhTB/w+D3DpdtMwnIOrs3dcX33QKuCd11VZ2p/kA3OElKiV4tb/a/Bog sFQ4yKkbtd6LxQxZpR/jHFCv8wLX8h6HMm86w5mzger4OLyxcotBq+m3glIpzGXAWp b1VsJzkooBZbw84UVAp7yTCImXDbaetVz7YY12ubsZNNXmMLpXygqY8YbGbanAoZJS uvj2+Hax1LIkg== From: Pratyush Yadav To: Pasha Tatashin Cc: rppt@kernel.org, sourabhjain@linux.ibm.com, jbouron@amazon.com, akpm@linux-foundation.org, bhe@redhat.com, linux-kernel@vger.kernel.org, dan.carpenter@linaro.org, rafael.j.wysocki@intel.com, piliu@redhat.com, kexec@lists.infradead.org, pratyush@kernel.org, skhawaja@google.com, graf@amazon.com, mario.limonciello@amd.com Subject: Re: [PATCH v5 3/5] liveupdate: block session mutations during reboot In-Reply-To: <20260518125459.1092373-4-pasha.tatashin@soleen.com> (Pasha Tatashin's message of "Mon, 18 May 2026 12:54:57 +0000") References: <20260518125459.1092373-1-pasha.tatashin@soleen.com> <20260518125459.1092373-4-pasha.tatashin@soleen.com> Date: Mon, 18 May 2026 18:31:20 +0200 Message-ID: <2vxzo6ic8ysn.fsf@kernel.org> User-Agent: Gnus/5.13 (Gnus v5.13) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain On Mon, May 18 2026, Pasha Tatashin wrote: > During the reboot() syscall, user processes may still be running > concurrently and attempting to mutate sessions (e.g., creating, > retrieving, or releasing sessions). To prevent this, introduce > luo_session_serialize_rwsem to synchronize mutations with the > serialization process. > > All session mutation operations (create, retrieve, release, ioctl) take > the read lock. The serialization process (luo_session_serialize) takes > the write lock and holds it indefinitely on success. This effectively > freezes the LUO session subsystem during the transition to the new > kernel. If serialization fails, the lock is released to allow recovery. Good idea I think. But, do we need a new mutex? Can't we use luo_session_header->rwsem? Session creation and release take the header rwsem at one point anyway, so perhaps we can just reuse that? Also, do we need to block incoming sessions? They won't participate in serialization, so perhaps we can leave those alone, and all the outgoing sessions get protected by the outgoing session header rwsem? > > Fixes: 0153094d03df ("liveupdate: luo_session: add sessions support") > Reported-by: Oskar Gerlicz Kowalczuk > Acked-by: Mike Rapoport (Microsoft) > Signed-off-by: Pasha Tatashin -- Regards, Pratyush Yadav