From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6B2F0C28B30 for ; Thu, 20 Mar 2025 18:31:06 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 622E5280004; Thu, 20 Mar 2025 14:31:05 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5AB5E280001; Thu, 20 Mar 2025 14:31:05 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 42803280004; Thu, 20 Mar 2025 14:31:05 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 2234F280001 for ; Thu, 20 Mar 2025 14:31:05 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id E045D55B9E for ; Thu, 20 Mar 2025 18:31:04 +0000 (UTC) X-FDA: 83242771248.30.4061752 Received: from mail-qt1-f181.google.com (mail-qt1-f181.google.com [209.85.160.181]) by imf19.hostedemail.com (Postfix) with ESMTP id 0DB4C1A001C for ; Thu, 20 Mar 2025 18:31:02 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=soleen-com.20230601.gappssmtp.com header.s=20230601 header.b=yzt8QzdS; spf=pass (imf19.hostedemail.com: domain of pasha.tatashin@soleen.com designates 209.85.160.181 as permitted sender) smtp.mailfrom=pasha.tatashin@soleen.com; dmarc=pass (policy=none) header.from=soleen.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1742495463; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=mtG9gf5FgKA6eY6YRT9BshPGwRpE+hENpTGe4jADqQw=; b=sE9FWxM72vtonBDNcQJjydnmuPvecTs5BblqGjn8GA7iXfZKc0jzoMPrFME3zNHEGPbr1d L1AjQ4gOU0EFlEgxlpS4TkeSrGswZQ6DeFmtOS1ORF0y/cee8PUwzKSdwEOXJYNjFkFTx0 A5ISX+4iw4xa1PCqjGTV8gXjceRiOJM= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1742495463; a=rsa-sha256; cv=none; b=GFNw/h6t8/gNw8/T3bwrOrt3hwJi/tMvF2hs8+zTUoLMKaYefZ/MlM3Zy/AVtdfPFjC9W7 iJrGutiBTbC8kscHTgZKW6rIExfVbX2vUYiYTV07UWBHUcx6bapNO+g9rBY5CSAza22H9D 9fQKNcOAFtJoMuqxtYGX+9iSVwVAsCc= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=soleen-com.20230601.gappssmtp.com header.s=20230601 header.b=yzt8QzdS; spf=pass (imf19.hostedemail.com: domain of pasha.tatashin@soleen.com designates 209.85.160.181 as permitted sender) smtp.mailfrom=pasha.tatashin@soleen.com; dmarc=pass (policy=none) header.from=soleen.com Received: by mail-qt1-f181.google.com with SMTP id d75a77b69052e-476964b2c1dso20448331cf.3 for ; Thu, 20 Mar 2025 11:31:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen-com.20230601.gappssmtp.com; s=20230601; t=1742495462; x=1743100262; darn=kvack.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=mtG9gf5FgKA6eY6YRT9BshPGwRpE+hENpTGe4jADqQw=; b=yzt8QzdSeYj2Gjb1CZDG5rDB9kKfvJQVZmZEq9jNuJNMsnG/a/0/kaMAOCMxpVN56V Da2U8QSfIYfRN+8MW88tz5uX1eP5Yl0kY1vbKVlOjxr/9IUVXSwiDPjM4wMPfGlq7L1F Ufr26wfSCDha3QVdP02Z+j6TaYe8yLN5lgY/Z9PdGutkqa/pwYbEX+6PnfpD1qutT067 vAGG72FSNv2kYPn5s7ewBC00J8DWZxkJI1M7pxo3WwNPOB7YBzKT6KTdi4n2S4iKSUBL Z3LFAtF9zz6cgkkbX7YHZHllq6qrReCIW40Y18SBpqd75YpM9BY/FmdzZFd1Sp0rmOn2 BJZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742495462; x=1743100262; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mtG9gf5FgKA6eY6YRT9BshPGwRpE+hENpTGe4jADqQw=; b=QNVODEwNwaNb/gLo6bTvhOrqosEtE4KERsJMI0MDmxOsl9VIFTflb6mO6jeB8pNmyP gm4L1z1iydgmU/5auNFe1O2ekVcJINxTADDL0durUrzIBEnnxAHAoYOKhIq5YXOJqNoH atl4tke9f/wnj1DyjnQLs0FcDudxYpHILpViUD8z7MixT4dWd9z1SqbOyghCJZ3C65ab ZcvnUAi4lt6rtslA+CVjGNb65A88Yr+ergJeOf+FhcMzWZ0qO3xOKYScBc9lmlWemlui D/vo9QGtvbSMFWyYFyQjl2qINn63Xr5pg5dQYrSrunQdZ3GdIZRNp00Owl05bLySL/kE BEKw== X-Forwarded-Encrypted: i=1; AJvYcCW03+eM5Ueh5v//D/2qj5NYIxHmdwHS1V4lbrWUZucDa7lBBsFeIwtb/5kqBZFJvLCLpVEo1eIPVA==@kvack.org X-Gm-Message-State: AOJu0YxRH+8jCERBzS7J7xXNASWPGU9xi4NnNmaaKspOesZCvJKkRoT1 kQC/1yvDhVs0uRlzW/q32e8driHh8E9M2AgFE1fOB2O4bSPkPlt2v6QI1zzkqt3pcer2keB9a8F oCPAZPKEVpUdEt3POFdAvG1x2Y4r6V71RPtgAIA== X-Gm-Gg: ASbGncvd7XmrIciJSysFF+lkIQW2Wo1YlMovLgiHxIyKz56hSwzspUbPx8BMonMT5Hb aCqicB1tpYJwBAVIx9nyAn/Kk+n4sLs2KmQDAX+lXq460E0KDgtc2QQve1PeX8ft4F9GR4SeE7m P7bcHBZ6ntZ7Ovzg/Tjgh/SsYJtrh1SPL2rw== X-Google-Smtp-Source: AGHT+IFqX17oEVPuZbqf446QYtb2Di310WRkl/Dqk2wt6mMBXiCz6I8wulhvvrs+M761WPPyHRhMSYzgn47pKR6cr6k= X-Received: by 2002:a05:622a:418b:b0:476:add4:d2c0 with SMTP id d75a77b69052e-4771de4792dmr4861841cf.35.1742495461873; Thu, 20 Mar 2025 11:31:01 -0700 (PDT) MIME-Version: 1.0 References: <20250320024011.2995837-1-pasha.tatashin@soleen.com> <20250320024011.2995837-2-pasha.tatashin@soleen.com> In-Reply-To: From: Pasha Tatashin Date: Thu, 20 Mar 2025 14:30:25 -0400 X-Gm-Features: AQ5f1JpHpjz1VH8ikB3opDcdZI4T-5QV1E_LN4WKtkhP3V0qop2kKh_p816Drds Message-ID: Subject: Re: [RFC v1 1/3] luo: Live Update Orchestrator To: Andy Shevchenko Cc: changyuanl@google.com, graf@amazon.com, rppt@kernel.org, rientjes@google.com, corbet@lwn.net, rdunlap@infradead.org, ilpo.jarvinen@linux.intel.com, kanie@linux.alibaba.com, ojeda@kernel.org, aliceryhl@google.com, masahiroy@kernel.org, akpm@linux-foundation.org, tj@kernel.org, yoann.congal@smile.fr, mmaurer@google.com, roman.gushchin@linux.dev, chenridong@huawei.com, axboe@kernel.dk, mark.rutland@arm.com, jannh@google.com, vincent.guittot@linaro.org, hannes@cmpxchg.org, dan.j.williams@intel.com, david@redhat.com, joel.granados@kernel.org, rostedt@goodmis.org, anna.schumaker@oracle.com, song@kernel.org, zhangguopeng@kylinos.cn, linux@weissschuh.net, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-mm@kvack.org, gregkh@linuxfoundation.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, rafael@kernel.org, dakr@kernel.org, bartosz.golaszewski@linaro.org, cw00.choi@samsung.com, myungjoo.ham@samsung.com, yesanishhere@gmail.com, Jonathan.Cameron@huawei.com, quic_zijuhu@quicinc.com, aleksander.lobakin@intel.com, ira.weiny@intel.com, leon@kernel.org, lukas@wunner.de, bhelgaas@google.com, wagi@kernel.org, djeffery@redhat.com, stuart.w.hayes@gmail.com, jgowans@amazon.com, jgg@nvidia.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Stat-Signature: cj9ehojg7huqejks9s6wgfoyghnibtip X-Rspam-User: X-Rspamd-Queue-Id: 0DB4C1A001C X-Rspamd-Server: rspam08 X-HE-Tag: 1742495462-523135 X-HE-Meta: U2FsdGVkX192YBO2NTIO0tQsLVhyCcZE2N9/C7fs7+Eyb2jK51mK1+wlnTJmWvBJx0XsUqH63GSJ7mJCWCVp0kX9iLASc1Hb5wfwwxTSH25Eqvp7sa/svsNR4no4BYxpNXpvl//svoKbZ1qgCyL5G72hU0ISUiDLBFH8e9zNzW2lCX0m8/gC5PfS6jCMuLMppo4tk6bCLQeCjOh3HxJ4Noq9OTaz26Vp+x+/RE9HHJAVkAaraYFWh2Q/8zQaeha7pNLfMlORuQfyo7LrWaWBwViHCxVi4L3St4gVDh35nmcVsQT/UwdG2Tolk0+9LXlnGHPx/u/gCGWpJhxxYwesa43V/Lou1jwAXZhAjY32R/A8Xxv4kzaepYiWhrnJD1DpsmhEcDWnbXwJ/I82gqwhtfOEO9gMWzcZWLvkAZDMN+FQ3T7FgaUrl2wZ5Wk6nOxT8RodLy+iftAxHzgz+LxPOGMKfW+v4oEmuvUZWTb3mEbvWHkU+oYBlxXxhiL+OWIZcI+Y2Zv8UVnkOeYMmR3oP3O6GsZiHyAyrW41eH9vCkl30Pk4+fn0IwSE+LFdKYFnRA+voGrkdWZJQ2oe96PxzmDAIfBT+FQNLtTUei2K0la8H0sWRaky8RMhFr97mqvCgksncMt4t9DUxSWhuQxmOO5ZItzsETwluOByX1Of3zq4rgam5WQjKF5ZldfcL2RRbNdv/kH9idAzYsyqxXFRtPAclVfaltRbxgaBznBQuiyKENRDyCvmhyd56XV3aEOMqoeUJphXnR+v3RtkaWFR7NCpfcicoMfp9ri4EIWil4uxCl+rutdysuAp11L3OnhDBT22p9dVHGHIQ7Jjz6tdl4xiSr1T3BbtSXvkA0TX6eqFuhOd9jVLSOW2TBPJfuA/40mwJaDV0R/xc0W09dWupjeNIcTRPsNvqRRDN6z43uXZU5CTwr+dvrrP50WG26/ulN9QDVUzHP/1ytCD+wl ZBBdO08k TfZAHXd7qyPywZb4F2vEnrq8ksyc/x88i9tMq8Th2idIFO4nVO5ffVpNIV+ifS67JHsgFLqV1NaJ9H1xN46hza5XlxFbM+VXjQsiiNLdE6XCQ9gTaZVST0jH6Yrzvtkd2r2gzG6GWQPmXuZPmfi3FTigm3zRBEWt1VgnIid3JegQzB+2kLVOUwdGxb3uNtiRpPgQoC1KnSwQF2QfEPcD6Pm2GIZ/mpGguDsSBpmA7do8NNOfPllJGyWRI5+9C3gGt4HKf8zVzcadskRpvFw+hj84Hb9lV9g5S0YOmyZnoSbLe6ryo9PZpmLV7ZHIt84EccWNYWejdlWGPjuB+fIKtbDGb6OJsJL4vFW7TxU/0k6kOm95IW1Izt5q8zXIRk1DiKxXk X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Thu, Mar 20, 2025 at 1:50=E2=80=AFPM Andy Shevchenko wrote: > > On Thu, Mar 20, 2025 at 12:35:20PM -0400, Pasha Tatashin wrote: > > On Thu, Mar 20, 2025 at 9:40=E2=80=AFAM Andy Shevchenko > > wrote: > > > On Thu, Mar 20, 2025 at 02:40:09AM +0000, Pasha Tatashin wrote: > > ... > > > > > +#ifndef _LINUX_LIVEUPDATE_H > > > > +#define _LINUX_LIVEUPDATE_H > > > > > > > +#include > > > > +#include > > > > > > This is semi-random list of inclusions. Try to follow IWYU principle. > > > See below. > > > > I will remove > > But you need to add something more... ... > > ... > > > > > +bool liveupdate_state_updated(void); > > > > > > Where bool is defined? > > > > in kernel/liveupdate.c > > Nope, I meant where the type is defined. It is IIRC in types.h which need= s to > be included. Ah, I see what you mean, sure I will include types.h. > > ... > > > > > + if (kstrtol(buf, 0, &val) < 0) > > > > + return -EINVAL; > > > > > > Shadower error code. > > > > In this case it is appropriate, we do not case why kstrtol() could not > > be converted into an appropriate integer, all we care is that the > > input was invalid, and that what we return back to user. > > The kstrtox() may give different error codes. User may want to know more = about > what's wrong with the input. Shadowed error codes are discouraged and sho= uld be > explained. > ... > > > > + if (val !=3D 1 && val !=3D 0) > > > > + return -EINVAL; > > > > > > What's wrong with using kstrtobool() from the beginning? > > > > It makes the input less defined, here we only allow '1' or '0', > > kstrtobool() allows almost anything. > > But kstrtobool() is the interface for boolean input. You may document onl= y > 0 and 1 and don't tell people to use anything else. ABI documentation sho= uld > be clear, that's it. Sure, I will use kstrtobool(). > > ... > > > > > +EXPORT_SYMBOL_GPL(liveupdate_state_normal); > > > > > > No namespace? > > > > Namespace is 'liveupdate_', all public interfaces have this prefix, > > private functions are prefixed with luo_ where it makes sense. > > No, I'm talking about export namespace. Why does the entire kernel need t= hese APIs? These functions are intended for use by drivers and other subsystems participating in the live update. They allow these components to determine, during boot, whether to restore their state from the serialized state, or, during runtime, whether a live update is in the prepared state, causing different behavior compared to normal mode (e.g., prohibiting DMA mappings modifications, binding/unbinding, etc.). Pasha > -- > With Best Regards, > Andy Shevchenko