Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp179529pxb; Tue, 19 Oct 2021 00:03:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJykT8u3fNax4PEsaiP4czqi2TQMO6f/6bsr+opdrhHOvl6QjOeLEQIcND3qBCRYlYu2kGUN X-Received: by 2002:a17:906:33d7:: with SMTP id w23mr37623780eja.154.1634627014287; Tue, 19 Oct 2021 00:03:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634627014; cv=none; d=google.com; s=arc-20160816; b=0Iqbe4cSG0pQyieKxlZn3hUNBUGyc/5eXiBsvqCfhAoskDPaBMdp8AsWSLSUmIlpVZ +9OTYLelssnjOionXPHy5SqrRVZa1HBgvqbYwMlSLzVv1YtTR9kE8Enb0ftok/ScKj+O 8dDDG+JAaluRv878ccod273uHZaM8P46ku524AlOfmKeSu768uvKSmS+d1LBP6U4i8qx eobUTtf+HGrxpcnZKfxq8ZtSeUw4eaVSfIKU7/O9siBAd6VILt6E2RA7vtR1bJE52SPm eXc1ylwYFYUc6cKyKtqajzlEQJKJCJ9b28cJfr2mjBQB8TWJli+mYEtcWJznevDWjdRM TOwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=tWUYrvYFsmqj0rtE1yYDBB9n74JxtnDP+Db2R7/QIZk=; b=nOCY4ro/XnwhUTxjiqGZPOE0qQsVCneQZVhklFiDxMYUlPPa0ByXKun5DFeF8cZqzF CF6oycUpIPcPzemHTEEJvs+7jeNFIAMwtx8I4+SZhrlztOyEjCc0Tn70oPn6ZPuHPm+h k4jdobyAWOxAuu7p1DkWYKgFvzGxyFoBjka860BBofQDm138O0Q3tvHvyDCKjdmQyu2N A/7bm9Kjrea03Wj9jQ0oz1U7Yp3Y7V3RgmPJknzxTUjHqaJ6pVe1puWISUc3jjwkY3ch DvPfSdLqratNYbyJsLCgnUmf+HR1MxGq3W80GD9E0QF/hPQWCsFWQloD6YuDBNGTtrOX g7oA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=aOKILhuQ; 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; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v4si20505830edi.519.2021.10.19.00.03.04; Tue, 19 Oct 2021 00:03:34 -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=pass header.i=@suse.com header.s=susede1 header.b=aOKILhuQ; 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; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234299AbhJSHBr (ORCPT + 99 others); Tue, 19 Oct 2021 03:01:47 -0400 Received: from smtp-out1.suse.de ([195.135.220.28]:52374 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229649AbhJSHBq (ORCPT ); Tue, 19 Oct 2021 03:01:46 -0400 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 8524B2197E; Tue, 19 Oct 2021 06:59:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1634626772; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=tWUYrvYFsmqj0rtE1yYDBB9n74JxtnDP+Db2R7/QIZk=; b=aOKILhuQ3bfvUS+uulyoyUwQPgpO7HbSEhf/Qg6dySM8FGEpcm+k1lR28mAXp0HBTon9vL 8PkJYte5qeY7ri2k3Wvd1FWSq26EnbEBoc/DjuHwYSl5NRnjE3+RmqAybogg6PvMoZGXPb AGUfeDziG1cpHLYVPK7hNtwMMjRq3HA= Received: from suse.cz (unknown [10.100.201.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 53C49A3B81; Tue, 19 Oct 2021 06:59:32 +0000 (UTC) Date: Tue, 19 Oct 2021 08:59:30 +0200 From: Michal Hocko To: NeilBrown Cc: linux-mm@kvack.org, Dave Chinner , Andrew Morton , Christoph Hellwig , Uladzislau Rezki , linux-fsdevel@vger.kernel.org, LKML , Ilya Dryomov , Jeff Layton Subject: Re: [RFC 1/3] mm/vmalloc: alloc GFP_NO{FS,IO} for vmalloc Message-ID: References: <20211018114712.9802-1-mhocko@kernel.org> <20211018114712.9802-2-mhocko@kernel.org> <163460424165.17149.585825289709126969@noble.neil.brown.name> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <163460424165.17149.585825289709126969@noble.neil.brown.name> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 19-10-21 11:44:01, Neil Brown wrote: > On Mon, 18 Oct 2021, Michal Hocko wrote: [...] > > @@ -2930,8 +2932,24 @@ static void *__vmalloc_area_node(struct vm_struct *area, gfp_t gfp_mask, > > goto fail; > > } > > > > - if (vmap_pages_range(addr, addr + size, prot, area->pages, > > - page_shift) < 0) { > > + /* > > + * page tables allocations ignore external gfp mask, enforce it > > + * by the scope API > > + */ > > + if ((gfp_mask & (__GFP_FS | __GFP_IO)) == __GFP_IO) > > + flags = memalloc_nofs_save(); > > + else if (!(gfp_mask & (__GFP_FS | __GFP_IO))) > > I would *much* rather this were written > > else if ((gfp_mask & (__GFP_FS | __GFP_IO)) == 0) Sure, this looks better indeed. > so that the comparison with the previous test is more obvious. Ditto > for similar code below. > It could even be > > switch (gfp_mask & (__GFP_FS | __GFP_IO)) { > case __GFP__IO: flags = memalloc_nofs_save(); break; > case 0: flags = memalloc_noio_save(); break; > } > > But I'm not completely convinced that is an improvement. I am not a great fan of this though. > In terms of functionality this looks good. Thanks for the review! -- Michal Hocko SUSE Labs