Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp16405125ybl; Wed, 1 Jan 2020 04:43:11 -0800 (PST) X-Google-Smtp-Source: APXvYqyW+bbWGk1H+urhVhwyRA++sGDxwQrIEILwgxl9OReqE0zNEZ7DC473FeCQG7v6C+QZhQUm X-Received: by 2002:a05:6830:109a:: with SMTP id y26mr81947878oto.227.1577882591418; Wed, 01 Jan 2020 04:43:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577882591; cv=none; d=google.com; s=arc-20160816; b=Dsd8s9qHLHSH98gkEMxKoCReTb/Di3MeiRP+O/53BZnZaSi9uap4cRtUF+qMFclW6e 0QF+GYjyliKo/Z6So2mMk0UewqMadp0vBW6c/HPJX+32O+WJ7bF6OJJ2VeyXCvsobHvX nqiq+u1VgwCr4vdrixyCo+GoSX8+telOaK0udA8GxESpVFx8WWp9wDUiJ0WrdlqCP29p mPUW760nvv+IgM/8CpLoT0AXk3Jv3Z8ced7meLJQeckccIHHr6/Yal/hpQSwJyZGh/Gu XlbLZSlPljmulVC83MJID+/J+ZD9nytZG0ElZImA6Egw8XzsAKJy08tTKFbad139NXsP ehJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:in-reply-to:cc:references:message-id :date:subject:mime-version:from:content-transfer-encoding :dkim-signature; bh=lehY55HnmGjob5YTh+ueyZ17bKWs+x0lyOf/a3H/Zbo=; b=biDDTNzo+/hijlmupo4CWbcSOC1CM9CRlG+fwsFMyCV9iskxdjWJ4zwPgtAe0l5H3s QbtbLW6i6Wyw9iKOimMqWWljnOmYix6y+8YrgDIZ3a9By5ZeaznVfbEIszxVDGE0pVhM kD+Q80yZBm7Nc1gXLbarADpxW+0M/X26UljQdBguVEnQNh3cyLLUENG1gZcM6iB6+7g8 doEs9psBMbwguKsIaC8wvStxufD19gedXJc3WWj9MXcgKwjKRn8PMK+lyWBXvFPn4R73 lFFBn40QB1ooq8cWSzb0Xy3IqkOdg5h+CrG8DAhgYetNp2bXeuylRfJbEoZ6dLZQgZtb NyOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lca.pw header.s=google header.b=MBAr9OiA; 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 n137si24856825oig.127.2020.01.01.04.42.59; Wed, 01 Jan 2020 04:43:11 -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=pass header.i=@lca.pw header.s=google header.b=MBAr9OiA; 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 S1726484AbgAAMjv (ORCPT + 99 others); Wed, 1 Jan 2020 07:39:51 -0500 Received: from mail-qt1-f194.google.com ([209.85.160.194]:37147 "EHLO mail-qt1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725809AbgAAMjv (ORCPT ); Wed, 1 Jan 2020 07:39:51 -0500 Received: by mail-qt1-f194.google.com with SMTP id w47so33075262qtk.4 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=K/8fJMZ+M9qdeYMN04ldxR557b7K/uUK4FraWRsrQKvkLjOPd/hkNfpOAs4wJ/qJJ+ HAZgZ7eeVjaXbL6VPdlP4Q6VXRBI0kyNmMdKzWYka84Pvmk4/V/nPMogwES4NVfKCx/M zgnqNr9fXwZsx7oe/GKXHnRJ34A9IhYK6RN2/TLKIg8x755xwQXpzXvbMG7/DtD3puQh yO07QcrRCNOYCDTQqdfpQwn6dooW4Hil7jz7Lo+mXKVAhB/xj3x9lMazTUev5qyBo4hb 50xLNTQVo4VdEIvCqhvbe8XxMU4PfRnkgjW1SRBMVJXzrVVD4yDxvhc55grHyw2lL68A mR+A== X-Gm-Message-State: APjAAAWoDDtUiqjxIQryqtXCl9BHXHyBY/1wvDRen2gI73YvE4l8PAxT 2tVq2u/+HVh4S93rVVw1cyRXKUwjYOc= 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) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > 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).