From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755457AbdKBNNW (ORCPT ); Thu, 2 Nov 2017 09:13:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37712 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751898AbdKBNNU (ORCPT ); Thu, 2 Nov 2017 09:13:20 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 33F70356E1 Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=jpoimboe@redhat.com Date: Thu, 2 Nov 2017 08:13:18 -0500 From: Josh Poimboeuf To: Miroslav Benes Cc: jeyu@kernel.org, jikos@kernel.org, pmladek@suse.com, lpechacek@suse.cz, pavel@ucw.cz, live-patching@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 2/2] livepatch: force transition process to finish Message-ID: <20171102131318.ovjpygmerxhadhu7@treble> References: <20171031114853.841-1-mbenes@suse.cz> <20171031114853.841-3-mbenes@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20171031114853.841-3-mbenes@suse.cz> User-Agent: Mutt/1.6.0.1 (2016-04-01) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Thu, 02 Nov 2017 13:13:20 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 31, 2017 at 12:48:53PM +0100, Miroslav Benes wrote: > If a task sleeps in a set of patched functions uninterruptedly, it could > block the whole transition process indefinitely. Thus it may be useful > to clear its TIF_PATCH_PENDING to allow the process to finish. The phrase "transition process" (here and in the patch title) confused me a little bit, since elsewhere we just call it "transition". > +static ssize_t force_store(struct kobject *kobj, struct kobj_attribute *attr, > + const char *buf, size_t count) > +{ > + int ret; > + bool val; > + > + /* > + * klp_mutex lock is not grabbed here intentionally. It is not really > + * needed. The race window is harmless and grabbing the lock would only > + * hold the action back. > + */ > + if (!klp_transition_patch) > + return -EINVAL; > + > + ret = kstrtobool(buf, &val); > + if (ret) > + return ret; > + > + if (val) > + klp_force_transitions(); The plural "transitions" is inconsistent with the rest of the code, which uses it in the singular. How about klp_force_transition() or klp_force()? -- Josh