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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3DC65C433EF for ; Wed, 23 Feb 2022 03:24:35 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 917A78D0002; Tue, 22 Feb 2022 22:24:34 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 8C7F98D0001; Tue, 22 Feb 2022 22:24:34 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7686C8D0002; Tue, 22 Feb 2022 22:24:34 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0134.hostedemail.com [216.40.44.134]) by kanga.kvack.org (Postfix) with ESMTP id 68B6D8D0001 for ; Tue, 22 Feb 2022 22:24:34 -0500 (EST) Received: from smtpin29.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 215CA9D27F for ; Wed, 23 Feb 2022 03:24:34 +0000 (UTC) X-FDA: 79172602068.29.3E95A69 Received: from mail-pf1-f176.google.com (mail-pf1-f176.google.com [209.85.210.176]) by imf04.hostedemail.com (Postfix) with ESMTP id B02FB40003 for ; Wed, 23 Feb 2022 03:24:33 +0000 (UTC) Received: by mail-pf1-f176.google.com with SMTP id z15so8304318pfe.7 for ; Tue, 22 Feb 2022 19:24:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=UBCffEif1jdF0yN7RTCvuEffHuLFPiypPx80tPtta4U=; b=mNTTSYB1a354+R9HJGidtEfr7ne1yp0eayHsfwMLZJDhOGJhc4VV+7fB55RYZIxjbP 6bRPDuJiP4RjCnPyPqtS4SEefRz6oZs46FS25aJDClb5yum2vH+cZ0RPaCTnp5VevHXr YGogeT6K4jMFFz7QFxy1ZEz/Ya/LnbdanwQNM5X6onIBXupCfYEN/bvNHO/ktGSoRCp+ kdCwYvDXcXxjm5pWP2P3m2HqihAUB57ENIH57nyXabRUPs4eHBbt8ioV7XDzWyZGrP8G uwnf9FULfuiE3TXZYu550wxcYMrdL3INEv3jusx9KZ75NFI7B+sbZQCqGmi+0sll/uRW XJiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=UBCffEif1jdF0yN7RTCvuEffHuLFPiypPx80tPtta4U=; b=O5+HQXCbXdsYdvzaIDD3SBU2wZDZEPUzqhrd2Avn6KKems9c1vCRhLTdWaRnBJ0dUW 2fSLeTMc3neEFXA44a3d7GvSl1tNUJYXxiBDWI3YNplzd9FXHKe5S3IW4orwYd1rVNMJ wysckcnMkHEsrl+bJi4xvo96Y3S8+UhhM0d+9jtdanwgYSUSTsQtIsLVpATmcFk0AAL6 AT5b/si1We5Wg+Bgce3vGPF7igVJWLs2kQ1ULfweFCmhjTeJpQNxLhwY2QcA1O14nl5P VZDD5DP7+PF8y1Io9XLMOeubHZQ0/CdAFZGHWHAJbMoFq2y+vzL7LjXFngPAbyVlfCqe b/Qg== X-Gm-Message-State: AOAM530fSUtMpXXLvVFjVfGTTGLN0Dchr53nf0OS+/WQTJxvhTAc3AmD LePz6JRRa4GeYy974evw/2M= X-Google-Smtp-Source: ABdhPJy02H/cvtT8Xyn+UrRfVn92L2YEnqS2a9gDo7C5tgl/TPssQnnupPpwy2mA8feNjw/UIlEk+w== X-Received: by 2002:a63:e817:0:b0:373:8abb:2c51 with SMTP id s23-20020a63e817000000b003738abb2c51mr22196666pgh.185.1645586672598; Tue, 22 Feb 2022 19:24:32 -0800 (PST) Received: from ip-172-31-19-208.ap-northeast-1.compute.internal (ec2-18-181-137-102.ap-northeast-1.compute.amazonaws.com. [18.181.137.102]) by smtp.gmail.com with ESMTPSA id w2sm18224124pfb.139.2022.02.22.19.24.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Feb 2022 19:24:32 -0800 (PST) Date: Wed, 23 Feb 2022 03:24:27 +0000 From: Hyeonggon Yoo <42.hyeyoo@gmail.com> To: Matthew Wilcox Cc: linux-mm@kvack.org, Roman Gushchin , Andrew Morton , Vlastimil Babka , linux-kernel@vger.kernel.org, Joonsoo Kim , David Rientjes , Christoph Lameter , Pekka Enberg Subject: Re: [PATCH 3/5] mm/slab: Do not call kmalloc_large() for unsupported size Message-ID: References: <20220221105336.522086-1-42.hyeyoo@gmail.com> <20220221105336.522086-4-42.hyeyoo@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: B02FB40003 X-Stat-Signature: rgfm34u4gjx13tiaqbpbgb56eatokf1o Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=mNTTSYB1; spf=pass (imf04.hostedemail.com: domain of 42.hyeyoo@gmail.com designates 209.85.210.176 as permitted sender) smtp.mailfrom=42.hyeyoo@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-HE-Tag: 1645586673-862657 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 Tue, Feb 22, 2022 at 07:59:08PM +0000, Matthew Wilcox wrote: > On Tue, Feb 22, 2022 at 08:10:32AM +0000, Hyeonggon Yoo wrote: > > On Mon, Feb 21, 2022 at 03:53:39PM +0000, Matthew Wilcox wrote: > > > On Mon, Feb 21, 2022 at 10:53:34AM +0000, Hyeonggon Yoo wrote: > > > > SLAB's kfree() does not support freeing an object that is allocated from > > > > kmalloc_large(). Fix this as SLAB do not pass requests larger than > > > > KMALLOC_MAX_CACHE_SIZE directly to page allocator. > > > > > > I was wondering if we wanted to go in the other direction and get rid of > > > kmalloc cache sizes larger than, say, 64kB from the SLAB allocator. > > > > Good point. > > > > Hmm.. I don't think SLAB is benefiting from queueing that large objects, > > and maximum size is still limited to what buddy allocator supports. > > > > I'll try reducing kmalloc caches up to order-1 page like SLUB. > > That would be easier to maintain. > > If you have time to investigate these kinds of things, I think SLUB would > benefit from caching order-2 and order-3 slabs as well. Maybe not so much > now that Mel included order-2 and order-3 caching in the page allocator. > But it'd be interesting to have numbers. That's interesting topic. But I think this is slightly different topic. AFAIK It's rare that a workload would benefit more from using slab for large size objects (8K, 16K, ... etc) than using page allocator. And yeah, caching high order slabs may affect the numbers even if page allocator caches high order pages. SLUB already caches them and SLUB can cache more slabs by tuning number of cpu partial slabs (s->cpu_partial_slabs) and number of node partial slabs. (s->min_partial) I need to investigate what actually Mel did and learn how it affects SLUB. So it will take some time. Thanks! -- Hyeonggon