Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp4566648ybe; Mon, 16 Sep 2019 14:35:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqyqFxZUyRT9BTQcjH78J77TbsApZUa0HBoKXf3p+uqtnjiUyuEtLN1yBeVoLd1I47L1mHsJ X-Received: by 2002:a05:6402:1246:: with SMTP id l6mr1376376edw.213.1568669707693; Mon, 16 Sep 2019 14:35:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568669707; cv=none; d=google.com; s=arc-20160816; b=S9rjm7NCljrovnFpnALub7blhm5e1b68K49wuDdwVv3MfYRI0HHwNrQmb09qxZ7VVN qUbmEYpIUUDmRvtQvQhlq3ur2AvYmBsAGg1NTREqsceUYHEbkmbuZgmb0/5u9WrMr04f /2MTKLTsh1TBgWN8n47Ypu56O8RIP3Bf9nhjEJAIAo0GowtS+2Hhoe2gz3+56ZDJv/MU JX1Sb11kMhTbuOaeKa2tmyugb/C8E8JxNwkCjVxmTIgb3IxD1gwicngwU8jpn4c9/IK+ 3yGNjITVBpa9LhTL638kM9sbqYFuerhCJ/pt/O0sdnw4JHDGdaaFUQFZssapR/34bleF cVCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:feedback-id:mime-version:user-agent :references:message-id:in-reply-to:subject:cc:to:from:date :dkim-signature; bh=5vsv823iDPGFqRA288qUAJ1tOsFdw0E0KGwM0/qQ2Ps=; b=lOVy75onWEGJ+EfZ8FZ0t2xJYXEn7pLjNnzjjNv1V8QLuRVRZmmAoN4cV/Y45KqzT5 /NfdtVQuUjVKT4y/+XVO6mpz6/O9phc3khxShISIh2W8sp4VLHHN7Rn0bJvTxuwf4Pn2 i/90w8HAqbgtZ5DwIhenOS+3MIk9BgekdOYdS/Uy5ENzVDhywXS9msq/EXqbKf7D12wF tEj0SLeWMHczggRipLzzmY8ZwkUFbgZOP1Vr+M/ibjcFv7pC5nJoliaInU45InfjuKWW xEfowNSOUUkwDFNs68J3yGbMNpv8kYRdfEtwGMZ0QBlthn7vP4r0jTp40OetbA+3v+pX biPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazonses.com header.s=6gbrjpgwjskckoa6a5zn6fwqkn67xbtw header.b=BjuKfMTA; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u4si168067edp.447.2019.09.16.14.34.44; Mon, 16 Sep 2019 14:35:07 -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=@amazonses.com header.s=6gbrjpgwjskckoa6a5zn6fwqkn67xbtw header.b=BjuKfMTA; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729915AbfIPPwx (ORCPT + 99 others); Mon, 16 Sep 2019 11:52:53 -0400 Received: from a9-99.smtp-out.amazonses.com ([54.240.9.99]:44448 "EHLO a9-99.smtp-out.amazonses.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728108AbfIPPwx (ORCPT ); Mon, 16 Sep 2019 11:52:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=6gbrjpgwjskckoa6a5zn6fwqkn67xbtw; d=amazonses.com; t=1568649171; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:MIME-Version:Content-Type:Feedback-ID; bh=5vsv823iDPGFqRA288qUAJ1tOsFdw0E0KGwM0/qQ2Ps=; b=BjuKfMTADiwEeMWyIpJEGOUsDVO+rsGwaTH3gqgSOxtgsdvECTqZ3/s3cCfM2LB+ 9k7BvUnLTxAQiKLKaXJuhqBKWNu8xCfgQzHeyQBETbfEXUJXAY9POhufCvxdlRNn44g PQau6lgBseHE0pEXOwrqhJg1UafuqcFBpQPGmXpY= Date: Mon, 16 Sep 2019 15:52:51 +0000 From: Christopher Lameter X-X-Sender: cl@nuc-kabylake To: Pengfei Li cc: akpm@linux-foundation.org, vbabka@suse.cz, penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, guro@fb.com Subject: Re: [PATCH v5 7/7] mm, slab_common: Modify kmalloc_caches[type][idx] to kmalloc_caches[idx][type] In-Reply-To: <20190916144558.27282-8-lpf.vector@gmail.com> Message-ID: <0100016d3ac6d132-891c437f-2aeb-41de-84d8-aec48bc20ee4-000000@email.amazonses.com> References: <20190916144558.27282-1-lpf.vector@gmail.com> <20190916144558.27282-8-lpf.vector@gmail.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-SES-Outgoing: 2019.09.16-54.240.9.99 Feedback-ID: 1.us-east-1.fQZZZ0Xtj2+TD7V5apTT/NrT6QKuPgzCT/IC7XYgDKI=:AmazonSES Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 16 Sep 2019, Pengfei Li wrote: > KMALLOC_NORMAL is the most frequently accessed, and kmalloc_caches[] > is initialized by different types of the same size. > > So modifying kmalloc_caches[type][idx] to kmalloc_caches[idx][type] > will benefit performance. Why would that increase performance? Using your scheme means that the KMALLOC_NORMAL pointers are spread over more cachelines. Since KMALLOC_NORMAL is most frequently accessed this would cause a performance regression.