Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp102281ybz; Thu, 16 Apr 2020 20:25:41 -0700 (PDT) X-Google-Smtp-Source: APiQypJvCfOfsldrYsqpoY8VwG+0x9H2hLKWD+3NaDIhbqQX/6PT1SmIQZI0x61V3DlLom0KJq6d X-Received: by 2002:a50:d1c6:: with SMTP id i6mr1064910edg.241.1587093940831; Thu, 16 Apr 2020 20:25:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587093940; cv=none; d=google.com; s=arc-20160816; b=aZyET2Q1tNB/WiwZBuo52RMkhWoHz+MxIB9sMTwF//RH3celBDEL9BcD52djd7/qAC FCGx0e+TqYFd5VA2COoib5pUKkfYquncPGcp/lR6XO2g1Yzy5z8AyVzYWy2mqeKQoNQM 1MgJyAuqRwAOOPdOnRPuAmfyIwhyXfY/e3ocBxpMo2BXP745Qi9B4pbh+fYPfwfLElR/ kU9e0UCR5Pt/Ug+iwxh/5Y1xzS8XfjtYXFi2oPJfroeSlVnFf5rMnVTAyRUR0ahavq0U jJ8f0AOzaw1zExU8NYLvrhF1PwGc6UToStt/NI7ecDVOTTVs14qWAnU1Cwupj4WeV2jQ mKOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=4NwRdnd1tqHPknUqRG8dZUJNk1TYuEB6jMxKNZTYnKQ=; b=C31PnSkLZ2oyIjThE0U1K5DDnDoJxZZEBENByfW6he7QeffesEs5pMOgB7NsYbQORO GDLj0rgWLpnInKgc52e5R/pFZMbV2UwlZuZUQEQWVamB1M4sP4+rONnyXdZdWnp+ixlN y63KTwj7VOSZD8KC9d4rb/hGLVF6ZjBNSBxlClCBbE6ROr9+4ERLJCPtDcyuxSDvDw+I haWyBVMghMK1hWn6lxXGMTyv6ijq+6bBHiShoVRwa8qehrCFRhpaKdad7ouT8egdwJ+9 B82EfASOHPfa5oPx2g4SSExOazNFvCxJ9X/8yWmL3mGGfLzGVhxW+tw+mTTJyGYxh5Xw S8aw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=U55S4Mjk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bo2si10198661edb.438.2020.04.16.20.25.17; Thu, 16 Apr 2020 20:25:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=U55S4Mjk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728343AbgDQDYF (ORCPT + 99 others); Thu, 16 Apr 2020 23:24:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44950 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726319AbgDQDYF (ORCPT ); Thu, 16 Apr 2020 23:24:05 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 19F74C061A0C for ; Thu, 16 Apr 2020 20:24:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=4NwRdnd1tqHPknUqRG8dZUJNk1TYuEB6jMxKNZTYnKQ=; b=U55S4Mjk3H/DrgX1Nyk3DwecPx 3RJmjnZtDd66aTMXfWjADMplV3gkjopia000iB+pHjew3iT1rNXZVQRbZYX/wv1l56w7iL2V9c6qV RYUOD5NdhycZ5NQco7Bk7Kxhry9iDWjfeKVlIfI27M9d7tnwIUmN9tfwTn5Dr2yxoV5ZH6FwmCPTf ezxvyAxZslVYOgzG+zDCxiAIMDQrmZM6H4ZMI3y3xaPLmqjUqqEj8PI8ELcj8PziQXA0lX0HgFrY8 oOQF3pROJzkMuGePVojzUOJaSE3G/44BKEpWlh2FflNnAviNSZWvE1tWdlOm6RgwBkvEbA15YkeCq sP7+/9qA==; Received: from willy by bombadil.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jPHbe-0005WU-5o; Fri, 17 Apr 2020 03:23:54 +0000 Date: Thu, 16 Apr 2020 20:23:54 -0700 From: Matthew Wilcox To: Bernard Zhao Cc: Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel@vivo.com Subject: Re: [PATCH] kmalloc_index optimization(code size & runtime stable) Message-ID: <20200417032354.GK5820@bombadil.infradead.org> References: <1587089010-110083-1-git-send-email-bernard@vivo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1587089010-110083-1-git-send-email-bernard@vivo.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 16, 2020 at 07:03:30PM -0700, Bernard Zhao wrote: > kmalloc_index inline function code size optimization and runtime > performance stability optimization. After optimization, the function > kmalloc_index is more stable, the size will never affecte the function`s > execution efficiency. > And follow test data shows that the performance of new optimization > exceeds the original algorithm when applying for more than 512 Bytes > (include 512B).And new optimization runtime is more stable than before. That's all very well and good, but the vast majority of allocations are less than 512 bytes in size! Your numbers show that on average, this patch makes the kernel slower! > size time/Per 100 million times > old fun new fun with optimise > 8 203777 241934 > 16 245611 409278 > 32 236384 408419 > 64 275499 447732 > 128 354909 416439 > 256 360472 406598 > 512 431072 409168 > 1024 463822 407401