From patchwork Mon Oct 17 16:02:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uladzislau Rezki X-Patchwork-Id: 13009011 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7EDBBC43219 for ; Mon, 17 Oct 2022 16:02:51 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0A1CA8E0005; Mon, 17 Oct 2022 12:02:48 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id ECFB98E0001; Mon, 17 Oct 2022 12:02:47 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D4C578E0005; Mon, 17 Oct 2022 12:02:47 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id C41568E0001 for ; Mon, 17 Oct 2022 12:02:47 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 8B7571C673C for ; Mon, 17 Oct 2022 16:02:47 +0000 (UTC) X-FDA: 80030909574.20.5C5420A Received: from mail-ej1-f49.google.com (mail-ej1-f49.google.com [209.85.218.49]) by imf09.hostedemail.com (Postfix) with ESMTP id 85684140030 for ; Mon, 17 Oct 2022 16:02:46 +0000 (UTC) Received: by mail-ej1-f49.google.com with SMTP id d26so25979431ejc.8 for ; Mon, 17 Oct 2022 09:02:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=AFb/7zwjqK5CQviz80hJ2NborTj9HM/1n8g5QJGdbSg=; b=YiYXWC+QyyMRmUFikBr8oB0Y1Dv5Ak0+JU9eRaISPncrUtmk74un588/6vLUW20FX2 lcsMHUj1ia8PYSlFC9HVKa8LYI5/Yh0TjGpkQyJZZ4YS0bm/QH6Rv2CFRjtHZBT3b3pT 0+BPG/BTVuhoW6zArG3Q9DVL9nBrJkcTvqqVQu/jOMiJKoe+vM3ZZ6pcDUDpv1pb0fcM 4tAtotDnjQBySPAXfmWgfyTTefQF78FTuW3MoxUtYOQjsfkM6atHxIjLRfvQcYVxkVuy ova4Mkw2DwcL0fxYGdC/Heno/OPCahBGre0elnEAC15yZWG8R1irKhQOqHbNR3mi0PHl r5gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=AFb/7zwjqK5CQviz80hJ2NborTj9HM/1n8g5QJGdbSg=; b=ZuVMEosFd+zJXsvvlK2fX+A5xZVmDvKSrpANFQkpO8PsihFdPHvA+/Cj7I1KyjkpGm KXdu4OGGtZ36xfjYtq4FQTeq6GhZ8QAbyur+3lyI3Ds501vE3+GY4yyvo/P56xiwSIyM RsMiZU3IlRSIxr0xz6jjNd1VxJYP6xLiv9QKhsEUjuMMKNdBb672g5n8lPpnk4MtPxrl pzeoHYkLXJ9+6Nn6L3A/e5p4hgFVMNFmTyQlztgNTBzWRa7Pw1syfq3xWu/Ac4IbKbvs hkkVhtqnLKdHccPxuH4Ay6ZDbiWnBRPw03mXvYIAtRWDDaIwAsMZ9bq/mc6puIBKhdlK 3+Cg== X-Gm-Message-State: ACrzQf3oVbIDTwSKew2sH2aXzEcg9acEqU3WdDNH4Aau6cX2UNW0fXGJ dRswjJjQzPvdGHY+/jNbnHA= X-Google-Smtp-Source: AMsMyM53rJaLhk4GwF6LlPSoomVfcARTFPfJm/NqfYLKgstdDAxVM5szNB2fF2xkAFkG5XJVLI5fRQ== X-Received: by 2002:a17:907:3f94:b0:78d:9d2f:3002 with SMTP id hr20-20020a1709073f9400b0078d9d2f3002mr9099892ejc.40.1666022565358; Mon, 17 Oct 2022 09:02:45 -0700 (PDT) Received: from pc638.lan ([155.137.26.201]) by smtp.gmail.com with ESMTPSA id g16-20020a170906539000b0073d5948855asm6389629ejo.1.2022.10.17.09.02.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Oct 2022 09:02:44 -0700 (PDT) From: "Uladzislau Rezki (Sony)" To: Andrew Morton Cc: linux-mm@kvack.org, LKML , Christoph Hellwig , Matthew Wilcox , Nicholas Piggin , Uladzislau Rezki , Oleksiy Avramchenko , Steven Rostedt Subject: [PATCH 6/7] mm/vmalloc: Use a trace_free_vmap_area_noflush event Date: Mon, 17 Oct 2022 18:02:32 +0200 Message-Id: <20221017160233.16582-9-urezki@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221017160233.16582-1-urezki@gmail.com> References: <20221017160233.16582-1-urezki@gmail.com> MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1666022566; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=AFb/7zwjqK5CQviz80hJ2NborTj9HM/1n8g5QJGdbSg=; b=5iGugFyJgOpYCzmrIyrLbvky5X0pLrLs6wDtVGyPAsNJl/GzJdJeiH11yCOzh6oYC9eVah kHJyuYmiLtvEyVt/khMBPQirrBNadaoLduJsfSyPVrpzDN2Un0UPOmuSkJxnI6zE0incDi WDWOK+yK4wYQJtDWb/k5dwL5P4EELVI= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=YiYXWC+Q; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf09.hostedemail.com: domain of urezki@gmail.com designates 209.85.218.49 as permitted sender) smtp.mailfrom=urezki@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1666022566; a=rsa-sha256; cv=none; b=EBVJj0zwWu8BKjLA6rrjMHQbkgfAZjvNVHaJUI0qlOcXYcc83dS6SfPMfH+WfnLlPbhhHG u471mxy/+uDddZ0ilYeZaECdrktB1HTfCijz4e1YvGyGpYxx1ag6zTAEI+BuICdfBFYx+B ZHDxxpqtFfTZ8hceUARsQqaCpMOTsCM= Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=YiYXWC+Q; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf09.hostedemail.com: domain of urezki@gmail.com designates 209.85.218.49 as permitted sender) smtp.mailfrom=urezki@gmail.com X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 85684140030 X-Rspam-User: X-Stat-Signature: g9yk5d8iqxazxxxmq8wca3tobfzqrdfq X-HE-Tag: 1666022566-190166 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: It is for a debug purpose and is called when a vmap area gets freed. This event gives some indication about: - a start address of released area; - a current number of outstanding pages; - a maximum number of allowed outstanding pages. Cc: Steven Rostedt Signed-off-by: Uladzislau Rezki (Sony) --- mm/vmalloc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mm/vmalloc.c b/mm/vmalloc.c index 912abcd6e8b4..df4fd6674ced 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -1822,6 +1822,8 @@ static void drain_vmap_area_work(struct work_struct *work) */ static void free_vmap_area_noflush(struct vmap_area *va) { + unsigned long nr_lazy_max = lazy_max_pages(); + unsigned long va_start = va->va_start; unsigned long nr_lazy; spin_lock(&vmap_area_lock); @@ -1839,8 +1841,10 @@ static void free_vmap_area_noflush(struct vmap_area *va) &purge_vmap_area_root, &purge_vmap_area_list); spin_unlock(&purge_vmap_area_lock); + trace_free_vmap_area_noflush(va_start, nr_lazy, nr_lazy_max); + /* After this point, we may free va at any time */ - if (unlikely(nr_lazy > lazy_max_pages())) + if (unlikely(nr_lazy > nr_lazy_max)) schedule_work(&drain_vmap_work); }