From nobody Mon Apr 6 19:59:51 2026 Received: from mail-yx1-f48.google.com (mail-yx1-f48.google.com [74.125.224.48]) (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 A7AFC3DC4B2 for ; Wed, 18 Mar 2026 14:17:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.224.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773843428; cv=none; b=mrrj6Dgnva7OdZhu9kfQoKkDR0ZTEahfrYvBVloqkNBI4bgvr/SdQlnwXzGZOBmRG2dHR0ADcJALZFott8FInAr4nWqbyhXAQCDXLR0p+/QLd0emfOIx5M3QAAIa0mxkQ5DgeGEQR89hW0avyTAB/hhhBbUB2tb6GVeWQD8VNeE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773843428; c=relaxed/simple; bh=k1U60ogGlFKqcQ2VNpd3YPvxEKZ2keFaPByWtDwKlOE=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pCP+fwayTRVKXgOfnlleQyN2F8G6PsufuGysU2vHwVGBtfbrwGRy3r3bsBtispksLY/xDnC3jKKBipgG8dc0WTydhV9EetmFlHZSp9rh1unE9ljZtshGAzMreStIQJHvb4A1LK4J/RPkBBDwc5iTI70nZ5G7JufXvMDwih/u67A= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=soleen.com; spf=pass smtp.mailfrom=soleen.com; dkim=pass (2048-bit key) header.d=soleen.com header.i=@soleen.com header.b=h+JsH2uR; arc=none smtp.client-ip=74.125.224.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=soleen.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=soleen.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=soleen.com header.i=@soleen.com header.b="h+JsH2uR" Received: by mail-yx1-f48.google.com with SMTP id 956f58d0204a3-64ca2b32f46so5451396d50.3 for ; Wed, 18 Mar 2026 07:17:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; t=1773843422; x=1774448222; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=9grmrBps2hK+s63PftzZmwOuMlZ/QyGcOsJY971KUOk=; b=h+JsH2uRZ7BU6hNPDXUPcO3Jeqy8v4ABlHsP9cEAma7Krb/WtS5ehvxYF2zkkbnK1c fphxqnjQW4FDq/K7jpBQo3TQ3VS234e7vKCPY+dTu6kItogcGNx7TYacCdvc1rwiysZz +ZontvE1WVZl6/fC4EFjRx4Ah/2sJDIIPC0PlRqcusQRAdWxMULj/chcavBlWYINL7Oz HVwUv32ciCgXwbSiEcSe+aXC00ovYSogKo/NkC1r2N0ajMGTGXHSBujTrjjXMB34A3iD u3claQDioQ5ITPSY7BTJsxRCqbzlK0aEGKbo3mSPl4+TW6zw1DT06crDLevLdyuThAS5 BI9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773843422; x=1774448222; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=9grmrBps2hK+s63PftzZmwOuMlZ/QyGcOsJY971KUOk=; b=YbeCDZjXg8xs/sEQPHPMtNpSo8exhUwsd5gPi2I2jClThGbJMghOljwBMjOPmyEONn QnAtTt5tEyHH6J16aNGZSzJRwOpr3Jy3GIRP2QciWgbgp+9EnYZToEx/rshj8M3ucyZb RNFTqftjf3weXGmg2At0QOfm/GYCQNJphz7qpWDwXgohOy8Nwn+UpdBXtAKSAexQRNcG jn+5IPqoI0vDA0Gj+QFCw5VMvbNls0158TEpWnL/6ZwIbq9siQ9+UJqnXPz6HvMEmUuM tjk3+g/qAU3gCjYKTtppeR+OHbgQ76w3g/UKS9PK+K9pdBGb8xsvy/VbJOjaPaYuzE7j xZtA== X-Forwarded-Encrypted: i=1; AJvYcCW+263W9FE6PSNI28q/fSsLX7ViyXyjqnL+Hr9nzeRJOhBBqWUcnjie2IjhGZ4o2V0I1y4AsfgQ9tb/4NQ=@vger.kernel.org X-Gm-Message-State: AOJu0YzklgVSci1oI9ba8fv255fbo6FqXx/awPTKU18SqxbAARyLh2kI zHed67SvVve09OWKm7epE0DaIrEhJjdzLl8CQYJfaS1LIsYUXJPo9tBTIk/lNgGa008= X-Gm-Gg: ATEYQzzKlWzgvI0qkfqWS5vwDLOvXtmlfdE7bvlywxfQZA/qow8J38VwHQX9vnEaIZa yeXHXlKaOJy5YtbF0dcHhvaNQvrSavUwMg5N/nfJ38SzEWUiwZKkl15TvC73KCk86it3INfNRDe T2mmEeINg2eiELMbb4sidKs0eIphS4W4cSs/R6Be2Mt+5zjAGzvbGYrZ8yCSGqEry5r8L6d0nb5 4XCc5yHxRDeHoVYSvj6Jt6bJGwM6wFCeuKwJGpENHPoEvtDtI5jS7iuvCSbbU48rDljHdAkrspJ joPDyy659nlWyOA5ZdupRcFnAeDFc1Sn7Rvzidq4BLrG6ATBpc4gmdeudSpfU6l1ex/okklvslq 5fodKHPzDQcYJR/pxjLRT07d5DHN6khB6Wqt7W1qZJkv1BBE0ulahAv893pf2sfZBJ+c41joHkd gzRb36av07JKtJo52bSiYiuPNG293sq54WRc4cjOGwLdNF9yIcxx0SpY9t6SW008sJK7rdSh7rt 6efQ9D3zX+OYfBECVyVmO+FOHGovo2f1JgizrVZNuInS/vl3JnyVSlpmwkQ X-Received: by 2002:a53:b6c4:0:b0:64a:d444:48f5 with SMTP id 956f58d0204a3-64e915f5a33mr2644882d50.65.1773843421452; Wed, 18 Mar 2026 07:17:01 -0700 (PDT) Received: from soleen.c.googlers.com.com (57.233.150.34.bc.googleusercontent.com. [34.150.233.57]) by smtp.gmail.com with ESMTPSA id 956f58d0204a3-64e91be0e91sm1672028d50.15.2026.03.18.07.17.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Mar 2026 07:17:00 -0700 (PDT) From: Pasha Tatashin To: rppt@kernel.org, akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, pasha.tatashin@soleen.com, dmatlack@google.com, pratyush@kernel.org Subject: [PATCH v2 5/8] liveupdate: Remove luo_session_quiesce() Date: Wed, 18 Mar 2026 10:16:43 -0400 Message-ID: <20260318141637.1870220-15-pasha.tatashin@soleen.com> X-Mailer: git-send-email 2.53.0.851.ga537e3e6e9-goog In-Reply-To: <20260318141637.1870220-10-pasha.tatashin@soleen.com> References: <20260318141637.1870220-10-pasha.tatashin@soleen.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=8396; i=pasha.tatashin@soleen.com; h=from:subject; bh=k1U60ogGlFKqcQ2VNpd3YPvxEKZ2keFaPByWtDwKlOE=; b=owEBbQKS/ZANAwAKAbt3KEzbc3reAcsmYgBpurPMnXDInX88G54UAYQw0L/MaWlYrn9GAm0fu o0ri6gq5VyJAjMEAAEKAB0WIQRBMaqT7LRvGvB/NmK7dyhM23N63gUCabqzzAAKCRC7dyhM23N6 3gmbD/99nCQV/oK6edHYLGsZT66H9puZFs6qMQEpgTm6zlLogKeyxMRCqK6A7YRthVSDghj74Rh RICG130O8omn6beue1D1lsRqw/DOru4IBblYemY58l3GXqKeSomGocmVRpqWbFfX29GI1JAgHci hsMce4Y0eDpQ3dna8egsI/n2CIsRyxRqpyQrWq3HMoNfh1568mJJySo2QRH27woXqp4wvuR1lqZ 9UWFUFor+y52QT0kSisHxtiPmFrJniJTvMczuurWKHGpLPoEpmFXPtvAWYmRuJNXuAY1f5bU4vN FR86KxDLO62Gsqb4HpU3ZkFF/6oRL1smCrOHSbLfMhc/FP3UetnR5MB8x4iETa64Su0HihhyRPW +H0Xdz60BnYpqdVsWEUcJH0PY7nKgRO26NtwGflBwSfPbUYvlsrVWUNezFluRFeriIwizGwo0Dz qBC3+i/YYbd3Sk0GZbHVBmjrUOKeiQ6pdMN5K/KThiz2+lqZHT0If2i+2PYP4pozzC5tr1ZeSkX 4/iUzzh6EG4THuQLswajM8XwVH/NIHfXheTVqQ1680u6BaFwF0rm+j1tSAghM+Y/YPQxS1OaDrt zk7MUgdHyThGi3mdCJ1/krI2gycuujBF92BxIMNbEkT7qm6H/sjaakPLUY5CN2BDOBsHP65c2Ly exBOBsfe3n4paXw== X-Developer-Key: i=pasha.tatashin@soleen.com; a=openpgp; fpr=CAAAB722DD22A081F0D49F35633A6A993D43B569 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Now that FLB module references are handled dynamically during active sessions, we can safely remove the luo_session_quiesce() and luo_session_resume() mechanism. Signed-off-by: Pasha Tatashin --- kernel/liveupdate/luo_file.c | 21 ++------------- kernel/liveupdate/luo_flb.c | 46 +++++--------------------------- kernel/liveupdate/luo_internal.h | 2 -- kernel/liveupdate/luo_session.c | 44 ------------------------------ 4 files changed, 9 insertions(+), 104 deletions(-) diff --git a/kernel/liveupdate/luo_file.c b/kernel/liveupdate/luo_file.c index b124fd747841..c0ce08d55747 100644 --- a/kernel/liveupdate/luo_file.c +++ b/kernel/liveupdate/luo_file.c @@ -846,21 +846,12 @@ int liveupdate_register_file_handler(struct liveupdat= e_file_handler *fh) return -EINVAL; } =20 - /* - * Ensure the system is quiescent (no active sessions). - * This prevents registering new handlers while sessions are active or - * while deserialization is in progress. - */ - if (!luo_session_quiesce()) - return -EBUSY; - scoped_guard(rwsem_write, &luo_file_handler_lock) { /* Check for duplicate compatible strings */ list_private_for_each_entry(fh_iter, &luo_file_handler_list, list) { if (!strcmp(fh_iter->compatible, fh->compatible)) { pr_err("File handler registration failed: Compatible string '%s' alrea= dy registered.\n", fh->compatible); - luo_session_resume(); return -EEXIST; } } @@ -870,7 +861,6 @@ int liveupdate_register_file_handler(struct liveupdate_= file_handler *fh) INIT_LIST_HEAD(&ACCESS_PRIVATE(fh, list)); list_add_tail(&ACCESS_PRIVATE(fh, list), &luo_file_handler_list); } - luo_session_resume(); =20 liveupdate_test_register(fh); =20 @@ -885,13 +875,12 @@ int liveupdate_register_file_handler(struct liveupdat= e_file_handler *fh) * reverses the operations of liveupdate_register_file_handler(). * * It ensures safe removal by checking that: - * No live update session is currently in progress. * No FLB registered with this file handler. * * If the unregistration fails, the internal test state is reverted. * * Return: 0 Success. -EOPNOTSUPP when live update is not enabled. -EBUSY = A live - * update is in progress, can't quiesce live update or FLB is registred wi= th + * update is in progress, FLB is registred with * this file handler. */ int liveupdate_unregister_file_handler(struct liveupdate_file_handler *fh) @@ -901,18 +890,12 @@ int liveupdate_unregister_file_handler(struct liveupd= ate_file_handler *fh) =20 liveupdate_test_unregister(fh); =20 - if (!luo_session_quiesce()) - goto err_register; - scoped_guard(rwsem_write, &luo_file_handler_lock) { - if (!list_empty(&ACCESS_PRIVATE(fh, flb_list))) { - luo_session_resume(); + if (!list_empty(&ACCESS_PRIVATE(fh, flb_list))) goto err_register; - } =20 list_del(&ACCESS_PRIVATE(fh, list)); } - luo_session_resume(); =20 return 0; =20 diff --git a/kernel/liveupdate/luo_flb.c b/kernel/liveupdate/luo_flb.c index 98336cd23aa5..8bbe11a7286b 100644 --- a/kernel/liveupdate/luo_flb.c +++ b/kernel/liveupdate/luo_flb.c @@ -346,7 +346,6 @@ int liveupdate_register_flb(struct liveupdate_file_hand= ler *fh, struct luo_flb_link *link __free(kfree) =3D NULL; struct liveupdate_flb *gflb; struct luo_flb_link *iter; - int err; =20 if (!liveupdate_enabled()) return -EOPNOTSUPP; @@ -367,22 +366,13 @@ int liveupdate_register_flb(struct liveupdate_file_ha= ndler *fh, if (!link) return -ENOMEM; =20 - /* - * Ensure the system is quiescent (no active sessions). - * This acts as a global lock for registration: no other thread can - * be in this section, and no sessions can be creating/using FDs. - */ - if (!luo_session_quiesce()) - return -EBUSY; - guard(rwsem_write)(&luo_flb_lock); guard(rwsem_write)(&ACCESS_PRIVATE(fh, flb_lock)); =20 /* Check that this FLB is not already linked to this file handler */ - err =3D -EEXIST; list_for_each_entry(iter, flb_list, list) { if (iter->flb =3D=3D flb) - goto err_resume; + return -EEXIST; } =20 /* @@ -390,20 +380,16 @@ int liveupdate_register_flb(struct liveupdate_file_ha= ndler *fh, * is registered */ if (!private->users) { - if (WARN_ON(!list_empty(&private->list))) { - err =3D -EINVAL; - goto err_resume; - } + if (WARN_ON(!list_empty(&private->list))) + return -EINVAL; =20 - if (luo_flb_global.count =3D=3D LUO_FLB_MAX) { - err =3D -ENOSPC; - goto err_resume; - } + if (luo_flb_global.count =3D=3D LUO_FLB_MAX) + return -ENOSPC; =20 /* Check that compatible string is unique in global list */ list_private_for_each_entry(gflb, &luo_flb_global.list, private.list) { if (!strcmp(gflb->compatible, flb->compatible)) - goto err_resume; + return -EEXIST; } =20 list_add_tail(&private->list, &luo_flb_global.list); @@ -414,13 +400,8 @@ int liveupdate_register_flb(struct liveupdate_file_han= dler *fh, private->users++; link->flb =3D flb; list_add_tail(&no_free_ptr(link)->list, flb_list); - luo_session_resume(); =20 return 0; - -err_resume: - luo_session_resume(); - return err; } =20 /** @@ -455,13 +436,6 @@ int liveupdate_unregister_flb(struct liveupdate_file_h= andler *fh, if (!liveupdate_enabled()) return -EOPNOTSUPP; =20 - /* - * Ensure the system is quiescent (no active sessions). - * This acts as a global lock for unregistration. - */ - if (!luo_session_quiesce()) - return -EBUSY; - guard(rwsem_write)(&luo_flb_lock); guard(rwsem_write)(&ACCESS_PRIVATE(fh, flb_lock)); =20 @@ -476,7 +450,7 @@ int liveupdate_unregister_flb(struct liveupdate_file_ha= ndler *fh, } =20 if (err) - goto err_resume; + return err; =20 private->users--; /* @@ -488,13 +462,7 @@ int liveupdate_unregister_flb(struct liveupdate_file_h= andler *fh, luo_flb_global.count--; } =20 - luo_session_resume(); - return 0; - -err_resume: - luo_session_resume(); - return err; } =20 /** diff --git a/kernel/liveupdate/luo_internal.h b/kernel/liveupdate/luo_inter= nal.h index 8083d8739b09..ec949f91c8c1 100644 --- a/kernel/liveupdate/luo_internal.h +++ b/kernel/liveupdate/luo_internal.h @@ -83,8 +83,6 @@ int __init luo_session_setup_outgoing(void *fdt); int __init luo_session_setup_incoming(void *fdt); int luo_session_serialize(void); int luo_session_deserialize(void); -bool luo_session_quiesce(void); -void luo_session_resume(void); =20 int luo_preserve_file(struct luo_file_set *file_set, u64 token, int fd); void luo_file_unpreserve_files(struct luo_file_set *file_set); diff --git a/kernel/liveupdate/luo_session.c b/kernel/liveupdate/luo_sessio= n.c index 783677295640..067ffb54c36a 100644 --- a/kernel/liveupdate/luo_session.c +++ b/kernel/liveupdate/luo_session.c @@ -600,47 +600,3 @@ int luo_session_serialize(void) =20 return err; } - -/** - * luo_session_quiesce - Ensure no active sessions exist and lock session = lists. - * - * Acquires exclusive write locks on both incoming and outgoing session li= sts. - * It then validates no sessions exist in either list. - * - * This mechanism is used during file handler un/registration to ensure th= at no - * sessions are currently using the handler, and no new sessions can be cr= eated - * while un/registration is in progress. - * - * This prevents registering new handlers while sessions are active or - * while deserialization is in progress. - * - * Return: - * true - System is quiescent (0 sessions) and locked. - * false - Active sessions exist. The locks are released internally. - */ -bool luo_session_quiesce(void) -{ - down_write(&luo_session_global.incoming.rwsem); - down_write(&luo_session_global.outgoing.rwsem); - - if (luo_session_global.incoming.count || - luo_session_global.outgoing.count) { - up_write(&luo_session_global.outgoing.rwsem); - up_write(&luo_session_global.incoming.rwsem); - return false; - } - - return true; -} - -/** - * luo_session_resume - Unlock session lists and resume normal activity. - * - * Releases the exclusive locks acquired by a successful call to - * luo_session_quiesce(). - */ -void luo_session_resume(void) -{ - up_write(&luo_session_global.outgoing.rwsem); - up_write(&luo_session_global.incoming.rwsem); -} --=20 2.53.0.851.ga537e3e6e9-goog