Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp2081152lqz; Tue, 2 Apr 2024 06:52:47 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUbpxANY3e5YLwj9s6r/VpQavwFfcKR11fOpdoaxlWdoWTDIT8zawy+1DXZZ5kV1iFmC9Z/ZLhP3cAK+GsqY6YWovHg60HsXPc4olxLrA== X-Google-Smtp-Source: AGHT+IGnID8VtHFDiEQRFpqb6ZuureLg8CTMkyUSfiA4rF0D8LBK4Nap7GXiU2nlAgxBXZdPnFDs X-Received: by 2002:a05:6512:10cd:b0:516:a2f9:dd40 with SMTP id k13-20020a05651210cd00b00516a2f9dd40mr6801107lfg.34.1712065967230; Tue, 02 Apr 2024 06:52:47 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712065967; cv=pass; d=google.com; s=arc-20160816; b=lQM0FKW6vQic493XR6hw6Zsky9Rgm4GGxm5OmWO0htUH0VLrq7xUnNTFYcit9HVqKJ fZeKVE7Oul15StDij0uoeyjQ+I1kUuev+5lsVm+lb+FKpj0oYxj8Dz8aRLfBzQ2eCyg5 t9VxAZPXjctxL9YvIaf7xNbwqb4Ga7KL+W6G7rgVDtE24gWFfCg2TB3iAk000xaIwCMD IdDxFTspznzA4TACsdBCGcAbWmVtjpeh7ZOubFUoCbNjAtenU1+EEWevqjt4pIx3zwvJ +A1bNg5gQ4Txcwmc0nJpcHAcfn/GO+ZXFiLVA3eMoxSQwZWUz+sENcU97Q7nK0ZhJmxm +Dyw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=DhTrdl+Lsun5myVNSpVrwdD2BVn4sbhl051ZYtiso+E=; fh=9gq6CRjyzmkUBF9b4IZ6TnjIyYBXPCZ8hdDoRN6P39w=; b=KV5tTYe26h5VooqemyIRVvfq1mG9f7J2Rp4sRI1HL4E4pm5xJ38alP7sEkrc15gL4N weLyeF711ix8/dP0T1Z9ncqIW7cSojeGk8erqrLKg/YAdkFw+u+saa33jkWLjaLbUWJy XuyqRMqLEFVXddtSxOLls7ywCSQq3+W1xxtgbwW2YQuT1/g/JAfkZC5zfpeMCDy4U3Ra ZV0ZaYHeCkiW26jq8NJq602IyN6FFr41H7Oo7UgSakQ4vSMVO7ZfdX7xR+JDpyL83AMH gg09HVu8w9ZoKFDhZi6kJIaS/bsb5zGy+pEW7mBYmy37DVaO9RZligyEM5a9ZB7wGQFw 1mhw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ExEutO3v; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-128081-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-128081-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id b20-20020a056402351400b0056bb595c538si5688356edd.462.2024.04.02.06.52.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Apr 2024 06:52:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-128081-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ExEutO3v; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-128081-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-128081-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id D433F1F23478 for ; Tue, 2 Apr 2024 13:52:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E78D284A4D; Tue, 2 Apr 2024 13:52:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="ExEutO3v" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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 9B9DF84A22 for ; Tue, 2 Apr 2024 13:52:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712065958; cv=none; b=A1zcn5rN1aBDpUai0c92/xbFCs7FJ73oQxpyMqXdh0M5NUUUJ86v3wKbudlqay/k9Cg1/CvpU7895XgbITbnZnMCaaz7BBD+xFtUXQ1O/UHaC5gcI14dkyJXgRHja96bfKKN0pcBCHkpfLM21/it5pBwbghl2bVi87T6fXtjnn8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712065958; c=relaxed/simple; bh=DPrcRRAqP1t9Y3kbn2V/yhUWU5FgxTbcD5//bRhvtjw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=gLVgd7CY2WBWp04P2y6gvzm9vEEFfuUDHLz/LUbY8pF6/VMB6EvTvW8MJooVsrsVMflsB6djVEqpJyKmdFmyCZWfGb1wtUBN1woVF7oQ7YZ4ykDDkZCa2M3lJhM4Ja1WayKACrq2CcB61kEV2yocxgYntRhkot6rcuq/qsC8jWA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=ExEutO3v; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1712065955; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=DhTrdl+Lsun5myVNSpVrwdD2BVn4sbhl051ZYtiso+E=; b=ExEutO3vx7tEx5TUBLXtzOefuDiZUpAJS5Odm32xdqa4Ej1FFEfV9GQZ73ZZBv5/Ej94kY 0zcp93VsOQege5C0bLhPG86YKttKUHWzAQRkR3fUDslN+SNBDnMlEoqztHWCWAA18xPOHr q6OAVltVkTQl5nb4hp+Mf5lR31Ye0fE= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-206-V_eTs7JBMga5AQrHxfFSIA-1; Tue, 02 Apr 2024 09:52:34 -0400 X-MC-Unique: V_eTs7JBMga5AQrHxfFSIA-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7EB183C025B9; Tue, 2 Apr 2024 13:52:33 +0000 (UTC) Received: from redhat.com (unknown [10.22.8.63]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 28A092024517; Tue, 2 Apr 2024 13:52:33 +0000 (UTC) Date: Tue, 2 Apr 2024 09:52:31 -0400 From: Joe Lawrence To: zhangwarden@gmail.com Cc: jpoimboe@kernel.org, mbenes@suse.cz, jikos@kernel.org, pmladek@suse.com, live-patching@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] livepatch: Add KLP_IDLE state Message-ID: References: <20240402030954.97262-1-zhangwarden@gmail.com> 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: <20240402030954.97262-1-zhangwarden@gmail.com> X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.4 On Tue, Apr 02, 2024 at 11:09:54AM +0800, zhangwarden@gmail.com wrote: > From: Wardenjohn > > In livepatch, using KLP_UNDEFINED is seems to be confused. > When kernel is ready, livepatch is ready too, which state is > idle but not undefined. What's more, if one livepatch process > is finished, the klp state should be idle rather than undefined. > > Therefore, using KLP_IDLE to replace KLP_UNDEFINED is much better > in reading and understanding. > --- > include/linux/livepatch.h | 1 + > kernel/livepatch/patch.c | 2 +- > kernel/livepatch/transition.c | 24 ++++++++++++------------ > 3 files changed, 14 insertions(+), 13 deletions(-) > > diff --git a/include/linux/livepatch.h b/include/linux/livepatch.h > index 9b9b38e89563..c1c53cd5b227 100644 > --- a/include/linux/livepatch.h > +++ b/include/linux/livepatch.h > @@ -19,6 +19,7 @@ > > /* task patch states */ > #define KLP_UNDEFINED -1 > +#define KLP_IDLE -1 Hi Wardenjohn, Quick question, does this patch intend to: - Completely replace KLP_UNDEFINED with KLP_IDLE - Introduce KLP_IDLE as an added, fourth potential state - Introduce KLP_IDLE as synonym of sorts for KLP_UNDEFINED under certain conditions I ask because this patch leaves KLP_UNDEFINED defined and used in other parts of the tree (ie, init/init_task.c), yet KLP_IDLE is added and continues to use the same -1 enumeration. -- Joe