Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2480297imu; Fri, 14 Dec 2018 11:43:32 -0800 (PST) X-Google-Smtp-Source: AFSGD/WhD7xM3InKqxiogsdoSGJsDytpj4T6jTf8G4OIWuKQh/xeVFDNli4DjoDOzLcXCmsnCDpG X-Received: by 2002:a62:824c:: with SMTP id w73mr4022208pfd.150.1544816612560; Fri, 14 Dec 2018 11:43:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544816612; cv=none; d=google.com; s=arc-20160816; b=TlXg0cTyD90T24Fh1U/xRYzEK+GneTy0pOn/+mXO7pJ2Hb3oFYEhRqNdqQwhJPvizZ PxuY08zqEnFCviPdOs7KEHob4wTCQGAI3tbPYlezBIKtd1qsbSJktS/mmS+fyRrx1fqb XK/2mkHdyTUwabhdaApVfKbVQfJukDwxfO8QHxirmgtfff1+rnoo60Z7+UX+Si639EvV wgygmpMKBGnjHpji24CRclgjxkiLaC7Z9uUWVrp61RfvdKxKwfwkX1DiqVc/igj50eB+ 36ICNaOI4pnuyg3jssSRdHhTWfFCoXXYuFrWM+ncPfgbzl9G7QyvH3TesJfpGKLSVNlB 7UbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=NHq3SsOIXxGqn68BkF5wHWkXBhuAURjJR1pvGaDJJYw=; b=LaDC+8xM7FT935CWbNcOwXwLF67x01JsOGp1O7VV2hV08M2HRvthVjO5JHb2gARawA 0Dm3uRB6PhO8fPJsGuwR487ayAm5up12NfVYmJ7cWLHZQIu552kGy097M6AkjL6yVYAj 4DWw4w0dTo5lAcigLwbBDagsORlRzxgjQWPRVh7OWEjhrcDeSKjQIHawpPceTm6u6GlZ hZOhi0tD8xJRPyMBAk4iq7P7Pbj6wC8ArbERqgDNciBHIUKedxc42plKGUEgqJJpaG3n VmP7fDBCjPb3rZEmcHo6NvOigP+nLP6vBK5NvhvwdOKvdsRmQJVVxfJX073EQQfwsLSe ah6w== ARC-Authentication-Results: i=1; mx.google.com; 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 h9si4762956plb.180.2018.12.14.11.43.17; Fri, 14 Dec 2018 11:43:32 -0800 (PST) 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; 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 S1730682AbeLNTkv (ORCPT + 99 others); Fri, 14 Dec 2018 14:40:51 -0500 Received: from smtprelay0020.hostedemail.com ([216.40.44.20]:51879 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730467AbeLNTku (ORCPT ); Fri, 14 Dec 2018 14:40:50 -0500 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay01.hostedemail.com (Postfix) with ESMTP id 2D07F100E86C5; Fri, 14 Dec 2018 19:40:49 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::::::::,RULES_HIT:41:355:379:599:800:960:966:973:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2196:2199:2393:2553:2559:2562:2828:3138:3139:3140:3141:3142:3353:3622:3865:3866:3867:3868:3871:3872:4250:4321:4385:5007:6120:8603:9707:10004:10400:10450:10455:10848:11026:11232:11473:11658:11914:12296:12740:12760:12895:13069:13161:13229:13255:13311:13357:13439:14096:14097:14181:14659:14721:19904:19999:21080:21451:21627:30054:30090:30091,0,RBL:47.151.153.53:@perches.com:.lbl8.mailshell.net-62.8.0.100 64.201.201.201,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:29,LUA_SUMMARY:none X-HE-Tag: rail13_411a7fb9b8703 X-Filterd-Recvd-Size: 2213 Received: from XPS-9350.home (unknown [47.151.153.53]) (Authenticated sender: joe@perches.com) by omf13.hostedemail.com (Postfix) with ESMTPA; Fri, 14 Dec 2018 19:40:47 +0000 (UTC) Message-ID: <0192c1984f42ad0a33e4c9aca04df90c97ebf412.camel@perches.com> Subject: Re: [RFC 2/4] mm: separate memory allocation and actual work in alloc_vmap_area() From: Joe Perches To: Matthew Wilcox , Roman Gushchin Cc: linux-mm@kvack.org, Alexey Dobriyan , Johannes Weiner , Michal Hocko , Vlastimil Babka , linux-kernel@vger.kernel.org, kernel-team@fb.com, Roman Gushchin Date: Fri, 14 Dec 2018 11:40:45 -0800 In-Reply-To: <20181214181322.GC10600@bombadil.infradead.org> References: <20181214180720.32040-1-guro@fb.com> <20181214180720.32040-3-guro@fb.com> <20181214181322.GC10600@bombadil.infradead.org> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.30.1-1build1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2018-12-14 at 10:13 -0800, Matthew Wilcox wrote: > On Fri, Dec 14, 2018 at 10:07:18AM -0800, Roman Gushchin wrote: > > +/* > > + * Allocate a region of KVA of the specified size and alignment, within the > > + * vstart and vend. > > + */ > > +static struct vmap_area *alloc_vmap_area(unsigned long size, > > + unsigned long align, > > + unsigned long vstart, > > + unsigned long vend, > > + int node, gfp_t gfp_mask) > > +{ > > + struct vmap_area *va; > > + int ret; > > + > > + va = kmalloc_node(sizeof(struct vmap_area), > > + gfp_mask & GFP_RECLAIM_MASK, node); > > + if (unlikely(!va)) > > + return ERR_PTR(-ENOMEM); > > + > > + ret = init_vmap_area(va, size, align, vstart, vend, node, gfp_mask); > > + if (ret) { > > + kfree(va); > > + return ERR_PTR(ret); > > + } > > + > > + return va; > > } > > > > + > > Another spurious blank line? I don't think so. I think it is the better style to separate the error return from the normal return. > With these two fixed, > Reviewed-by: Matthew Wilcox >