Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp185606imj; Thu, 14 Feb 2019 18:12:54 -0800 (PST) X-Google-Smtp-Source: AHgI3Ib1/Y9pCHoa7yviJKN/Jg2xIC1JfPeoOlW8kd6gLI+vxM4JuLZ9KSiSfedVsvWYUvcrvucK X-Received: by 2002:a63:fb0a:: with SMTP id o10mr3009833pgh.259.1550196774293; Thu, 14 Feb 2019 18:12:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550196774; cv=none; d=google.com; s=arc-20160816; b=cVqdDV4c6FoQYyPHXuKgOv+91Zb8SVqlsXfV7Ga3wIYEggI0cwcwEqN8CURtsjPeuv uKPGNrKSK+sRN+35qXPLglfN73U3znYk8tPb0Mc40bKm5vQf+Ps8aAsLUf9mr3y3YC9c KJZVrUgeHP9JtAH4CZjzAjPtrToHQQp7ztissB/JPZk8rz5Xs0+milQKysZKbQ24/aBO GCDX/svsf4vq0I2ji8cvW6xy9Xk859nLzs+BY5wDZs6AyeTOCHR3zWhEqu/xJ1yjKRzE eC5r87B+IeIY5r+cfPTMgB/jVkgQV47odpcpN2EHXwHvntuk54B3mMXl96Dk3HKorO3I V17w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=45ROWB4snMd0CsUAaw9H167sgjYYT7alYIUHH9UWHSI=; b=QSimgt/TOkG1RmhW8SNnP2dqmx/IYG/lvaoLYBTe7NCUWR0xdoHzWaD1RzTpKe2tJ5 2D2/c4/UIRevQXgode7nq1Sd72ofGxSYI2ycPgiIHSAPaYUtl0q3+RbQ4NqCIosaknpP zdsQpkZqyu6J76R6LPinDWQcJBF56ANTHH8cvwPClT8ETR05ZIkwtN6uek7jMh+REwVK huPo7GTutRiHZKEEwFsCyuPiAMDeR6LgsBLFote6UYjEZ9E26WEF5NOSfwxSOH6xo19T +2npmNW1foYpIFL8Ptn9dYyyEhMp2h5b7grcGKfbn20ex3bDy0CqrQF/WRTBz/5opU0z 4E2Q== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 23si3226800pgs.342.2019.02.14.18.12.38; Thu, 14 Feb 2019 18:12:54 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2502939AbfBNT66 (ORCPT + 99 others); Thu, 14 Feb 2019 14:58:58 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:60992 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728119AbfBNT65 (ORCPT ); Thu, 14 Feb 2019 14:58:57 -0500 Received: from akpm3.svl.corp.google.com (unknown [104.133.8.65]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id F1CFFB3E; Thu, 14 Feb 2019 19:58:56 +0000 (UTC) Date: Thu, 14 Feb 2019 11:58:55 -0800 From: Andrew Morton To: Johannes Weiner Cc: Peter Zijlstra , =?UTF-8?Q?=C5=81ukasz?= Siudut , linux-kernel@vger.kernel.org, kernel-team@fb.com Subject: Re: [PATCH] psi: avoid divide-by-zero crash inside virtual machines Message-Id: <20190214115855.76869aecd777fbd37d48f45c@linux-foundation.org> In-Reply-To: <20190214193157.15788-1-hannes@cmpxchg.org> References: <20190214193157.15788-1-hannes@cmpxchg.org> X-Mailer: Sylpheed 3.6.0 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 14 Feb 2019 14:31:57 -0500 Johannes Weiner wrote: > --- a/kernel/sched/psi.c > +++ b/kernel/sched/psi.c > @@ -322,7 +322,7 @@ static bool update_stats(struct psi_group *group) > expires = group->next_update; > if (now < expires) > goto out; > - if (now - expires > psi_period) > + if (now - expires >= psi_period) > missed_periods = div_u64(now - expires, psi_period); > > /* It seems appropriate to use time_after64() and friends in this code.