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=-3.8 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED 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 6A250C433E1 for ; Wed, 1 Jul 2020 15:24:43 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 3138B207D0 for ; Wed, 1 Jul 2020 15:24:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="gpBD0gAU" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3138B207D0 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 9A76C8D0029; Wed, 1 Jul 2020 11:24:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 958AC6B00F5; Wed, 1 Jul 2020 11:24:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 86E9E8D0029; Wed, 1 Jul 2020 11:24:42 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0079.hostedemail.com [216.40.44.79]) by kanga.kvack.org (Postfix) with ESMTP id 6F05F6B00F4 for ; Wed, 1 Jul 2020 11:24:42 -0400 (EDT) Received: from smtpin03.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 040B22DFA for ; Wed, 1 Jul 2020 15:24:42 +0000 (UTC) X-FDA: 76989879204.03.balls93_2610a3226e81 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin03.hostedemail.com (Postfix) with ESMTP id 39C3C28A240 for ; Wed, 1 Jul 2020 15:24:39 +0000 (UTC) X-HE-Tag: balls93_2610a3226e81 X-Filterd-Recvd-Size: 2193 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf01.hostedemail.com (Postfix) with ESMTP for ; Wed, 1 Jul 2020 15:24:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.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=g7jjQg54WNq1SN5Cryc74qFMajeVaxInmN7DE9gipZY=; b=gpBD0gAU9h3s5AkQVqbwm5plpx i8xSODhrYW7x0JAq8BFcruUeQjbx8Rjp5T43/asALpzcGcBkHxCuoh4XrlSZAdkNplINDySfqsdKh c/sKxxDoQBeyMZ9M+laNTV3DCDmVvjC2M9lXSppa6sTJY7R8TSlaK+MJzTqAsRT34WGYOzqw2A9bs ohOGiMu8N6qFT1Eld7g5weo+jz4bHkLZcSGpbF+ua3onYTBFa4KE8ClmQO3FQTllmPzmRgBW3Fh9H VPMFw4IUQsDHi4ihd6AVP0cb70mcp6AGs3pwt7KbhgZsyn4Q/XBdUAfXHzDTiL2P78r/ALyRtkhEG zwzfmB7A==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jqeb5-00040U-6K; Wed, 01 Jul 2020 15:24:27 +0000 Date: Wed, 1 Jul 2020 16:24:27 +0100 From: Matthew Wilcox To: Long Li Cc: cl@linux.com, penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com, akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3] mm, slab: Check GFP_SLAB_BUG_MASK before alloc_pages in kmalloc_order Message-ID: <20200701152427.GS25523@casper.infradead.org> References: <20200701151645.GA26223@lilong> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200701151645.GA26223@lilong> X-Rspamd-Queue-Id: 39C3C28A240 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam05 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed, Jul 01, 2020 at 03:16:45PM +0000, Long Li wrote: > kmalloc cannot allocate memory from HIGHMEM. Allocating large amounts > of memory currently bypasses the check and will simply leak the memory > when page_address() returns NULL. To fix this, factor the > GFP_SLAB_BUG_MASK check out of slab & slub, and call it from > kmalloc_order() as well. In order to make the code clear, the warning > message is put in one place. > > Signed-off-by: Long Li Reviewed-by: Matthew Wilcox (Oracle)