Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp1299211imm; Wed, 20 Jun 2018 15:27:55 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIS+9NovXkcq9mgZ7GBIwLkx6PfJwe8pXtXYNvODHoY9nCwfgzZBAo9NAwYil7BKX8WxNJo X-Received: by 2002:a62:6941:: with SMTP id e62-v6mr24751075pfc.56.1529533675615; Wed, 20 Jun 2018 15:27:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529533675; cv=none; d=google.com; s=arc-20160816; b=Lez3snHZv8OFQw2VWXPWKXYBeBYzpNqQfQhwXuP4xIWZSBQMZAENyKLIeDJXo7BmE9 JRU57afnM/GyS3kgUjIbQAuvpqBHw1PERMf573ozrxbFvFBx7A9riNifd0RJs8p6dw39 lD6CRS3qb+4N7TIA9QjugTxqSjcLXZ4DFfuPBG309XJ95a52VCD5KevdTDMKGqFHK11/ NSta558+u002/6YlYx9SxS0osoBiKvb7ZuMTZlfkPnHQ/rz4waXDOkVPXiU7uLLycGvA Iq3deDgEZhBliyUGCbhdHZyMRm3iYZksildq7oFMNBYWuMnpJQEZdUymcsnBjFaW3x74 L2LA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=ASJ1e8ZvcQPd7+aK2SSrcXpeQIkXPQrgl/fdTzrrYpo=; b=ozzcCsNEvEwAGEXxRvAtfIYOeOyGSKL3uoE7OgM6KQr+Y6LxP2NlFUwE9TiN3u8+pf IAhauklpqSwq4F/xR2kzlB4pafdcgzd8dR6rbM5a8vFboNSUexsalO1ocLn3JNQJ8Oiw iSD3r5kwA/xDGakFwtoi/KMY9Dkq5Aa73+6iUp+hLtql80ij/l1mptZYVWXQHbgTWNHw B9JatPiIOLaX4L/ajySCH8bAckSKrl2Vc9+0sXNAPjTOvkhIi9t7NoZndejzrrk1i5/+ sMaZOFQTBI0qRXkPoftgNL+o7uHjP1GeDnqy9USsgYxL9Epth6COCWLEoFsuMTkEA1xF SjxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@infradead.org header.s=bombadil.20170209 header.b=MCXxpQ5Q; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l23-v6si3394053pfg.326.2018.06.20.15.27.41; Wed, 20 Jun 2018 15:27:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@infradead.org header.s=bombadil.20170209 header.b=MCXxpQ5Q; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933776AbeFTW1A (ORCPT + 99 others); Wed, 20 Jun 2018 18:27:00 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:49778 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933755AbeFTW05 (ORCPT ); Wed, 20 Jun 2018 18:26:57 -0400 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:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=p55QclUKo10CQ35MbXYPMCkdd/Esy3Q1pJIRiv8FQNQ=; b=MCXxpQ5Qlps/XFl6stZase3QV 1+ulC0tXeVbMMHg8pBKV1RyfA/37AOXA57Q7I9eeFa62QyL8adyZgA1iUKpvFH+NdtkIx4f0CD6JN eDpF+k0jAEY6mqHhgii0VXPKRTfvexW4ii2+zjG8+y+uT97Cl/RQ14HJtOvUgYPG+cVm//fqceEZT 4P4w/3VUdKr80sQwiUs36FkeOA4v3OwrhVmHKEaMjOrU1PtpkYLXFyopKlqpse/e3xXFFYujLH3jG tG1UxsmuYmg4vLRMykdOx+2C0tebVufYSC9oWyyKhdAxsgcmmGGmqbdmZ05324Bcc/kbpfez+BqTm hEh+BrR4w==; Received: from willy by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1fVlYz-0001wr-Tu; Wed, 20 Jun 2018 22:26:53 +0000 Date: Wed, 20 Jun 2018 15:26:53 -0700 From: Matthew Wilcox To: Rick Edgecombe Cc: tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, x86@kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, kernel-hardening@lists.openwall.com, kristen.c.accardi@intel.com, dave.hansen@intel.com, arjan.van.de.ven@intel.com Subject: Re: [PATCH 1/3] vmalloc: Add __vmalloc_node_try_addr function Message-ID: <20180620222653.GC11479@bombadil.infradead.org> References: <1529532570-21765-1-git-send-email-rick.p.edgecombe@intel.com> <1529532570-21765-2-git-send-email-rick.p.edgecombe@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1529532570-21765-2-git-send-email-rick.p.edgecombe@intel.com> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 20, 2018 at 03:09:28PM -0700, Rick Edgecombe wrote: > > /** > + * __vmalloc_try_addr - try to alloc at a specific address > + * @addr: address to try > + * @size: size to try > + * @gfp_mask: flags for the page level allocator > + * @prot: protection mask for the allocated pages > + * @vm_flags: additional vm area flags (e.g. %VM_NO_GUARD) > + * @node: node to use for allocation or NUMA_NO_NODE > + * @caller: caller's return address > + * > + * Try to allocate at the specific address. If it succeeds the address is > + * returned. If it fails NULL is returned. It may trigger TLB flushes. * Try to allocate memory at a specific address. May trigger TLB flushes. * * Context: Process context. * Return: The allocated address if it succeeds. NULL if it fails. > @@ -1759,8 +1795,9 @@ void *__vmalloc_node_range(unsigned long size, unsigned long align, > return addr; > > fail: > - warn_alloc(gfp_mask, NULL, > - "vmalloc: allocation failure: %lu bytes", real_size); > + if (!(gfp_mask & __GFP_NOWARN)) > + warn_alloc(gfp_mask, NULL, > + "vmalloc: allocation failure: %lu bytes", real_size); > return NULL; Not needed: void warn_alloc(gfp_t gfp_mask, nodemask_t *nodemask, const char *fmt, ...) { ... if ((gfp_mask & __GFP_NOWARN) || !__ratelimit(&nopage_rs)) return;