From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (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 5ACFF1B3950 for ; Thu, 2 Jan 2025 15:27:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735831664; cv=none; b=pAER3FATE7ecA3rs0w2hQ4GW2PR9Np0QAz57BoXRBk9Byz0jq/sKmVQ8rz1/icjkIrmqS0wE7r9o3x/pB9zv+gqnuUFYc6HYCJmXfZBNYgmzLl2zOnswwvZuzcXGohBK4TUgo77ckWyzEdGj5pPyT+QO6FbqDmNzXfhTrwORsBU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735831664; c=relaxed/simple; bh=n+Gj8NdzfT6j/tuL1ZIoARiw552+ZjcUH8ctsmzGD2Q=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=LBEFxFJXdNaOWuxzA/dY7zL0i5fvGxZD3XrpkAEPynrs+94w4rc8oQxKiSaaRij6Dj/8pYitKIarzNJpp4iPWxBFGL5FHoG5NoOXl45q6SG+8aLOvCjT3xy0YMnW9K+pPLbs2fZzj2U4QS03pHbFWgfWfeZyTOAqvqg4tZC/NVY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=Nvsjs2o/; arc=none smtp.client-ip=209.85.128.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="Nvsjs2o/" Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-4361f65ca01so114407655e9.1 for ; Thu, 02 Jan 2025 07:27:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1735831661; x=1736436461; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=05upqEVJPolnyr/HoSHZRKWoniI8eKda58PhaQdla5Y=; b=Nvsjs2o/GLN5+oGmb64SN7c3a5HDtS8oU2w1l2X0BGXj+J7C67dJSQeEP2J0eIi/va DPg9FkqXtNEbpjGKZskeuYeeGl+h2odl4et+tnPWVHJzezneb5V7nOrBGRXVWBINHvaP GWtYwQid70k4s2Vk3cUPMb8/kaPBvlAH6LqkV4Re4qcyC2FBFzCqezPqRBvrtp3tq9m5 IFYellCDkg5ySJLoVZCZvfumtgdhhRH0UQzNwtX8zUZm1CHonSWY3K4taNJgWOLelLrz oNssUzAAsUVxpXHbHWG/yOxj+A3bT4zR1vfrhYrRRAQiu+IbqTvkQRH6HJxMgpVGCfJv b/WA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735831661; x=1736436461; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=05upqEVJPolnyr/HoSHZRKWoniI8eKda58PhaQdla5Y=; b=h7uCb3UQwcCID6Y0m7zAcqdo1/+RsJa5wUkhNqhGhfYgmrbt8OKzNmgK9cDMdYuYvl OwYzTgOjPGgcVmBlYOwXD/orFU9ZnSAkDSPuWW2hW0zi5Uwsh6njE4EeDG64RraX0uRc gfaNbZ7sf0SM1TU5C+oyuJeokXuhwFkO/n3lt/Y9JBIUsTUYO8K2oqOrsqtg4WxvYbG8 qUzZroeB2OykEZ2EU9kIwcFSm71IemxF2DGAJWX32Z/PeMcu4XsTLh0HadSM62D8B1nL L1eZIKAYXAagOzDpYhKRzIDVd8HQANh4Fh1XcRfxnL8Qlh+v4IsYmcTDhOClIsskw5B+ M94w== X-Forwarded-Encrypted: i=1; AJvYcCXAhlXB9JxKnEmxLmzCu4xQQmgSyLW0IdCz67UmG8hYUdSAAoHon9qcHCDka6lcaPTmPm1M1aGnGWhAgSw=@vger.kernel.org X-Gm-Message-State: AOJu0YzQtX+T2GW+bMVTMna9HPdUdem2IYjzRXSpykMr/1Yn6z0q7PZt L8K97MPfzaYSKefQ19r9MExtesheV9qp1yyHmA4dm2e0BbEnAKn8mi+ZapmCRDg= X-Gm-Gg: ASbGncu1Rg80WYiCCDDhrHV6OfsyQYg508/ORkjvjNtHVy9bbse5I6+Sd/Tkgrelh++ ppmNN1lPA2ikOVh/H6ZLGjjKFIiStzzmGUGsghPChPl1l4JYtGELU2YuH2Uzsw2gRiLkUthYYqB 1yr345nuRTghcfPAIRJVmgrVNzD09QEspgdcf99ZIJOE0rf0OeJnoHogaRZmXYCNoxZcg6FpxpT 7e1ikhZIMBomCOfeLhGr+xgpyp0WZ+sZ+6rEfhpyvxti57ylVko+pjXww== X-Google-Smtp-Source: AGHT+IFcM1oKMh1kjxBO7ycMH/tQaCFmKpK0dg2zqRMgKTMW78Q/ZGzddqirXlD2dJ4tXVJnV9Cs1Q== X-Received: by 2002:a05:600c:35d2:b0:435:d22:9c9e with SMTP id 5b1f17b1804b1-43668646335mr389612275e9.19.1735831660707; Thu, 02 Jan 2025 07:27:40 -0800 (PST) Received: from pathway.suse.cz ([176.114.240.50]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43661218f43sm458314275e9.19.2025.01.02.07.27.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Jan 2025 07:27:39 -0800 (PST) Date: Thu, 2 Jan 2025 16:27:36 +0100 From: Petr Mladek To: Easwar Hariharan Cc: Christophe Leroy , Andrew Morton , Alexander Gordeev , Gerald Schaefer , Heiko Carstens , Vasily Gorbik , Christian Borntraeger , Sven Schnelle , Josh Poimboeuf , Jiri Kosina , Miroslav Benes , Joe Lawrence , linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, live-patching@vger.kernel.org Subject: Re: [PATCH v4 2/2] livepatch: Convert timeouts to secs_to_jiffies() Message-ID: References: <20241217231000.228677-1-eahariha@linux.microsoft.com> <20241217231000.228677-3-eahariha@linux.microsoft.com> <195abda2-8209-45aa-9652-f981a5de2eae@linux.microsoft.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=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <195abda2-8209-45aa-9652-f981a5de2eae@linux.microsoft.com> On Wed 2024-12-18 09:35:46, Easwar Hariharan wrote: > On 12/18/2024 12:48 AM, Christophe Leroy wrote: > > > > > > Le 18/12/2024 à 09:38, Petr Mladek a écrit : > >> On Tue 2024-12-17 23:09:59, Easwar Hariharan wrote: > >>> Commit b35108a51cf7 ("jiffies: Define secs_to_jiffies()") introduced > >>> secs_to_jiffies(). As the value here is a multiple of 1000, use > >>> secs_to_jiffies() instead of msecs_to_jiffies to avoid the > >>> multiplication. > >>> > >>> This is converted using scripts/coccinelle/misc/secs_to_jiffies.cocci > >>> with > >>> the following Coccinelle rules: > >>> > >>> @@ constant C; @@ > >>> > >>> - msecs_to_jiffies(C * 1000) > >>> + secs_to_jiffies(C) > >>> > >>> @@ constant C; @@ > >>> > >>> - msecs_to_jiffies(C * MSEC_PER_SEC) > >>> + secs_to_jiffies(C) > >>> > >>> While here, replace the schedule_delayed_work() call with a 0 timeout > >>> with an immediate schedule_work() call. > >>> > >>> --- a/samples/livepatch/livepatch-callbacks-busymod.c > >>> +++ b/samples/livepatch/livepatch-callbacks-busymod.c > >>> @@ -44,8 +44,7 @@ static void busymod_work_func(struct work_struct > >>> *work) > >>>   static int livepatch_callbacks_mod_init(void) > >>>   { > >>>       pr_info("%s\n", __func__); > >>> -    schedule_delayed_work(&work, > >>> -        msecs_to_jiffies(1000 * 0)); > >>> +    schedule_work(&work); > >> > >> Is it safe to use schedule_work() for struct delayed_work? > > > > Should be, but you are right it should then be a standard work not a > > delayed work. > > > > So probably the easiest is to keep > > > >     schedule_delayed_work(&work, 0) > > > > And eventually changing it to a not delayed work could be a follow-up > > patch. > > > >> > > Thanks for the catch, Petr! This suggestion would effectively revert > this patch to the v3 version, albeit with some extra explanation in the > commit message. I'd propose just keeping the v3 in the next branch where > it is. > > Andrew, Petr, Christophe, what do you think? I am fine with keeping v3 in next. Best Regards, Petr