From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754908AbcFTSiS (ORCPT ); Mon, 20 Jun 2016 14:38:18 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:12013 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751996AbcFTSiL (ORCPT ); Mon, 20 Jun 2016 14:38:11 -0400 X-IBM-Helo: d03dlp01.boulder.ibm.com X-IBM-MailFrom: paulmck@linux.vnet.ibm.com Date: Mon, 20 Jun 2016 11:37:57 -0700 From: "Paul E. McKenney" To: Arnd Bergmann Cc: Boqun Feng , Josh Triplett , linux-kernel@vger.kernel.org Subject: Re: [PATCH] torture: use ktime_t consistently Reply-To: paulmck@linux.vnet.ibm.com References: <20160620155651.2497676-1-arnd@arndb.de> <20160620182105.GV3923@linux.vnet.ibm.com> <7277827.7A0WjZ9kZU@wuerfel> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7277827.7A0WjZ9kZU@wuerfel> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16062018-0004-0000-0000-00000FBA44B2 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16062018-0005-0000-0000-00007655AB7E Message-Id: <20160620183757.GX3923@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-06-20_10:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1604210000 definitions=main-1606200203 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 20, 2016 at 08:29:48PM +0200, Arnd Bergmann wrote: > On Monday, June 20, 2016 11:21:05 AM CEST Paul E. McKenney wrote: > > On Mon, Jun 20, 2016 at 05:56:40PM +0200, Arnd Bergmann wrote: > > > > @@ -446,9 +447,9 @@ EXPORT_SYMBOL_GPL(torture_shuffle_cleanup); > > * Variables for auto-shutdown. This allows "lights out" torture runs > > * to be fully scripted. > > */ > > -static int shutdown_secs; /* desired test duration in seconds. */ > > +static ktime_t shutdown_ms; /* desired test duration in seconds. */ > > the variable name is a bit odd. The comment is certainly now wrong, good catch! If there was an s_to_ktime(), I would have kept the old name, but I could not find one. Possibly due to me being blind... > > @@ -511,10 +513,10 @@ int torture_shutdown_init(int ssecs, void (*cleanup)(void)) > > { > > int ret = 0; > > > > - shutdown_secs = ssecs; > > torture_shutdown_hook = cleanup; > > - if (shutdown_secs > 0) { > > - shutdown_time = jiffies + shutdown_secs * HZ; > > + if (ssecs > 0) { > > + shutdown_ms = ms_to_ktime(ssecs * 1000ULL); > > + shutdown_time = ktime_add(ktime_get(), shutdown_ms); > > ret = torture_create_kthread(torture_shutdown, NULL, > > shutdown_task); > > and I picked ktime_set(ssecs, 0) instead of ms_to_ktime(ssecs * 1000ULL), but > both differences are just cosmetic and should end up in exactly the > same object code that I suggested. Unless we both made the same mistake, > your version should be good too. Thank you for looking it over! My I apply your Acked-by:, Reviewed-by:, or some such? Thanx, Paul