Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp689854imm; Wed, 22 Aug 2018 10:52:25 -0700 (PDT) X-Google-Smtp-Source: AA+uWPyEZrLTxektCZc5J/PK550nCP0oAjExLDvD3CK5GhNqd0hoQUyEg6uIqI4dMn4jkVjM3xqs X-Received: by 2002:a65:5a8e:: with SMTP id c14-v6mr12677746pgt.448.1534960345879; Wed, 22 Aug 2018 10:52:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534960345; cv=none; d=google.com; s=arc-20160816; b=rmrnM6k/7xDyNd2Jya0LDc80t/bgEiqpynaLT6to73NpDhMEPPxvEgje+AldBCFikm 49ipIhPN05k+vGezqAJfWy08RCnQ+x2G2eDI8p30GvmfkuLTf6Bl8+nZlg+ocoa3PijN I0hmfzjmcG9Dvde1jGyGZDzWCSy72zejy2ihCmYJurFyoM+luSDiZ899/k2Jzi5cC5lI rjQyr3JV+5l41YgbO88XxaIKuI9Kncqqa57fJ2OqjKgL85aNwRSVgpDSMGbx4QA1c0Pl LJJ3yBcDIbGsbHAenz1DgiNsW9OVStz8uAhpdnk/uaQmgV6tOsUVFh2eGJcihUr5MYIT WRNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature:dkim-signature:arc-authentication-results; bh=QY+0ukBZrpKSxB6ttQ7vYvacU22OMK+FW7kJfieRl/k=; b=UTDb+YyWUiuyfdE3X2oxLjVAlDqVBZbTts+egc/SaVqslhMbMsL9rsTOhCBKXzUixw MiseN8ojwBrAZeASMiDTlYhpPH+jySOGexlki0N897hx+h/sGDUY6FUleeJ4E4YF1eoN jpx9xXcuVS2itkhmfgoJnC5WSH7JnVIO/zHHaaH34z8rQOBXNYQId0jyyegMYmRgqJRt J0r00+rtRakPQC6yQhsonlrfazlirZano+jrWcsfO8LCsCV40EbM3RlINoVMh5HOwTjQ HkWTwh26AsLqU26aa8kdu4fsPdaHF+REDtrlQCGX28RVY7BjiFVbjqdlObcllt7REPBD h23A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=kREZeJKm; dkim=fail header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=Buari7k1; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=fb.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 81-v6si2186712pgd.57.2018.08.22.10.52.10; Wed, 22 Aug 2018 10:52:25 -0700 (PDT) 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=@fb.com header.s=facebook header.b=kREZeJKm; dkim=fail header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=Buari7k1; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=fb.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727642AbeHVVQs (ORCPT + 99 others); Wed, 22 Aug 2018 17:16:48 -0400 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:51984 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727466AbeHVVQr (ORCPT ); Wed, 22 Aug 2018 17:16:47 -0400 Received: from pps.filterd (m0044008.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w7MHmn3M006474; Wed, 22 Aug 2018 10:50:26 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=facebook; bh=QY+0ukBZrpKSxB6ttQ7vYvacU22OMK+FW7kJfieRl/k=; b=kREZeJKm4fYU8jJKaxe/raleksDiHmTJnUVNZm9FDhZU//SCzW2K76OSe0kFgf0Fp2ic /8atxfRcjHgzZlEUdBep/YMJOHH51Gz3SB1sBoSMIAxgcLBiwud1qwlrDFc7AB0HpOCA LfsowBLVmh1p8ucZFJOdCOmdGYBSvU3Sm0Q= Received: from maileast.thefacebook.com ([199.201.65.23]) by mx0a-00082601.pphosted.com with ESMTP id 2m1bm2ga0e-2 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 22 Aug 2018 10:50:26 -0700 Received: from NAM05-CO1-obe.outbound.protection.outlook.com (192.168.183.28) by o365-in.thefacebook.com (192.168.177.24) with Microsoft SMTP Server (TLS) id 14.3.361.1; Wed, 22 Aug 2018 13:50:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.onmicrosoft.com; s=selector1-fb-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QY+0ukBZrpKSxB6ttQ7vYvacU22OMK+FW7kJfieRl/k=; b=Buari7k1IS5Zqq4bgzLO2AhqYAeCM295lxb7FluTQXxr4qJUt0BchXygIS5sK4ah1Rw2jrMVR+NEWtseFPlivMMu1CPw3OYojBvfgTPRHxS4I90RISL2WnePXirQteazErX6Nf4Rf0+bXHlnZvi2fZ1eecuVEZSmFBH2WNq1ECI= Received: from castle (2620:10d:c090:180::1:cf4) by BY2PR15MB0166.namprd15.prod.outlook.com (2a01:111:e400:58e0::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1038.23; Wed, 22 Aug 2018 17:50:18 +0000 Date: Wed, 22 Aug 2018 10:50:12 -0700 From: Roman Gushchin To: Konstantin Khlebnikov CC: Johannes Weiner , Matthew Wilcox , , Linux Kernel Mailing List , , Andrew Morton , Michal Hocko , Tejun Heo , Rik van Riel Subject: Re: [PATCH RFC] mm: don't miss the last page because of round-off error Message-ID: <20180822175009.GA7807@castle> References: <20180817231834.15959-1-guro@fb.com> <20180818012213.GA14115@bombadil.infradead.org> <20180821171555.GA16545@cmpxchg.org> 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) X-Originating-IP: [2620:10d:c090:180::1:cf4] X-ClientProxiedBy: MWHPR22CA0045.namprd22.prod.outlook.com (2603:10b6:300:69::31) To BY2PR15MB0166.namprd15.prod.outlook.com (2a01:111:e400:58e0::12) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: dc8863de-56f2-4c18-fd2b-08d60857b9bf X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(2017052603328)(7153060)(7193020);SRVR:BY2PR15MB0166; X-Microsoft-Exchange-Diagnostics: 1;BY2PR15MB0166;3:GJQRaFL0qO0kokNAK3BGTMyRknbc7REqXC9FDFew4t024wFPunh7Du8IQ9AA0GyFtPJPlUfRU2vZS+7zhxDxJDRGAsCtpzmXJqoeaJdY5F/5JQJU/Z67MDFLyUurfaJeJgdzS4i0DpzIJUBertLcZ3l9D38odt24KAsB49kx9ZYv4e0zrBHnlMKrS0nSvMQ6ijTl5iD7MD3F3Dqu3PvBNUMEgYGiX/3FE94KKYbwTL82oDyv/6/kFy7rJ2Fec5MA;25:zEQKytjN6uap0cG23KSLnlujvuR2+ElupDULUUYX9X2vzwMQkFIgqJARd2CMlSpOzG4MQGVT9iknjm/ouCV98cRrvuKUZnl4QfRb3zO6abUwNCg6N9ZnCMW/ipeyJG2OhWT5nkTheW14vCfBO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EF4cLCCLx/+nazP13Zv6/+KYzX2bdWqWEV81uqu3OJ4afaANh1Kzfn9Qq+gP+a2PkASv7yvjyDnk9C95oJCanZ0W6QfvaMxy/fq+Up95EnvHw9qvy9YVIg2o2thECbtvXeh+peih84TtUtXpxMJfR3rBi1AeCxQSd5QSftvyFyzv2dNRA2xsoDcvxh95vp7qtC6lFhYiPoWJJ2nmBCOyp8qMAtLBSjZUQ== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(823301075)(10201501046)(3231311)(11241501184)(944501410)(52105095)(93006095)(93001095)(3002001)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123562045)(20161123558120)(20161123560045)(201708071742011)(7699016);SRVR:BY2PR15MB0166;BCL:0;PCL:0;RULEID:;SRVR:BY2PR15MB0166; X-Forefront-PRVS: 0772E5DAD5 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(396003)(366004)(346002)(136003)(376002)(39860400002)(189003)(199004)(229853002)(106356001)(446003)(50466002)(11346002)(6916009)(54906003)(105586002)(47776003)(33896004)(6496006)(81156014)(58126008)(81166006)(6666003)(9686003)(7736002)(93886005)(16586007)(5660300001)(316002)(52396003)(76176011)(55016002)(305945005)(52116002)(8676002)(25786009)(46003)(6116002)(6246003)(4326008)(2906002)(53936002)(39060400002)(1411001)(1076002)(478600001)(97736004)(53546011)(23726003)(386003)(33716001)(186003)(16526019)(33656002)(486006)(86362001)(476003)(68736007)(8936002)(18370500001)(32033001)(42262002);DIR:OUT;SFP:1102;SCL:1;SRVR:BY2PR15MB0166;H:castle;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; Received-SPF: None (protection.outlook.com: fb.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?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EMt+1rnEs/KQ/omLfwyMSCf5aKDiwiv4a7753ZdLx0wQ2YRNlA6xJcGA9Ur6Kg++N9upzGxVZM/pyNfFqb5ufpaZ0kRE= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Aug 2018 17:50:18.2298 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: dc8863de-56f2-4c18-fd2b-08d60857b9bf X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ae927fe-1255-47a7-a2af-5f3a069daaa2 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR15MB0166 X-OriginatorOrg: fb.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-08-22_09:,, signatures=0 X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 22, 2018 at 09:01:19AM +0300, Konstantin Khlebnikov wrote: > On Tue, Aug 21, 2018 at 8:15 PM, Johannes Weiner wrote: > > On Tue, Aug 21, 2018 at 08:11:44AM +0300, Konstantin Khlebnikov wrote: > >> On Sat, Aug 18, 2018 at 4:22 AM, Matthew Wilcox wrote: > >> > On Fri, Aug 17, 2018 at 04:18:34PM -0700, Roman Gushchin wrote: > >> >> - scan = div64_u64(scan * fraction[file], > >> >> - denominator); > >> >> + if (scan > 1) > >> >> + scan = div64_u64(scan * fraction[file], > >> >> + denominator); > >> > > >> > Wouldn't we be better off doing a div_round_up? ie: > >> > > >> > scan = div64_u64(scan * fraction[file] + denominator - 1, denominator); > >> > > >> > although i'd rather hide that in a new macro in math64.h than opencode it > >> > here. > >> > >> All numbers here should be up to nr_pages * 200 and fit into unsigned long. > >> I see no reason for u64. If they overflow then u64 wouldn't help either. > > > > It is nr_pages * 200 * recent_scanned, where recent_scanned can be up > > to four times of what's on the LRUs. That can overflow a u32 with even > > small amounts of memory. > > Ah, this thing is inverted because it aims to proportional reactivation rate > rather than the proportional pressure to reclaimable pages. > That's not obvious. I suppose this should be in comment above it. > > Well, at least denominator should fit into unsigned long. So full > 64/64 division is redundant. In any case it's not related to the original issue and should be treated separately. I'd like to keep the patch simple to make backporting to stable easy. All refactorings can be done separately, if necessarily. Thanks!