Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp976246ybx; Fri, 1 Nov 2019 14:29:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqzpYJthQ0hTe9+KX6MhCfKr50BHqRma26Lh35OtYE5UR3Y5JWcbe6z0xvYlbkZ+34mc3hVk X-Received: by 2002:a17:906:1f44:: with SMTP id d4mr11803293ejk.16.1572643789234; Fri, 01 Nov 2019 14:29:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572643789; cv=none; d=google.com; s=arc-20160816; b=wB5/NuPK0OZElKbIZKhLds8o5o1iRla9CfgbFgaKeUs9em32HKjiW5NtFCkiFs96pB 1mhXnnnVcf9ktVbKcCfpjSPvccZ3YT5wKVxCn+1MYNwbd2AmgJ4MPzyWDqTpU2DoPiG+ TAW1eNauop7/auRFQrb5ZZBf54FHl5nZ4QJdmIeTPoYeGzQFpWyvOuPOQNIwP0YHmS+k RHAUirS8hAISyAgx9tAZf860D55kwW0Q+qVVQ0juJx6KCaFgyeevNHEwlXisxvTgVAc7 Qizi1g6wlsIUAvCPtPJrqjTIlVikxLsTTBI0DjoV2q5vcLCKQiWXHmC7RpbzOCvy2142 P9Zw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:user-agent:in-reply-to:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=H5g1dJ83xYMje0MLz6efrEudvgOBSIp8W03RhGkcafY=; b=e4DMhNw139B+9FZWTcJalB6ey6DYCOXdOOPssdnhLxJO52485Ncr20hyXyOpviILj4 2UigjUigLqkhSB9vy+ennqwcayTDfQ6hpSkPBST3iV0d9+kfzIR+KIuJz/hrHXsS8pww 73cdEUstN86GNkUd8h3Oa9uito51HSORZ5xiYwqSyxL/xJZWeWFdDLCKqlrHV3HC+jtF NeDRfBVyQbczFabLZl2z32O+PlPffyx+GrW0Ha+Kl1J0HQ5G716NUTwKDW1z6IEsVbxN XW/XGua2flrW9sD1XbXBKjZEfWqr3ydalwMgaMx5D6slC26NqpRUYP8FA5i8BnsXpvhi cd/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=LxqfaOKd; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u59si1511477edc.193.2019.11.01.14.29.25; Fri, 01 Nov 2019 14:29:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=LxqfaOKd; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727172AbfKAV0r (ORCPT + 99 others); Fri, 1 Nov 2019 17:26:47 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:49435 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727109AbfKAV0q (ORCPT ); Fri, 1 Nov 2019 17:26:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1572643605; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=H5g1dJ83xYMje0MLz6efrEudvgOBSIp8W03RhGkcafY=; b=LxqfaOKd04iPOO8jb1Bt7b9p7res+leSiFwCZ6yWdHlh/4tdrc1Zu+HAt0mEY8lrbDPHW3 75xxMeaw2S7J5EmO/SWNbxn0JGRK9gE050kp4VYgnuSRBTeeRnzt+L1PAh/Z1ax23JnU6I Ai3I5+3c8zbwEXgSHG3k2iB5ma5TTnc= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-280-oaJ7QoXIPLaDl976H0a7hg-1; Fri, 01 Nov 2019 17:26:41 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7551C800A1E; Fri, 1 Nov 2019 21:26:40 +0000 (UTC) Received: from amt.cnet (ovpn-112-2.gru2.redhat.com [10.97.112.2]) by smtp.corp.redhat.com (Postfix) with ESMTP id D043F60870; Fri, 1 Nov 2019 21:26:37 +0000 (UTC) Received: from amt.cnet (localhost [127.0.0.1]) by amt.cnet (Postfix) with ESMTP id 447D7105176; Fri, 1 Nov 2019 19:19:15 -0200 (BRST) Received: (from marcelo@localhost) by amt.cnet (8.14.7/8.14.7/Submit) id xA1LJB2V020685; Fri, 1 Nov 2019 19:19:11 -0200 Date: Fri, 1 Nov 2019 19:19:11 -0200 From: Marcelo Tosatti To: Zhenzhong Duan Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, joao.m.martins@oracle.com, rafael.j.wysocki@intel.com, rkrcmar@redhat.com, pbonzini@redhat.com Subject: Re: [PATCH 4/5] cpuidle-haltpoll: add a check to ensure grow start value is nonzero Message-ID: <20191101211908.GA20672@amt.cnet> References: <1572060239-17401-1-git-send-email-zhenzhong.duan@oracle.com> <1572060239-17401-5-git-send-email-zhenzhong.duan@oracle.com> MIME-Version: 1.0 In-Reply-To: <1572060239-17401-5-git-send-email-zhenzhong.duan@oracle.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-MC-Unique: oaJ7QoXIPLaDl976H0a7hg-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Oct 26, 2019 at 11:23:58AM +0800, Zhenzhong Duan wrote: > dev->poll_limit_ns could be zeroed in certain cases (e.g. by > guest_halt_poll_shrink). If guest_halt_poll_grow_start is zero, > dev->poll_limit_ns will never be larger than zero. >=20 > Signed-off-by: Zhenzhong Duan > --- > drivers/cpuidle/governors/haltpoll.c | 15 ++++++++++++--- > 1 file changed, 12 insertions(+), 3 deletions(-) I would rather disallow setting grow_start to zero rather than silently setting it to one on the back of the user.