Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp285541ybz; Tue, 21 Apr 2020 09:01:17 -0700 (PDT) X-Google-Smtp-Source: APiQypJlShOuOtFX7w74aPPPcezX3nLqCNEqSG1Oguq4uzN0lhiPpDkbKJ5LZmRhq3x+j9DuCJip X-Received: by 2002:a05:6402:1d33:: with SMTP id dh19mr8478714edb.338.1587484877524; Tue, 21 Apr 2020 09:01:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587484877; cv=none; d=google.com; s=arc-20160816; b=Ck5hpM1hPpC548cjqBz4BJWgL7+RnaM13JQCxrpZ1rz07vVhgUCorTk98SF3IilpCj nvUD8Wz6NPcmHPdULh3TCkGyLpZu8eIKDSagQjpJfdC/zNvtcmivLpXXPbFrxuqOkzUG szeY7tfAdZKjexpuQSoiKBrHsgREWpRcJi6VMIOi0x2ZTJFfnM12k+/IFbj2954ta+my u0tq0+iDDoPqEV4zpYEM4s5lDKPJaCYlYHkWleQGCx42sTHVUUx9ZQLH8F9G1QpGNROb lgbLhNeQa/5mO03a4nODQYwzxcP4kkUQTbbky7de7CkmSUbXA5gStWve022NikHmF3eD PqaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=dCXff/p9rx/LIugy9HchSYovnPtbvZiJVt09pk/bHA8=; b=wKOJFw9OikupMokeLI/aGCTMN+6hTf/X1tJEvMFE01BAvdVPMAVvzLnzRRSpG3dogg xkBluU/uF0Vj3wA5E6o7GU6IbVoLwDzGZoPlOuHqLrOAw9753Qwkgc2d+WmcxmTdgsMM NISmpPJsZGKSj/T94NUucOkQ2PANuNqZtDbl9ZCE/2yJb8jPbhxorx54YZTTY531dQWT gYWbdN0yqK9F+AhJS3Uy7O9Rr1vrThITW96nkm+7Gv82QIRxkXFmnfCHNcx2jvrEkDgN 6+KsemeUleqfPHi4OyA0rcshvxFUd+nzB4zokqcc5NrfvIGNOxORhCqQwqemRteqnX4e HnOg== ARC-Authentication-Results: i=1; mx.google.com; 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 e4si1705166edm.570.2020.04.21.09.00.51; Tue, 21 Apr 2020 09:01:17 -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; 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 S1728479AbgDUP5J (ORCPT + 99 others); Tue, 21 Apr 2020 11:57:09 -0400 Received: from gentwo.org ([3.19.106.255]:35046 "EHLO gentwo.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726018AbgDUP5I (ORCPT ); Tue, 21 Apr 2020 11:57:08 -0400 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" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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: 8BIT On Tue, 21 Apr 2020, 赵军奎 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 gets > >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? No. That is where you creativity and ingenuity come in. Otherwise you need to leave it alone. --531401748-1821483078-1587484627=:5249--