Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp2219494ybx; Fri, 8 Nov 2019 01:34:40 -0800 (PST) X-Google-Smtp-Source: APXvYqzMDm4Odjzks5B2BWRM6eu3KDlC+PjaVe5YfCwiPb/93SQ8M29HkcKOgV+I8Zs0XTRa21av X-Received: by 2002:a50:8871:: with SMTP id c46mr9103462edc.24.1573205680347; Fri, 08 Nov 2019 01:34:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573205680; cv=none; d=google.com; s=arc-20160816; b=QLvaBxxwpONlctSQg1pYhxA92FUlgqgfmoHYHZLJceUdrjDJhAoz/8qDXTHU0Ykhv1 V/4M0j/zZa5HC6c0jQaUVtSBJk0xLEbKPUMZ1FHIBrEwrFJtGdZNiNTZKvsdXPtj7jYp 2JnyD8HUXfOW6YGXAl5+gDYrXEX9hcq+ap5hT5pGnvUVUbpOVYkTRd2NJAzsk6JKFcJh jajX5EcKn4NsyD9/cJUl9GOBKgIvylFIld30kiEkp5Xvb52evlvW1gPdvuP9zFftQf4I akDzKLRmgzsvERRkAXe5oWZS7CobznFGG3KwWB6642LVamaF73UKxZ5z/v3ce2vkbUMX 3+IA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=mmNnULM/VKjYavmcObobx5Rd93KoR1x/7NkcWKtN1+Q=; b=vpDD13ZwlaG/N4jNU5NXQo8zk+iw3RIkNwg3f4+zlppQWq7YoCoCXi8toYqFonI7QO 1tSwb1n4hWXEyA9kQ4BEbRBeCPgbbSTKl0Y6hci5jw3FbOvFxa8OfAItA5B54WA6s6B8 7Fqfl0Fd9SZUuuas1ci0w730CkjXUtdMM3ePhBnrU0DkLv8UyCb/cJdw+ATcMK3slf4o uRtSjaamZPgsab37Zn+Rh1nx49xlMOdmq51SxfYHzYhYPWhq9vDoV2M6W1DwNQNseIKT B2lFbu62yr8OyhTkaA20mkcU4kS4VoAhIuLRIX9jmX3QFEC3m9HFdJ24l8FAsqnzHBJT 6bWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=O84mdoRO; 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 b15si3497617ejd.66.2019.11.08.01.34.17; Fri, 08 Nov 2019 01:34:40 -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; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=O84mdoRO; 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 S1730690AbfKHJbn (ORCPT + 99 others); Fri, 8 Nov 2019 04:31:43 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:33128 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729873AbfKHJbn (ORCPT ); Fri, 8 Nov 2019 04:31:43 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=mmNnULM/VKjYavmcObobx5Rd93KoR1x/7NkcWKtN1+Q=; b=O84mdoRO2yNi9tsZBrBodcX/E 5E6ZDTyfmxhjwCMaOtvdi7eVL6nxVo1Vp3n1GDN1wcodPVMDAiGcI3RrRfZZPVALovO7AIeileEyM vm4d2KnKmPxLcLntBWldGGcFygj2lSnLIBhCZoz0vd2r7vafR3xcvApdGB+pt9RrYIFE4jSy1be03 msmvyZo5AoBNNcDNljebfvRPWa/CKJ9nqoJqtZQFMr8S/ePgYqkJAUxRR6ugOQz0dhtaxtnM2G2HA eC3I+m5SUMy0YsNdf79D5WITW7wDa6RSuoPRhliCB7A5JpCuzKVcAZFS2uY9AlNSK8fUHHsNloW6A sDoPV4Xng==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1iT0cF-00018T-KV; Fri, 08 Nov 2019 09:31:39 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 67F77301A79; Fri, 8 Nov 2019 10:30:31 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 136362022B9E1; Fri, 8 Nov 2019 10:31:36 +0100 (CET) Date: Fri, 8 Nov 2019 10:31:36 +0100 From: Peter Zijlstra To: tim Cc: Johannes Weiner , Ingo Molnar , linux-kernel@vger.kernel.org Subject: Re: [PATCH] psi:fix divide by zero in psi_update_stats Message-ID: <20191108093136.GI4114@hirez.programming.kicks-ass.net> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 08, 2019 at 03:33:24PM +0800, tim wrote: > In psi_update_stats, it is possible that period has value like > 0xXXXXXXXX00000000 where the lower 32 bit is 0, then it calls div_u64 which How can this happen? Is that a valid case or should we be avoiding that?