From patchwork Wed Oct 16 09:54:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uladzislau Rezki X-Patchwork-Id: 11192797 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 83739112B for ; Wed, 16 Oct 2019 09:54:56 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 462DB2168B for ; Wed, 16 Oct 2019 09:54:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ijBxkcdl" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 462DB2168B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 9BACE8E0009; Wed, 16 Oct 2019 05:54:53 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 946E58E0001; Wed, 16 Oct 2019 05:54:53 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 65E118E0009; Wed, 16 Oct 2019 05:54:53 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0231.hostedemail.com [216.40.44.231]) by kanga.kvack.org (Postfix) with ESMTP id 3A4BE8E0001 for ; Wed, 16 Oct 2019 05:54:53 -0400 (EDT) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with SMTP id 8B45C183D88C8 for ; Wed, 16 Oct 2019 09:54:52 +0000 (UTC) X-FDA: 76049188824.10.brick62_64b94d2152a0f X-Spam-Summary: 2,0,0,9a7d4c030e670cd7,d41d8cd98f00b204,urezki@gmail.com,:akpm@linux-foundation.org:dwagner@suse.de:bigeasy@linutronix.de:tglx@linutronix.de::linux-kernel@vger.kernel.org:peterz@infradead.org:urezki@gmail.com:hdanton@sina.com:mhocko@suse.com:willy@infradead.org:oleksiy.avramchenko@sonymobile.com:rostedt@goodmis.org,RULES_HIT:41:355:379:541:800:960:966:973:988:989:1260:1311:1314:1345:1359:1437:1515:1534:1541:1711:1730:1747:1777:1792:2196:2199:2393:2559:2562:3138:3139:3140:3141:3142:3353:3865:3866:3867:3868:3870:3871:3872:3874:4250:4321:4385:5007:6261:6653:6742:6755:7514:9413:10004:11026:11473:11658:11914:12043:12114:12219:12296:12297:12438:12517:12519:12555:12895:13069:13161:13210:13229:13311:13357:13894:14096:14181:14384:14394:14687:14721:21080:21324:21433:21444:21451:21627:21666:30054:30074,0,RBL:209.85.208.196:@gmail.com:.lbl8.mailshell.net-62.18.0.100 66.100.201.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNS BL:neutr X-HE-Tag: brick62_64b94d2152a0f X-Filterd-Recvd-Size: 4911 Received: from mail-lj1-f196.google.com (mail-lj1-f196.google.com [209.85.208.196]) by imf39.hostedemail.com (Postfix) with ESMTP for ; Wed, 16 Oct 2019 09:54:52 +0000 (UTC) Received: by mail-lj1-f196.google.com with SMTP id y23so23287159lje.9 for ; Wed, 16 Oct 2019 02:54:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=bZoZqPU58/r7tmZ5PSLpDxdfOuQtypWPAK4xAcMDbso=; b=ijBxkcdl1C3p3Gf7uWxe52LorIx/LjRVkwiJGk0CWquv3ePAFCZEe2wexe2Fz3JwPO esV4vb9Z4BI9Pngz2wu8YntDZSLjS9aeJKg33rADix7xL2qvVJEbliL8UkQYb2oodX/c nTFchhA2yD3GZXz7ytWbJY46syb/wzIKfh4MTYpfxArMLUOUe7dKXBE0yiyCYg9jS2YC SVTMBbaErQHePI585OlSi5XYmCK7LdQH3/ZYv7xon+fhEyTE2UK02EmGZwX+M7J/D5wL L+JIgM6+u7B2SbK9HioC8RlEabIcuXU0yWorEcyOtH9xhbt2n0flhgdI2OCdcRwHR9+c veTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=bZoZqPU58/r7tmZ5PSLpDxdfOuQtypWPAK4xAcMDbso=; b=R4DBYUvIvEOCHYkY/3Nf/DHw2fdCnKTNOtQ3Q9HWR+EeNaF543pI87YxWtkEX3lhb9 3gRhCLPw7XywAqBGtG6sYMQF8UGcFedQxoKvhYMkO+amkwqhsWyfUf0JOG8IaDehrj1U JzfdhnjM0x5xEOp1U+MF1WLXzAwvQ5eIB/ApAZ/LbzWHzsxRI2CXDvPzPSBYo+7oxp0V j/fZe9vBQI7giZB5AK2XtdHyaT61O+J580t7B5zISAOtak7I0JhayvxTJGsEuKJ5F9sf Z8qIV9CxJanYmsM4N6e2M4oEy5kpGFr1Ti+SfYJ31pPoCWsyCnGaaiEgc4Mpv2qasKNc 8ClA== X-Gm-Message-State: APjAAAXIHbB6EzYzZGHd/QjNxo4U3HpcpCfGas/cfuzZH32x0am+RECT T1oeUE3QXtRzt7f0rpQGwUs= X-Google-Smtp-Source: APXvYqzPH+636QBSKvduXVSag2KSoZKJjqlR0+ZPMMRfitxESnYfCgGkOEj80hsD56wUCQvi6U1GZw== X-Received: by 2002:a2e:9bcb:: with SMTP id w11mr24632508ljj.11.1571219690788; Wed, 16 Oct 2019 02:54:50 -0700 (PDT) Received: from pc636.semobile.internal ([37.139.158.167]) by smtp.gmail.com with ESMTPSA id b2sm886452lfq.27.2019.10.16.02.54.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Oct 2019 02:54:50 -0700 (PDT) From: "Uladzislau Rezki (Sony)" To: Andrew Morton Cc: Daniel Wagner , Sebastian Andrzej Siewior , Thomas Gleixner , linux-mm@kvack.org, LKML , Peter Zijlstra , Uladzislau Rezki , Hillf Danton , Michal Hocko , Matthew Wilcox , Oleksiy Avramchenko , Steven Rostedt Subject: [PATCH v3 3/3] mm/vmalloc: add more comments to the adjust_va_to_fit_type() Date: Wed, 16 Oct 2019 11:54:38 +0200 Message-Id: <20191016095438.12391-3-urezki@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191016095438.12391-1-urezki@gmail.com> References: <20191016095438.12391-1-urezki@gmail.com> MIME-Version: 1.0 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: 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)