Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp719462ybt; Wed, 1 Jul 2020 08:27:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzhDdtZ91vp1OZMdc1OhD9uRuzupZB7kJyOkNnAgH8Nm42mbglfZ8XrFaCVk+K4hhFCToKY X-Received: by 2002:a17:906:a28b:: with SMTP id i11mr23221982ejz.524.1593617266542; Wed, 01 Jul 2020 08:27:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593617266; cv=none; d=google.com; s=arc-20160816; b=eRs1y8Dc2HEdjxd/d1dFO4FDPuIM0wMDSblJ7ij3Lvz+3nRk7O4erIt6YLjNdi4VGv DgUSKdXBZJw5snntLCOBfHYnx9S1ejVRexUG0COMLEzKmVaj8unJAgWGnVYKm2CY9w2U plm6EHwFXUG4MH3iIrai3bX6mw5qg/9tbPSbFxCtOQNdWlWNXhKZ9JHsf7rewdcQX/9R WJbV+AUjSXs4CWN0w2Aa2Gkg4aVT+sfJU+6xGH1pT2ZVR+LA/L+ii/7fHkHWMf8JX3N6 7JoECGCY9J7LnN+TFPU4rtEtl8Raffh9jwbcfjF8QLwaIbdh5PiekNK4ADg64RJwKdQL 9UMQ== 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=g7jjQg54WNq1SN5Cryc74qFMajeVaxInmN7DE9gipZY=; b=ZGujPj8pKQ6xdOY7mZqzEV9MF9mGiFmFaKBqZAofuGv0j4PZ8KliYpjh7hIHjDfKJ9 kq9S0slGqWxtej8pyr4AZaLNCxKs3dH/D6Lz+XXibsp3SiQ0vk9dhuVtHbE/KgxIdAKV oKLPMsCKVNqJLhaqMjudR0M8cR16DL58eEaYkZ8nMZlFGcDFdNt2XKeOHDfhjEp5SZ5N QMe2IEjx+6NYXpe4tqkaVQGRVEbiMQ0+wIEELFFvkAPjSpg5cE9zt7em3KcbQAn41bAu n8S9o9GPDUrgUaRbenFO8CtWNkPwPGJelFfH0wXNwA+TYpbpSLUKKrIPjBvpoL2gpQSs 1gig== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=gpBD0gAU; 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 lr25si3910387ejb.622.2020.07.01.08.27.22; Wed, 01 Jul 2020 08:27:46 -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=casper.20170209 header.b=gpBD0gAU; 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 S1731923AbgGAPYj (ORCPT + 99 others); Wed, 1 Jul 2020 11:24:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59700 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731916AbgGAPYj (ORCPT ); Wed, 1 Jul 2020 11:24:39 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E18F3C08C5C1 for ; Wed, 1 Jul 2020 08:24:38 -0700 (PDT) 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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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)