Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1272526pxb; Thu, 24 Mar 2022 16:36:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzolgoPbRVtPuzzePjzhfDZNtTofziJpSofGTlCZrMSL9igj6Mk4P5MATLuWmPVvGIZLQZa X-Received: by 2002:a17:90b:164f:b0:1c7:8d27:91fc with SMTP id il15-20020a17090b164f00b001c78d2791fcmr13221062pjb.228.1648164986459; Thu, 24 Mar 2022 16:36:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648164986; cv=none; d=google.com; s=arc-20160816; b=H9Qxw9/Y8Z5jMKrYA5IsceSUTJ+VJ1efqL9jBw204cWATAz5i3iJPMqaT8zyiZhdLm slWGFh8qsb1+VJcE392YJUgp3F9fWt/gLrSAm354BL32xmFIIF8oFizEBxhRZZJgJIW2 ElQoDGB8PgYg54s7ald+PILBnEpTfpRHjYB8GMbiVIGFcD/ZpoFpo3ibdG4Kvs5aPpiK op8ZNBOsh2rvq3BjrdYVntqpy+w0ubxP2D0ZTB1Kx9qa8DsU4Sktcm71VQCf13jdv29+ F37ErJguZ0IqCgzCNR2BDNDOazG3ml3kAYSMfTF0eOtXGGC8HZ59LFUwe7wxAURr9QQh UpAw== 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=6nXfRRkwI9pT0Egb62KVCQmh30ZwxB4Oif8GwM6IzOI=; b=tUPYplmrBOkQ7OSXTA64IxHvxC/Wpfookl0NTuvDeFN/0yvPgUt/tm5zS1Dr7bpmfi +mUQ7/s2IS10F10S1EWwUqNgOWYHTNgXf5m7Lw45FvKHDBnmTojGA6Ybd/G2FPr/hcVA A7uQ4LC5ql493+B29piEa5XUFnC/GC6fYNvgfYROrlqgEnC8hOYChqE+LoCZ+stbKFbV Zu096Uj9COO0njfGbbp+jtx31dzIGxbRT5xjugwV68CUBS6mxVJCQHeZua4UTiSvXRGw dFKSXd5jaGUX+ae136Us6FQoK/lW/moc+rCfanP8lVmDshBjIbFyyg0NF/wDovA49QRe alsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b="1xY/vL7o"; 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 lx3-20020a17090b4b0300b001bd14e03066si1258789pjb.62.2022.03.24.16.36.09; Thu, 24 Mar 2022 16:36:26 -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="1xY/vL7o"; 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 S1345661AbiCXRsL (ORCPT + 99 others); Thu, 24 Mar 2022 13:48:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42042 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243676AbiCXRsK (ORCPT ); Thu, 24 Mar 2022 13:48:10 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F621B2471 for ; Thu, 24 Mar 2022 10:46:36 -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-out1.suse.de (Postfix) with ESMTPS id C36C6210FD; Thu, 24 Mar 2022 17:46:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1648143994; 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=6nXfRRkwI9pT0Egb62KVCQmh30ZwxB4Oif8GwM6IzOI=; b=1xY/vL7oKZJ+V+m8eO34xNsjEY+2nmP4fLYXPTjyZO5igZctxEsQthD6YKhOoQ3h1rUeX0 1zZDjtdUv3hBxsdzuenuKtLvcw+LPtlhLUhhI7vLMkkUeeo/dNs9r8hOHV0c5QE8SzG84F UpWWwitpMlnwJIJccgHs/Js7txlccFo= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1648143994; 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=6nXfRRkwI9pT0Egb62KVCQmh30ZwxB4Oif8GwM6IzOI=; b=NIdmExCsToRsefI4UqAAIkxFSFt8oQw61dY77oFrCiMiWbtMf827G30ATuFseMm/EksI4t if+twqt1wnpWsCCg== 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 9BF0F13A7F; Thu, 24 Mar 2022 17:46:34 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id xoteJXquPGKhYgAAMHmgww (envelope-from ); Thu, 24 Mar 2022 17:46:34 +0000 Message-ID: Date: Thu, 24 Mar 2022 18:46:34 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [RFC PATCH v1 08/15] mm/sl[auo]b: cleanup kmalloc() Content-Language: en-US To: Hyeonggon Yoo <42.hyeyoo@gmail.com>, linux-mm@kvack.org Cc: Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , Marco Elver , Matthew WilCox , Roman Gushchin , linux-kernel@vger.kernel.org References: <20220308114142.1744229-1-42.hyeyoo@gmail.com> <20220308114142.1744229-9-42.hyeyoo@gmail.com> From: Vlastimil Babka In-Reply-To: <20220308114142.1744229-9-42.hyeyoo@gmail.com> 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,T_SCC_BODY_TEXT_LINE 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 3/8/22 12:41, Hyeonggon Yoo wrote: > Now that kmalloc() and kmalloc_node() do same job, make kmalloc() > wrapper of kmalloc_node(). > > Remove kmalloc_trace() that is now unused. This patch makes slab > allocator use kmalloc_node tracepoints in kmalloc(). > > Signed-off-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Actually there are more things to fix than the commit log. > +#ifndef CONFIG_SLOB > +static __always_inline __alloc_size(1) void *kmalloc_node(size_t size, gfp_t flags, int node) > +{ > + if (__builtin_constant_p(size)) { > + unsigned int index; > + > + if (size > KMALLOC_MAX_CACHE_SIZE) > + return kmalloc_large(size, flags); Should use kmalloc_large_node(). > + > + index = kmalloc_index(size); > + > + if (!index) > + return ZERO_SIZE_PTR; > + > + return kmem_cache_alloc_node_trace( > + kmalloc_caches[kmalloc_type(flags)][index], > + flags, node, size); > + } > + return __kmalloc_node(size, flags, node); > +} > +#else > +static __always_inline __alloc_size(1) void *kmalloc_node(size_t size, gfp_t flags, int node) > +{ > + if (__builtin_constant_p(size) && size > KMALLOC_MAX_CACHE_SIZE) > + return kmalloc_large(size, flags); And here. > + > + return __kmalloc_node(size, flags, node); > +} > +#endif