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=-8.5 required=3.0 tests=INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham 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 32726FA372A for ; Wed, 16 Oct 2019 11:07:26 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id F002020854 for ; Wed, 16 Oct 2019 11:07:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F002020854 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 9AA128E0013; Wed, 16 Oct 2019 07:07:25 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 95A1D8E0001; Wed, 16 Oct 2019 07:07:25 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8704A8E0013; Wed, 16 Oct 2019 07:07:25 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0073.hostedemail.com [216.40.44.73]) by kanga.kvack.org (Postfix) with ESMTP id 6517E8E0001 for ; Wed, 16 Oct 2019 07:07:25 -0400 (EDT) Received: from smtpin15.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with SMTP id C0EFB4DD9 for ; Wed, 16 Oct 2019 11:07:24 +0000 (UTC) X-FDA: 76049371608.15.cork96_6770a0ab1752 X-HE-Tag: cork96_6770a0ab1752 X-Filterd-Recvd-Size: 3203 Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) by imf07.hostedemail.com (Postfix) with ESMTP for ; Wed, 16 Oct 2019 11:07:24 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 012BAB1FF; Wed, 16 Oct 2019 11:07:23 +0000 (UTC) Date: Wed, 16 Oct 2019 13:07:22 +0200 From: Michal Hocko To: "Uladzislau Rezki (Sony)" Cc: Andrew Morton , Daniel Wagner , Sebastian Andrzej Siewior , Thomas Gleixner , linux-mm@kvack.org, LKML , Peter Zijlstra , Hillf Danton , Matthew Wilcox , Oleksiy Avramchenko , Steven Rostedt Subject: Re: [PATCH v3 3/3] mm/vmalloc: add more comments to the adjust_va_to_fit_type() Message-ID: <20191016110722.GU317@dhcp22.suse.cz> References: <20191016095438.12391-1-urezki@gmail.com> <20191016095438.12391-3-urezki@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191016095438.12391-3-urezki@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) 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 16-10-19 11:54:38, Uladzislau Rezki (Sony) wrote: > When fit type is NE_FIT_TYPE there is a need in one extra object. > Usually the "ne_fit_preload_node" per-CPU variable has it and > there is no need in GFP_NOWAIT allocation, but there are exceptions. > > This commit just adds more explanations, as a result giving > answers on questions like when it can occur, how often, under > which conditions and what happens if GFP_NOWAIT gets failed. > > Signed-off-by: Uladzislau Rezki (Sony) Acked-by: Michal Hocko > --- > mm/vmalloc.c | 13 +++++++++++++ > 1 file changed, 13 insertions(+) > > diff --git a/mm/vmalloc.c b/mm/vmalloc.c > index 593bf554518d..2290a0d270e4 100644 > --- a/mm/vmalloc.c > +++ b/mm/vmalloc.c > @@ -969,6 +969,19 @@ adjust_va_to_fit_type(struct vmap_area *va, > * There are a few exceptions though, as an example it is > * a first allocation (early boot up) when we have "one" > * big free space that has to be split. > + * > + * Also we can hit this path in case of regular "vmap" > + * allocations, if "this" current CPU was not preloaded. > + * See the comment in alloc_vmap_area() why. If so, then > + * GFP_NOWAIT is used instead to get an extra object for > + * split purpose. That is rare and most time does not > + * occur. > + * > + * What happens if an allocation gets failed. Basically, > + * an "overflow" path is triggered to purge lazily freed > + * areas to free some memory, then, the "retry" path is > + * triggered to repeat one more time. See more details > + * in alloc_vmap_area() function. > */ > lva = kmem_cache_alloc(vmap_area_cachep, GFP_NOWAIT); > if (!lva) > -- > 2.20.1 > -- Michal Hocko SUSE Labs