From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5937DC2D0DC for ; Wed, 1 Jan 2020 12:39:53 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id DD2DB207E0 for ; Wed, 1 Jan 2020 12:39:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lca.pw header.i=@lca.pw header.b="MBAr9OiA" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DD2DB207E0 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lca.pw Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 4AD758E0005; Wed, 1 Jan 2020 07:39:52 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 45E9E8E0003; Wed, 1 Jan 2020 07:39:52 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 372F78E0005; Wed, 1 Jan 2020 07:39:52 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 213258E0003 for ; Wed, 1 Jan 2020 07:39:52 -0500 (EST) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with SMTP id C18FC2464 for ; Wed, 1 Jan 2020 12:39:51 +0000 (UTC) X-FDA: 76329022182.26.rings49_38f4eb03eae27 X-HE-Tag: rings49_38f4eb03eae27 X-Filterd-Recvd-Size: 3786 Received: from mail-qt1-f196.google.com (mail-qt1-f196.google.com [209.85.160.196]) by imf29.hostedemail.com (Postfix) with ESMTP for ; Wed, 1 Jan 2020 12:39:51 +0000 (UTC) Received: by mail-qt1-f196.google.com with SMTP id k40so33046690qtk.8 for ; Wed, 01 Jan 2020 04:39:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lca.pw; s=google; h=content-transfer-encoding:from:mime-version:subject:date:message-id :references:cc:in-reply-to:to; bh=lehY55HnmGjob5YTh+ueyZ17bKWs+x0lyOf/a3H/Zbo=; b=MBAr9OiA00CirtzB/rXduoQ+LTmCHO21SGuhPmyhNXmBKZRAwoarCM8U8AyDG768dv aLkAU7irfu7kwYKUUsrmq8L8CUoX/siShgSoaFgb6Q4pbSInSsl0mMIIWireX2gXZRt/ 2tpEd9n7GrqnS0otFrPaVTHcsBt9yWKG4cmJA7WM26vNCysUYl5tqU+Kjagu1/duCbFO CvFnh4N61vzwY5JGLFndN4J6ey5bvJBk2j/O0iyNg7fMO1zkIlt2OvS3d3VVy2hD5Nf4 FYkwHt8iOoN9QAqvUiwdGtPR0lPoE3P+49U2PyHgzvaDQ0y4BE0RyuCRVM7pIb9l+vzQ rx2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:content-transfer-encoding:from:mime-version :subject:date:message-id:references:cc:in-reply-to:to; bh=lehY55HnmGjob5YTh+ueyZ17bKWs+x0lyOf/a3H/Zbo=; b=G/Oi7H+3rJfUx5onwMB4J0X0PwqTV30UY8pT7wDmfw3gHi3eOB725CdJ/hCWO7uW1V 3hbo7wb9A0rChgj8ujHReT2T+6LzVqa957nYJOUWLcT/rX/4Jos49ZWMjC5Z9J8Ktrri 69Y4PpBv7ejvEFMFKbSUmOkceoFkds89D8ZxRtsOjmgf9AknEVZhkeMW4okJgCdw9DcC Kocke7ciz+5amNmaaTbOV9gSunl+0tsadZVNhIfmiqLc7nqmRQNfWW1OBZhVBJZdZuI6 KKxTd6c9qzaDgyJYjlYgF4mnN+XBDAG2pogyfuMEsBHJRPL6QQE5ZZTw9JqP0/fdJauU mH+A== X-Gm-Message-State: APjAAAXmqjSZblW9CEaFP8O+U5BxabZJMnpjfqB3G6wtTcUt1ZaSQc6i B9s487w2BKcPicnJODKZzQbmIOC8dX8= X-Google-Smtp-Source: APXvYqwfj7kTxSQhfTUAzZmSgfyN5zYmGVrw0C7eBGO38V5x/6PCPqU/3BcYGf0Fv0G2KBeN3GF1RA== X-Received: by 2002:ac8:a83:: with SMTP id d3mr57281858qti.228.1577882390594; Wed, 01 Jan 2020 04:39:50 -0800 (PST) Received: from [192.168.1.183] (pool-71-184-117-43.bstnma.fios.verizon.net. [71.184.117.43]) by smtp.gmail.com with ESMTPSA id i6sm14223218qkk.7.2020.01.01.04.39.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 01 Jan 2020 04:39:50 -0800 (PST) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable From: Qian Cai Mime-Version: 1.0 (1.0) Subject: Re: [PATCH] mm/page-writeback.c: avoid potential division by zero Date: Wed, 1 Jan 2020 07:39:48 -0500 Message-Id: <230E8A87-2900-427B-9EA3-CC48B4DCA5FC@lca.pw> References: <20200101093204.3592-1-wenyang@linux.alibaba.com> Cc: Andrew Morton , xlpang@linux.alibaba.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org In-Reply-To: <20200101093204.3592-1-wenyang@linux.alibaba.com> To: Wen Yang X-Mailer: iPhone Mail (17C54) X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: > On Jan 1, 2020, at 4:32 AM, Wen Yang wrote: >=20 > The variables 'min', 'max' and 'bw' are unsigned long and > do_div truncates them to 32 bits, which means it can test > non-zero and be truncated to zero for division. > Fix this issue by using div64_ul() instead. How did you find out the issue? If it is caught by compilers, can you paste t= he original warnings? Also, can you figure out which commit introduced the i= ssue in the first place, so it could be backported to stable if needed? >=20 > For the two variables 'numerator' and 'denominator', > though they are declared as long, they should actually be > unsigned long (according to the implementation of > the fprop_fraction_percpu() function).