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 X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E4DEDC54FC9 for ; Tue, 21 Apr 2020 15:57:09 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id BCA56206E9 for ; Tue, 21 Apr 2020 15:57:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BCA56206E9 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 4DC2C8E0005; Tue, 21 Apr 2020 11:57:09 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 48CD98E0003; Tue, 21 Apr 2020 11:57:09 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 37C1B8E0005; Tue, 21 Apr 2020 11:57:09 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0060.hostedemail.com [216.40.44.60]) by kanga.kvack.org (Postfix) with ESMTP id 1D7088E0003 for ; Tue, 21 Apr 2020 11:57:09 -0400 (EDT) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id D66C052BB for ; Tue, 21 Apr 2020 15:57:08 +0000 (UTC) X-FDA: 76732316136.10.worm01_5b76547fc831e X-HE-Tag: worm01_5b76547fc831e X-Filterd-Recvd-Size: 2075 Received: from gentwo.org (gentwo.org [3.19.106.255]) by imf32.hostedemail.com (Postfix) with ESMTP for ; Tue, 21 Apr 2020 15:57:08 +0000 (UTC) Received: by gentwo.org (Postfix, from userid 1002) id B3BD640B07; Tue, 21 Apr 2020 15:57:07 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by gentwo.org (Postfix) with ESMTP id B2F9A3EED6; Tue, 21 Apr 2020 15:57:07 +0000 (UTC) Date: Tue, 21 Apr 2020 15:57:07 +0000 (UTC) From: Christopher Lameter X-X-Sender: cl@www.lameter.com To: =?GB2312?B?1dS+/L/8?= cc: Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel@vivo.com Subject: Re:Re:Re: [PATCH] kmalloc_index optimization(add kmalloc max size check) In-Reply-To: Message-ID: References: User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="531401748-1821483078-1587484627=:5249" X-Bogosity: Ham, tests=bogofilter, spamicity=0.050154, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --531401748-1821483078-1587484627=:5249 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Tue, 21 Apr 2020, =E8=B5=B5=E5=86=9B=E5=A5=8E wrote: > >You could modify that to check for KMALLOC_MAX_SIZE with some more > >conditionals but then kmalloc_index) is written so that the compiler g= ets > >constant folding right. > For this point, I am afraid i didn`t catch your idea. > I am not sure how to modify it.... > Is there some similar code implementation in the kernel=EF=BC=9F No. That is where you creativity and ingenuity come in. Otherwise you nee= d to leave it alone. --531401748-1821483078-1587484627=:5249--