From patchwork Tue Oct 18 18:10:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uladzislau Rezki X-Patchwork-Id: 13010878 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 B8754C43217 for ; Tue, 18 Oct 2022 18:11:05 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 26C466B0080; Tue, 18 Oct 2022 14:11:05 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 21F136B0081; Tue, 18 Oct 2022 14:11:05 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 070A26B0082; Tue, 18 Oct 2022 14:11:05 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id DE2C46B0080 for ; Tue, 18 Oct 2022 14:11:04 -0400 (EDT) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 7A4F8160BB0 for ; Tue, 18 Oct 2022 18:11:04 +0000 (UTC) X-FDA: 80034861648.25.7B71747 Received: from mail-ed1-f45.google.com (mail-ed1-f45.google.com [209.85.208.45]) by imf08.hostedemail.com (Postfix) with ESMTP id 052F3160036 for ; Tue, 18 Oct 2022 18:11:03 +0000 (UTC) Received: by mail-ed1-f45.google.com with SMTP id m16so21757213edc.4 for ; Tue, 18 Oct 2022 11:11:03 -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=Pi0tjzbLmXgGsglusGmrSt3nKwzpPKhOzNGgAFj4deM=; b=J35hy3hbYScd9cIdMAW/EhRXhuMHkMIbXqlAvSSnIY27KTlIg7uboTgd1AXcX9OjBP LgOnwf6MOgzur7qqpFElJ+91KdHC0ymafDroc/4r9m9fvtrFxMQNj/P4JPFSO7KMJ2yF 7CRJPh6bVA4+3AI3/mB5yiwzHi04YCVk4opiXmufUS3us8kpBR0bh+xpivtbT8raOFG/ 8BJHX4mlM1kUnQnOCnPGnh6I3hGjOSCIqsE8kppaSzYHBhFVY2ATiB6PRNpt4zm1yImZ LLRwpgnP/nA/8JUwlPgFQ8y8u27DXDnSOTZfG5AGSwsGR9d51XvYbm41HFGhdvz3fwYp plzQ== 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=Pi0tjzbLmXgGsglusGmrSt3nKwzpPKhOzNGgAFj4deM=; b=5wSMIUncMqk7yalONGSxlPmZFNLA3+Yb/rXpBBnDJ1fmXPmV7MWwGESBsryh9YSz6+ gCr0/jG7jQBXec+Wp5FmcTb/IRP1dSYrDxOK6C3kliIVTfz/dBRxTTyqT3XzsYqwv681 YXluOXMON4OI/9N8TiQF7MuzuUc/kqjq1MxRfi2VxPGlU4tKdfuTbMgAwE472LFyk+tC QJ/uMDADmk26sjhQebvy6V6K4BBGd+/PpSV5dHQHnsNZI7dUHupZIj2pLiJbrJCK6sMq NPTNpj4pyFhNfvAwmSY0m/HwdFRBEatw6d7CE7sVcQFweUNqj7JQU+5YxpEcwSIfuoh8 92Iw== X-Gm-Message-State: ACrzQf24Osn93TsjKorjcQ1efZJtXlfyV2DssU7vrpdvhiZQEc2wOtgU bTjgpv8+l9JxElbuioSqMDI= X-Google-Smtp-Source: AMsMyM5Zl8vwJg/6ezF7ChkqFZClQkn3o+MqhrKUy+U0XHnl5bkuEf36aH9F8/4DjW9zC42HhN7ebg== X-Received: by 2002:a05:6402:1d53:b0:45e:ec87:686e with SMTP id dz19-20020a0564021d5300b0045eec87686emr2362032edb.380.1666116662826; Tue, 18 Oct 2022 11:11:02 -0700 (PDT) Received: from pc638.lan ([155.137.26.201]) by smtp.gmail.com with ESMTPSA id c1-20020a17090618a100b007877ad05b32sm7739302ejf.208.2022.10.18.11.11.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Oct 2022 11:11:02 -0700 (PDT) From: "Uladzislau Rezki (Sony)" To: Andrew Morton Cc: linux-mm@kvack.org, LKML , Christoph Hellwig , Matthew Wilcox , Nicholas Piggin , Steven Rostedt , Uladzislau Rezki , Oleksiy Avramchenko Subject: [PATCH v2 6/7] mm: vmalloc: Use trace_free_vmap_area_noflush event Date: Tue, 18 Oct 2022 20:10:52 +0200 Message-Id: <20221018181053.434508-7-urezki@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221018181053.434508-1-urezki@gmail.com> References: <20221018181053.434508-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=1666116664; 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=Pi0tjzbLmXgGsglusGmrSt3nKwzpPKhOzNGgAFj4deM=; b=BsWlK5S31HKLmTtOVWzggRittX1QqpQ2kGYg4JQV1+RMOPlk8uU61sFnpyth1ytcQHKSGb 6JsvbyBXl0ayVax4OyZ7HpZOGQHNrbvM0sz0WSbwQt3/w6YtYQN3eolT6BJxl3O5c+gyo3 MWBIk7wPKo/9lxzt9V8PKPmIOelAhfs= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=J35hy3hb; spf=pass (imf08.hostedemail.com: domain of urezki@gmail.com designates 209.85.208.45 as permitted sender) smtp.mailfrom=urezki@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1666116664; a=rsa-sha256; cv=none; b=6b0MbN+A4XQ6mXcqAlkMG2d9nluCE4nMbytZAKqAHH9WhwlTBirXUfb7CAgrPH8lSAjMMJ bt5OvjfHd3yqAzTAQbfQfgOUD1NOYOSgLZTyCWMvxFZ5xVp726bdMolymWztISivoYkv5g nL4OeQqY5cnIiumUnBvyHFbn6mVjRC4= Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=J35hy3hb; spf=pass (imf08.hostedemail.com: domain of urezki@gmail.com designates 209.85.208.45 as permitted sender) smtp.mailfrom=urezki@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-Stat-Signature: k6zdkaif17tidoboh5e97d56btgbrkuj X-Rspamd-Queue-Id: 052F3160036 X-Rspam-User: X-Rspamd-Server: rspam04 X-HE-Tag: 1666116663-223731 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. Signed-off-by: Uladzislau Rezki (Sony) Reviewed-by: Christoph Hellwig --- mm/vmalloc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mm/vmalloc.c b/mm/vmalloc.c index 4292f44ae670..bd56f68bedf0 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); }