Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp2448820imn; Tue, 2 Aug 2022 03:18:12 -0700 (PDT) X-Google-Smtp-Source: AA6agR52QxLcmNwU4elsh+WsRgVJYWFyw3qB+0EpehZJHLL6C5HphYIV87PIRP3E7pv+KlwN49xF X-Received: by 2002:a63:371a:0:b0:41b:f4c1:285e with SMTP id e26-20020a63371a000000b0041bf4c1285emr8956821pga.146.1659435492602; Tue, 02 Aug 2022 03:18:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659435492; cv=none; d=google.com; s=arc-20160816; b=BeP9deurNzPPvHf9sPWSPinTFIawLL0r4hJwKrKaNMHBB4o3ZGOjM335IDO11TsHA5 oCU3PGDAT3v0gbDqay5Lr66v2/piAv3KmGgpPTF39v3jQ/MWaz74xxIkEDzyutglsPhT T0N4TQJFm20fp7YcDA/2tNAgg9I6K+Ep5QdRk5qhI+BnW8AaIKT36Gp3Nt7LN+0K4QWZ o9W2qtOx/mnu1gtrc/v87mb0xg1IX1Q8ps3yFxTwuLy2DoyZdNxMSnmWsaCEWp6MP2Cp 7ng4ilUTPXihghqMnXyw8lG8CLVTdyWcezPj3/d4FTFHjeRdjZGJ4i241nuJDuwzGV6B gbow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature:dkim-signature; bh=ZlMiDMauGITlK4Cag6n1I3xWbH99VdUcpWvKpgoPLcs=; b=Ulia3w4LoQ2hwryuomzT4ZV/0mh0LKW548Uxyz6QPDKu+Fn8vP0LaG4GFVbxyw3wBN eW5h47yPDYhOv0bQIUVLR0IbsI4JvNkVqPtL+85VSHFWrbQ6nzdc0+wC6xsVPkv0rrqu 4S4Vpks+brz3ItHTWpKrxYKVUlNHdNVU+YOTQK4woYNeoond++CZ9FfCwMi3G+8cySvQ G1t+TbhXKIPnwHdMFkrFFSSqDH91UFhjH6AxtTqDmsSURb0MV85S20OSv7FTHlF8vS2f MOzpi1OZzloDi5fMHrpEfzuJwZE4K4yOpzrb1DZCpkAC55kaScveE4VTEHrPt7M1mhEE XYeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=tUhiJwoc; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z30-20020a630a5e000000b0041a84b02854si14964564pgk.420.2022.08.02.03.17.57; Tue, 02 Aug 2022 03:18:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=tUhiJwoc; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235458AbiHBJdD (ORCPT + 99 others); Tue, 2 Aug 2022 05:33:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53082 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236432AbiHBJco (ORCPT ); Tue, 2 Aug 2022 05:32:44 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7821439BAC for ; Tue, 2 Aug 2022 02:32:43 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 2AB6520339; Tue, 2 Aug 2022 09:32:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1659432762; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZlMiDMauGITlK4Cag6n1I3xWbH99VdUcpWvKpgoPLcs=; b=tUhiJwocCojWSInY6pDE6YYe9SXQpwAY1MB7wqsjEpyDPxQQ2MA5iOGhqIK1Tk8bH3pUrz KubdGY9zVTHL6OazqfGfhvyjve91eHl0JmCqiVY1ro7wK7A3yryGSoItA1VuciYs1DEiMR gtTPPevJ4+hgEAzzR7cePB/5d0kvJU0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1659432762; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZlMiDMauGITlK4Cag6n1I3xWbH99VdUcpWvKpgoPLcs=; b=k5aX033Tw7r9QmukvIlIP9h6hZfjtmYgaWRH2vbqk6MM7ck3CZv2idwLUCXNXX8qdg+yJn 127lMHDOSBbAoBAg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id EBC9D13A8E; Tue, 2 Aug 2022 09:32:41 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id wvOvODnv6GJYawAAMHmgww (envelope-from ); Tue, 02 Aug 2022 09:32:41 +0000 Message-ID: <321b8b3e-9d06-b01c-d871-1f7ca35ce91e@suse.cz> Date: Tue, 2 Aug 2022 11:32:41 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH v3 08/15] mm/slab_common: kmalloc_node: pass large requests to page allocator Content-Language: en-US To: Hyeonggon Yoo <42.hyeyoo@gmail.com> Cc: Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , Roman Gushchin , Joe Perches , Vasily Averin , Matthew WilCox , linux-kernel@vger.kernel.org, linux-mm@kvack.org References: <20220712133946.307181-1-42.hyeyoo@gmail.com> <20220712133946.307181-9-42.hyeyoo@gmail.com> From: Vlastimil Babka In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/2/22 10:59, Hyeonggon Yoo wrote: > On Mon, Aug 01, 2022 at 04:44:22PM +0200, Vlastimil Babka wrote: >> > > Yeah, uninlining __kmalloc_large_node saves hundreds of bytes. > And the diff below looks good to me. > > By The Way, do you have opinions on inlining slab_alloc_node()? > (Looks like similar topic?) > > AFAIK slab_alloc_node() is inlined in: > kmem_cache_alloc() > kmem_cache_alloc_node() > kmem_cache_alloc_lru() > kmem_cache_alloc_trace() > kmem_cache_alloc_node_trace() > __kmem_cache_alloc_node() > > This is what I get after simply dropping __always_inline in slab_alloc_node: > > add/remove: 1/1 grow/shrink: 3/6 up/down: 1911/-5275 (-3364) > Function old new delta > slab_alloc_node - 1356 +1356 > sysfs_slab_alias 134 327 +193 > slab_memory_callback 528 717 +189 > __kmem_cache_create 1325 1498 +173 > __slab_alloc.constprop 135 - -135 > kmem_cache_alloc_trace 909 196 -713 > kmem_cache_alloc 937 191 -746 > kmem_cache_alloc_node_trace 1020 200 -820 > __kmem_cache_alloc_node 862 19 -843 > kmem_cache_alloc_node 1046 189 -857 > kmem_cache_alloc_lru 1348 187 -1161 > Total: Before=32011183, After=32007819, chg -0.01% > > So 3.28kB is cost of eliminating function call overhead in the > fastpath. > > This is tradeoff between function call overhead and > instruction cache usage... We can investigate this aftewards, with proper measurements etc. I think it's more sensitive than kmalloc_large_node.