Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp1180613rdb; Fri, 20 Oct 2023 10:31:58 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHj+BAVcljkn84AiDrksE32AyX7IcUFXJKhFAwVbD24dBzY//Fuqo+Cm9tbVCOIiA1o5HYC X-Received: by 2002:a05:6e02:1547:b0:352:5ff6:5484 with SMTP id j7-20020a056e02154700b003525ff65484mr2952581ilu.28.1697823118001; Fri, 20 Oct 2023 10:31:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697823117; cv=none; d=google.com; s=arc-20160816; b=np+WWZQaRU+iNXnvTLGBAlsQHm/9Wp4TOe/rYJI+2RXRXhAHyt6NSknx6xZtyVNaU5 JdGuh7BSNFcBGBYBnwr6IQOEamtoV+Y0pcShelumlE7PVS9WBO9e1XPsTMZ1dN+0GlW3 5uM8Z3VMoPSd7pl6f4NlyMi5SJ+voBIsy92sbJ9zfjrfXbz4xs+dBq84ZUCzxGdeyyot LEGJ+Ul0hq1Y2mHCER/eh4pveyVQj+rdZkTI7+MjZvdddNWNtTqwjWL9+uTU4eBzdx1o a+MdCprf2Q7zihbnXS6ubCsIamZY81/H0kZsNisOZiJALWud7uNVyRLEtV/5VXwAUqCl 3Pgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=gwvaW3hsBR/7IbhnzI54lXvXXpGp8ZhSO23TYLxUMB0=; fh=xu5yaR9UFRW6Y1bSNQlkXp2Dc2AR8seUxAz6oIeQCro=; b=CIWLEGmToPNNmZpzHWpfIfIsa310k+M23gkmTWSWNOHeYvvw0u70xf1TutM06dQZWm XhUMLRiHcMQvM6oNY1MS+gfxr2gvNEKHfEAtU3Buy6N/7i3JaPrDUbUG12+8zNKKFWlV C0V6XvXdIBDwUSiFeZrogs1Wqvl0MWCZQZhINFK+iBmFYT3VAwji2wBXwNer5ZeWp72t l6x7ut1fr1WL4DVRPZ8lXhpsj5n8qdG5TwJsX11u1WcgLXXY5rM0xpHGzepZyzkj4N1a nUBGL8CG+cEC/O4YMkzepz+VjG+LRq9MLUgBqvSC3K9WxABuFD52uhNNIUwiL3n9jx8A Blmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=XIbOXKyk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id a190-20020a6390c7000000b005adba954597si2281225pge.504.2023.10.20.10.31.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 10:31:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=XIbOXKyk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id E23B48051907; Fri, 20 Oct 2023 10:30:46 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377713AbjJTRal (ORCPT + 99 others); Fri, 20 Oct 2023 13:30:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60818 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229997AbjJTRak (ORCPT ); Fri, 20 Oct 2023 13:30:40 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 12E59A3 for ; Fri, 20 Oct 2023 10:30:38 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 83D8BC433C7; Fri, 20 Oct 2023 17:30:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1697823037; bh=cJeCmKC38qm90zyfdcG4SUKfILLYa+5rU2Q+LCqJ8lM=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=XIbOXKykVs348OUb2DLZnFwaZAO6yQOODMlyMioGr7OgM6CvBy+LNZcvXM0I9N1U1 9N94CneC/tHv2yls/XwFziprrJXA1NQGwu7D3VG75vhzQMvmrGovs7eabtAjPKjT/x ncOf/qPcc1NjxqBFZynMjaCLtE3pn3839yr3DUfw= Date: Fri, 20 Oct 2023 10:30:36 -0700 From: Andrew Morton To: SeongJae Park Cc: damon@lists.linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org, acsjakub@amazon.de Subject: Re: [PATCH 0/5] avoid divide-by-zero due to max_nr_accesses overflow Message-Id: <20231020103036.027282d16aaf56498230cc12@linux-foundation.org> In-Reply-To: <20231020171901.63994-1-sj@kernel.org> References: <20231019194924.100347-1-sj@kernel.org> <20231020171901.63994-1-sj@kernel.org> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Fri, 20 Oct 2023 10:30:47 -0700 (PDT) On Fri, 20 Oct 2023 17:19:01 +0000 SeongJae Park wrote: > On Thu, 19 Oct 2023 19:49:19 +0000 SeongJae Park wrote: > > > The maximum nr_accesses of given DAMON context can be calculated by > > dividing the aggregation interval by the sampling interval. Some logics > > in DAMON uses the maximum nr_accesses as a divisor. Hence, the value > > shouldn't be zero. Such case is avoided since DAMON avoids setting the > > agregation interval as samller than the sampling interval. However, > > since nr_accesses is unsigned int while the intervals are unsigned long, > > the maximum nr_accesses could be zero while casting. > > Actually, the issue was reported by Jakub, and I didn't add 'Reported-by:' tags > for him. I sure Andrew could add that on his own, but I want to minimize > Andrew's load, so will send v2 of this patchset. Andrew, please let me know if > that doesn't help but only increasing your load. Editing the changelogs is far quicker than updating a patch series ;) btw, it's now conventional to add a link to the reporter's report. The new "Closes:" tag, immediately after the Reported-by:. But it's not a big deal.