From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751804AbdKUKEa (ORCPT ); Tue, 21 Nov 2017 05:04:30 -0500 Received: from mx2.suse.de ([195.135.220.15]:51228 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751725AbdKUKE2 (ORCPT ); Tue, 21 Nov 2017 05:04:28 -0500 Date: Tue, 21 Nov 2017 11:04:24 +0100 From: Petr Mladek To: Miroslav Benes Cc: jpoimboe@redhat.com, jeyu@kernel.org, jikos@kernel.org, lpechacek@suse.cz, pavel@ucw.cz, live-patching@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 2/2] livepatch: force transition to finish Message-ID: <20171121100424.frdmd52jefluyu4x@pathway.suse.cz> References: <20171115135014.20594-1-mbenes@suse.cz> <20171115135014.20594-3-mbenes@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170421 (1.8.2) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon 2017-11-20 16:57:19, Miroslav Benes wrote: > On Wed, 15 Nov 2017, Miroslav Benes wrote: > > > If a task sleeps in a set of patched functions uninterruptedly, it could > > block the whole transition indefinitely. Thus it may be useful to clear > > its TIF_PATCH_PENDING to allow the process to finish. > > > > Admin can do that now by writing to force sysfs attribute in livepatch > > sysfs directory. TIF_PATCH_PENDING is then cleared for all tasks and the > > transition can finish successfully. > > > > Important note! Administrator should not use this feature without a > > clearance from a patch distributor. It must be checked that by doing so > > the consistency model guarantees are not violated. > > > > Signed-off-by: Miroslav Benes > > While working on "immediate" removal, I realized we had the similar > problem here with modules removal. There is no way out of the rabbit hole. > > If a patch is forced, we obviously cannot say there is no task sleeping in > the old code. This could be disastrous if such old module is then removed > (either we disabled it and we want to rmmod it, or there is a new "atomic > replace" patch and we want to remove the old one). > We need something like the following (at least as a starting point) Great catch! The proposed solution looks good to me. And as already mentioned, it might be worth updating the documentation. For the whole patchset, including this fixup: Reviewed-by: Petr Mladek Best Regards, Petr