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=-10.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham 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 19328C5519F for ; Wed, 18 Nov 2020 19:35:02 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 3E0C3246AA for ; Wed, 18 Nov 2020 19:35:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=fb.com header.i=@fb.com header.b="G/XuTtEW"; dkim=pass (1024-bit key) header.d=fb.onmicrosoft.com header.i=@fb.onmicrosoft.com header.b="UCktqpOL" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3E0C3246AA Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=fb.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 7B71D6B0036; Wed, 18 Nov 2020 14:35:00 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 767126B005C; Wed, 18 Nov 2020 14:35:00 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 606F46B005D; Wed, 18 Nov 2020 14:35:00 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 2D6546B0036 for ; Wed, 18 Nov 2020 14:35:00 -0500 (EST) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id B51DE363D for ; Wed, 18 Nov 2020 19:34:59 +0000 (UTC) X-FDA: 77498541918.01.rail35_2b0886f2733c Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin01.hostedemail.com (Postfix) with ESMTP id 8F9A61004ED8B for ; Wed, 18 Nov 2020 19:34:59 +0000 (UTC) X-HE-Tag: rail35_2b0886f2733c X-Filterd-Recvd-Size: 9898 Received: from mx0a-00082601.pphosted.com (mx0b-00082601.pphosted.com [67.231.153.30]) by imf33.hostedemail.com (Postfix) with ESMTP for ; Wed, 18 Nov 2020 19:34:58 +0000 (UTC) Received: from pps.filterd (m0089730.ppops.net [127.0.0.1]) by m0089730.ppops.net (8.16.0.42/8.16.0.42) with SMTP id 0AIJU1PK030309; Wed, 18 Nov 2020 11:34:55 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=date : from : to : cc : subject : message-id : references : content-type : in-reply-to : mime-version; s=facebook; bh=FUYJPzMbl2eKUzC7jzaqSI3PwmjCsTtweno9JRQx9NE=; b=G/XuTtEWxRc+HI507/nSIWkbq8HRksWwL1aPkqeogjbQ5vXnDzN374W/8ZeYuBPOTVE+ 1udMKLjfeyv4Dm2Bae8HnUq4SaSg5G0/EEYUl70dx+EhW5dkhtst8n04YmjAY4dalBUY Sz23JQfkiWs9+jvCgbTCcBLF75LDrGTX0yQ= Received: from mail.thefacebook.com ([163.114.132.120]) by m0089730.ppops.net with ESMTP id 34vb0atyrj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Wed, 18 Nov 2020 11:34:55 -0800 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (100.104.98.9) by o365-in.thefacebook.com (100.104.94.228) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Wed, 18 Nov 2020 11:34:54 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oBU3dNv2dhna40NsmJjpn2/Uu25/STy+E34GVbsx1NL4hsaZwC8Xwwb9Q3CIV/lLyBLPRVJwEwcYTr3h2wIHh2T6eVsN12oeYsKc0EYgvgx5zaJqvrrPtLuFZmKB+5zELZWk1vSs5Zw060rSmXyA98T0S3DDhDtGrmG4UIU6GNx+T3KkC4K0QMeRMk5D7xV+vghoiXfwhZJ7kD6lhyDFnNQOKx5y36KyzaGs3dDdDPz7Rkok0tn5i4tV8TcmMjKG0cvMsCrcptCYcx7cwC9/fsoqEiLGrmXctIcxHahBrfZwQjXzFnYYrdaiGjDBwK1dp3oBwnMjC1ZzJSBrSmSV0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=FUYJPzMbl2eKUzC7jzaqSI3PwmjCsTtweno9JRQx9NE=; b=lQLT4aMXpiRL4anxe1E6sgeFoYVgOpr/KXuTynflPvU7AxLib3EIgxA9X2Sb6CWXP5cOLbBmrbXdWS0rkCzdJK3ZNswgwd4Usat7VL3txlAXwT1I0A9LXnaJI+r5EWSWXk+Y/HNWIYpgSOihzWPbQHocGIDNQ2ch2u8jyFDr9SAohOWDmhRArc2kW5o5CwFTWrnzfDHvSz0l0YYBAMn4VaaCcNa0LMJbX+1SmopEdlYb7FYBKFy2ZUod0dCVpdMFUYNBAXKl9kdFLysgY0vhTuRCill7CouTyOtY4qwjZ3xzrnHanM2z9aA0/2n7/VJzewTSa6FRAjLFi9KFkxo3Nw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=fb.com; dmarc=pass action=none header.from=fb.com; dkim=pass header.d=fb.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.onmicrosoft.com; s=selector2-fb-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=FUYJPzMbl2eKUzC7jzaqSI3PwmjCsTtweno9JRQx9NE=; b=UCktqpOLTtNB+G7rvwl38CGdkAfRM9yyvqSClnNgwqW6jF5enswabW+uK07ooZBbFj79cMAkevdbbAMDaoqoo6u7JgfBjbSvNYK9n4TY6ztJyRLfb8q5EPojFhpFCuofgNdj4UoAX4tpHoaNgEnyAeJSsKbwDavtHjK+YAGDAwQ= Authentication-Results: suse.cz; dkim=none (message not signed) header.d=none;suse.cz; dmarc=none action=none header.from=fb.com; Received: from BYAPR15MB4136.namprd15.prod.outlook.com (2603:10b6:a03:96::24) by BYAPR15MB2277.namprd15.prod.outlook.com (2603:10b6:a02:92::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3564.28; Wed, 18 Nov 2020 19:34:52 +0000 Received: from BYAPR15MB4136.namprd15.prod.outlook.com ([fe80::3925:e1f9:4c6a:9396]) by BYAPR15MB4136.namprd15.prod.outlook.com ([fe80::3925:e1f9:4c6a:9396%7]) with mapi id 15.20.3589.021; Wed, 18 Nov 2020 19:34:52 +0000 Date: Wed, 18 Nov 2020 11:34:46 -0800 From: Roman Gushchin To: Vlastimil Babka CC: Bharata B Rao , , , , , , , , , Subject: Re: [RFC PATCH v0] mm/slub: Let number of online CPUs determine the slub page order Message-ID: <20201118193446.GC186396@carbon.dhcp.thefacebook.com> References: <20201118082759.1413056-1-bharata@linux.ibm.com> <9e1a2e2b-1b3c-9587-9b74-8ed8300fcb98@suse.cz> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9e1a2e2b-1b3c-9587-9b74-8ed8300fcb98@suse.cz> X-Originating-IP: [2620:10d:c090:400::5:508d] X-ClientProxiedBy: MWHPR22CA0011.namprd22.prod.outlook.com (2603:10b6:300:ef::21) To BYAPR15MB4136.namprd15.prod.outlook.com (2603:10b6:a03:96::24) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from carbon.dhcp.thefacebook.com (2620:10d:c090:400::5:508d) by MWHPR22CA0011.namprd22.prod.outlook.com (2603:10b6:300:ef::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3589.20 via Frontend Transport; Wed, 18 Nov 2020 19:34:50 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f9c8bdb5-1f3a-4d62-534b-08d88bf904e6 X-MS-TrafficTypeDiagnostic: BYAPR15MB2277: X-Microsoft-Antispam-PRVS: X-FB-Source: Internal X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: PWbeVQLSQXQzTCzJCENonMfnA34C1vMjnJljlFVMHJc4Zhsk6Y0xaIVHNl945B825DhocgRcho+UsEuF1orSwrMjYZchBOJeF3OQ/I3LMPigQpmvI7F8eO0BS0KIBB1A0/V6rU/unQaM0tI/Dn1UL3F3Vrk0hpnWe6sXqm6hzRwrnBSHf+SQxOb6N78dwWB8PIIh2m7V11/zQab7HEHP5ASWOEEvkmFSz6tanmxt/5lMLRkWANIeOWFUMkt4t+VJtwu3U+K9Bsf2bc54KJVg9zRqOdNQraVMdn5zid3lppKxTL48h0hPEwZ5Y3MALDsVrs5trUKZ6mcBnCWmB+wADA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR15MB4136.namprd15.prod.outlook.com;PTR:;CAT:NONE;SFS:(136003)(366004)(39860400002)(396003)(376002)(346002)(478600001)(66946007)(2906002)(33656002)(8936002)(52116002)(8676002)(53546011)(6666004)(316002)(186003)(16526019)(6506007)(83380400001)(66476007)(7696005)(86362001)(4326008)(5660300002)(66556008)(55016002)(6916009)(7416002)(9686003)(1076003);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData: pVCkQTwcY6jYfcv1jcK9CT77WT6W+hOqxb08PoOJXVyagzGVBsD2N12ypGDl4+f4gF/91uJzOriPf54nhCp11ZlvxqtLKVFCF4JJsfQ2b+A21jNH+CWL2N5jDtEJq6KnTsk84IEP8Tjp4w3ULG00trc7t6Aalc6lNbUZEmVVd1GDgD9FzY27XIWaGYauYSuAnqlti8h98YAgxd8xDOl16ya7xv+yH6GDF85CEHJHvuWHOUPo7A+/0/tlEX7kzYJu3TjTG/5HJK+WjWWwnAzpvMMmq68NPYZvAe5BK5/3cm5q/h5NE04A0pYeh1cFmhwMHk8Nb+w9MrLzavR0aSX8ubDG2EAUttnCmmUu7+68B4xriUor3cFpJ4HS2zf/ofBtgX/562BxAwEviTzYTesvMB+nr/qp7BUG/+8Hz2RqVA4IzlRstjkuo0U6/4gI34MK5vsehbAWNH4Pdy8RyE/8hgpooCWRwTisSOXbx5euQrD1TIx3HSuKbkQt83GIgMbWgQ32Qo8NSuAew8+3ckklrUFOi8SfRLR7bAdVdmrdbJZOFigig8UvHnQ8t6b9/58qmHPre37QQJlvHUQkzl/pz0+l5IWPs3lyf9kfhcTIyndn/EPjXwslblyEyeTZ6YJ1mbkxGl0CleGaBUO+ypaLG1ra+ZCWN2qA9YHMBx+caqw= X-MS-Exchange-CrossTenant-Network-Message-Id: f9c8bdb5-1f3a-4d62-534b-08d88bf904e6 X-MS-Exchange-CrossTenant-AuthSource: BYAPR15MB4136.namprd15.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Nov 2020 19:34:52.0954 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ae927fe-1255-47a7-a2af-5f3a069daaa2 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: gzDLtOcuMQnZjTz0eYLNqjmQDZ76ZsrOMiDZ0U7Nco/lxz4/j3k0flG1i2APw07Q X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR15MB2277 X-OriginatorOrg: fb.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.312,18.0.737 definitions=2020-11-18_06:2020-11-17,2020-11-18 signatures=0 X-Proofpoint-Spam-Details: rule=fb_default_notspam policy=fb_default score=0 clxscore=1015 malwarescore=0 priorityscore=1501 suspectscore=1 spamscore=0 impostorscore=0 adultscore=0 phishscore=0 lowpriorityscore=0 mlxlogscore=996 mlxscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2011180135 X-FB-Internal: deliver 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 Wed, Nov 18, 2020 at 12:25:38PM +0100, Vlastimil Babka wrote: > On 11/18/20 9:27 AM, Bharata B Rao wrote: > > The page order of the slab that gets chosen for a given slab > > cache depends on the number of objects that can be fit in the > > slab while meeting other requirements. We start with a value > > of minimum objects based on nr_cpu_ids that is driven by > > possible number of CPUs and hence could be higher than the > > actual number of CPUs present in the system. This leads to > > calculate_order() chosing a page order that is on the higher > > side leading to increased slab memory consumption on systems > > that have bigger page sizes. > > > > Hence rely on the number of online CPUs when determining the > > mininum objects, thereby increasing the chances of chosing > > a lower conservative page order for the slab. > > > > Signed-off-by: Bharata B Rao > > Acked-by: Vlastimil Babka > > Ideally, we would react to hotplug events and update existing caches > accordingly. But for that, recalculation of order for existing caches would > have to be made safe, while not affecting hot paths. We have removed the > sysfs interface with 32a6f409b693 ("mm, slub: remove runtime allocation > order changes") as it didn't seem easy and worth the trouble. > > In case somebody wants to start with a large order right from the boot > because they know they will hotplug lots of cpus later, they can use > slub_min_objects= boot param to override this heuristic. So in case this > change regresses somebody's performance, there's a way around it and thus > the risk is low IMHO. I agree. For the absolute majority of users there will be no difference. And there is a good workaround for the rest. Acked-by: Roman Gushchin