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=-9.5 required=3.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT 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 52C6EFA372B for ; Wed, 16 Oct 2019 09:54:55 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 16B1F2168B for ; Wed, 16 Oct 2019 09:54:55 +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 16B1F2168B 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) Received: by kanga.kvack.org (Postfix, from userid 40) id 946E58E0001; Wed, 16 Oct 2019 05:54:53 -0400 (EDT) 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-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-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 Content-Transfer-Encoding: quoted-printable 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) --- 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 =3D kmem_cache_alloc(vmap_area_cachep, GFP_NOWAIT); if (!lva) --=20 2.20.1