Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1935232imm; Mon, 3 Sep 2018 13:30:07 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZ1c5TsGMySjGutBHaRxruCJJwZQWTe1QAz/R6hU1Cu1vv2HliyZIvs7PcW17qEiGfjTz2U X-Received: by 2002:a17:902:76c5:: with SMTP id j5-v6mr30258689plt.140.1536006607031; Mon, 03 Sep 2018 13:30:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536006606; cv=none; d=google.com; s=arc-20160816; b=RdgIw07jn/hU4sC97PBTeEgrBD6NZEWpYkTNGbgGB7e5nQK4a9bCYddFUrIGV4R12V YFbxnADU4TH+pYmpWbHAF+7LlnPGU46vZgtt9guLvd90SJyhsVl4HqgD4USr/0bCAdS/ IdkRATR+gMGSNfHDJJV4ysmj95zbeZRUI3TCUH+P1PRutEjau9Bi9JFajQk2EqVz2jh4 HbeQnZHS5h++fDWiSMenzV5htiGpQbLHalUIvuQbq5zDWpA4mq+tFsm/nMOBegV36c4f W/H7SJJ4O+qRdxIPqugL07RIqSYSUR/J6j767cZ8NcLhWpQAMxSciF1r3ksffeoeCDkz J7jA== 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=6dygtqcvd00lGS8uy3jtIVfxCe8tLNC1ILwcYL1QZS0=; b=j7ONBM4NkHZejQd2ss4/IBLdkk5BCebUunorH0MSZ+nlfNQ0uleIkW8ElzlH9hXsKN SVwcS7iQmHq8++hbIq5u1LJNieVKdq5RaTFWviOoZNka9wxGMcnxRP50kisOoe+cqCGN M1SqNltqDO+woJArqGcMjSvgihWjIX5be+/JNcGKbp3y1HAeQ/vxyIGU6ExSbvrASo+c kbERMDdIkJgXqVxglMtcifWxCbz2JXIka1abBZ7j/2jFBYV3cckH/WZu7HRumy5dS86W BtAqrfvxOyqImfmuc+WoaWhFqUBaAE4/hRlGCJR5YFv77xSYX91gI5PGsAu37+gZQDsO oBmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=DmJG+m9F; dkim=fail header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=foheQTHc; 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 b5-v6si20220439pfg.90.2018.09.03.13.29.51; Mon, 03 Sep 2018 13:30:06 -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=DmJG+m9F; dkim=fail header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=foheQTHc; 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 S1728024AbeIDAui (ORCPT + 99 others); Mon, 3 Sep 2018 20:50:38 -0400 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:57142 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727510AbeIDAui (ORCPT ); Mon, 3 Sep 2018 20:50:38 -0400 Received: from pps.filterd (m0109334.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w83KSKp6029550; Mon, 3 Sep 2018 13:28:38 -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=6dygtqcvd00lGS8uy3jtIVfxCe8tLNC1ILwcYL1QZS0=; b=DmJG+m9FF6iblSb/ji3URqVoXOlmEUIEiGMYB3J9N3EnRPwF1fGpotVlm7Im2rbg3x2A FdNnOovl2zB7AA/Y5ueuqZ2oCc3GY978zLPghIZpoTKvw3IMNo1/Jm2zBie7cJkB41eB INXdvEGolt3cfBYQp/2hfNe4emtLYIqYJss= Received: from maileast.thefacebook.com ([199.201.65.23]) by mx0a-00082601.pphosted.com with ESMTP id 2m9b5kg35m-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 03 Sep 2018 13:28:38 -0700 Received: from NAM04-CO1-obe.outbound.protection.outlook.com (192.168.183.28) by o365-in.thefacebook.com (192.168.177.23) with Microsoft SMTP Server (TLS) id 14.3.361.1; Mon, 3 Sep 2018 16:28:36 -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=6dygtqcvd00lGS8uy3jtIVfxCe8tLNC1ILwcYL1QZS0=; b=foheQTHcc8fBDB3rKtD81Lo+yixHCBKFFJhUDg6QTnUCmurE3tArBiziSfnm0mrB6vgLhWkWXgpDzHP9vgyzJ5dWs5M5XLg1XDvrhqYifTctwdjb4zB7UUUgrMeCe3XEJ7jkM2m80k33Lao/tlmQYAPwK0xo2x0YgRpWiSh52rY= Received: from castle.DHCP.thefacebook.com (2620:10d:c090:180::1:3759) by CY1PR15MB0171.namprd15.prod.outlook.com (2a01:111:e400:58bb::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1080.18; Mon, 3 Sep 2018 20:28:12 +0000 Date: Mon, 3 Sep 2018 13:28:06 -0700 From: Roman Gushchin To: Michal Hocko CC: Rik van Riel , , , , Josef Bacik , Johannes Weiner , Andrew Morton Subject: Re: [PATCH] mm: slowly shrink slabs with a relatively small number of objects Message-ID: <20180903202803.GA6227@castle.DHCP.thefacebook.com> References: <20180831203450.2536-1-guro@fb.com> <3b05579f964cca1d44551913f1a9ee79d96f198e.camel@surriel.com> <20180831213138.GA9159@tower.DHCP.thefacebook.com> <20180903182956.GE15074@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20180903182956.GE15074@dhcp22.suse.cz> User-Agent: Mutt/1.10.1 (2018-07-13) X-Originating-IP: [2620:10d:c090:180::1:3759] X-ClientProxiedBy: MWHPR10CA0057.namprd10.prod.outlook.com (2603:10b6:300:2c::19) To CY1PR15MB0171.namprd15.prod.outlook.com (2a01:111:e400:58bb::17) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 62c0b0a0-fa7b-426d-b625-08d611dbc596 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(2017052603328)(7153060)(7193020);SRVR:CY1PR15MB0171; X-Microsoft-Exchange-Diagnostics: 1;CY1PR15MB0171;3:++673PcgOTxi4rz7+nqemNpB8EnpPFJxGqcAWFYkN6+GuKiHSRmLPRnVJr7t3MPNfw93Bv5MMcfGBawyj22F7rKnchomoxiMTkj8MFPzClityDOzfpb/qQtGO4dNiNHQCSduZzwT6mSPZtCLS5am3aeos4HZUB7wHO51e8B6h/feTjRfVJb6k4ppJbu2HxX9iAlxX/YV2eVPvGtVqZFkJFH/J5ERFPtsGWGFRTf0PTafHNhmQDWxGxpiEaieJT31;25:x0p0r63gvEaWck1J/5c25cvdXfqTy8ScEPoJFwbcDlohtPN1twZ3wgY2SMuIkirjKG/oMAKyJC87nUmuO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31SU8LwCefJUq95izhypkazUrtMs8tuRDJ44Pq3oGEQD1wLkp4f7TDbtJ1i3g/zekzuua1YMp+heVfDRhOHFXJ7ij6JmwdY7vxrM5Axpo69j5i8oCqD04846kvfxvoge1f6zanOfPWBOEe7+LEBjk79NoupM98dMAsvm8wrODKn0lwnO89Zm0H7jeMRDU+pJq781idO5BvYUwKSSwRzRuA8KfM/tswYm51UJqxrvzoagc4rmwM8u+1NYSTb2w8rUEEGVmw/gM0wzLIPHYDA== 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)(93006095)(93001095)(10201501046)(3002001)(3231311)(11241501184)(944501410)(52105095)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123564045)(20161123560045)(20161123558120)(201708071742011)(7699016);SRVR:CY1PR15MB0171;BCL:0;PCL:0;RULEID:;SRVR:CY1PR15MB0171; X-Forefront-PRVS: 0784C803FD X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(396003)(366004)(376002)(346002)(39860400002)(136003)(199004)(189003)(54906003)(6916009)(6666003)(86362001)(5660300001)(47776003)(76176011)(7696005)(52396003)(52116002)(16586007)(478600001)(58126008)(316002)(50466002)(25786009)(97736004)(4326008)(6246003)(6116002)(23726003)(1076002)(16526019)(186003)(46003)(486006)(446003)(6506007)(11346002)(476003)(386003)(2906002)(106356001)(105586002)(93886005)(55016002)(8936002)(229853002)(8676002)(9686003)(33656002)(68736007)(305945005)(14444005)(81166006)(81156014)(7736002)(53936002)(18370500001)(42262002);DIR:OUT;SFP:1102;SCL:1;SRVR:CY1PR15MB0171;H:castle.DHCP.thefacebook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; Received-SPF: None (protection.outlook.com: fb.com does not designate permitted sender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HDOdh/61A= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Sep 2018 20:28:12.2556 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 62c0b0a0-fa7b-426d-b625-08d611dbc596 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ae927fe-1255-47a7-a2af-5f3a069daaa2 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR15MB0171 X-OriginatorOrg: fb.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-09-03_12:,, 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 Mon, Sep 03, 2018 at 08:29:56PM +0200, Michal Hocko wrote: > On Fri 31-08-18 14:31:41, Roman Gushchin wrote: > > On Fri, Aug 31, 2018 at 05:15:39PM -0400, Rik van Riel wrote: > > > On Fri, 2018-08-31 at 13:34 -0700, Roman Gushchin wrote: > > > > > > > diff --git a/mm/vmscan.c b/mm/vmscan.c > > > > index fa2c150ab7b9..c910cf6bf606 100644 > > > > --- a/mm/vmscan.c > > > > +++ b/mm/vmscan.c > > > > @@ -476,6 +476,10 @@ static unsigned long do_shrink_slab(struct > > > > shrink_control *shrinkctl, > > > > delta = freeable >> priority; > > > > delta *= 4; > > > > do_div(delta, shrinker->seeks); > > > > + > > > > + if (delta == 0 && freeable > 0) > > > > + delta = min(freeable, batch_size); > > > > + > > > > total_scan += delta; > > > > if (total_scan < 0) { > > > > pr_err("shrink_slab: %pF negative objects to delete > > > > nr=%ld\n", > > > > > > I agree that we need to shrink slabs with fewer than > > > 4096 objects, but do we want to put more pressure on > > > a slab the moment it drops below 4096 than we applied > > > when it had just over 4096 objects on it? > > > > > > With this patch, a slab with 5000 objects on it will > > > get 1 item scanned, while a slab with 4000 objects on > > > it will see shrinker->batch or SHRINK_BATCH objects > > > scanned every time. > > > > > > I don't know if this would cause any issues, just > > > something to ponder. > > > > Hm, fair enough. So, basically we can always do > > > > delta = max(delta, min(freeable, batch_size)); > > > > Does it look better? > > Why don't you use the same heuristic we use for the normal LRU raclaim? Because we do reparent kmem lru lists on offlining. Take a look at memcg_offline_kmem(). Thanks!