From patchwork Mon Oct 17 16:02:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uladzislau Rezki X-Patchwork-Id: 13009013 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 A5237C433FE for ; Mon, 17 Oct 2022 16:08:54 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 111456B0074; Mon, 17 Oct 2022 12:08:54 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0C2056B0078; Mon, 17 Oct 2022 12:08:54 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EF2126B007B; Mon, 17 Oct 2022 12:08:53 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id E16366B0074 for ; Mon, 17 Oct 2022 12:08:53 -0400 (EDT) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id B90E3A0822 for ; Mon, 17 Oct 2022 16:08:53 +0000 (UTC) X-FDA: 80030924946.10.4504B89 Received: from mail-ej1-f52.google.com (mail-ej1-f52.google.com [209.85.218.52]) by imf11.hostedemail.com (Postfix) with ESMTP id 628F940034 for ; Mon, 17 Oct 2022 16:08:53 +0000 (UTC) Received: by mail-ej1-f52.google.com with SMTP id d26so26020112ejc.8 for ; Mon, 17 Oct 2022 09:08:53 -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=bk+KWgdlkiB+MWNzeR3WbAzUisj6JegHIR27QQQBgyQ=; b=omsUcwkM80T1HQfQByTwzQSSPIQo9VSPQ1minBRX8rzy6SbPGixUEBE2JXOujAa6uU /e/HMGViiP2taAM5sQo+EcgsE05mL14PgOfQja08E1ZZdNtuNlSWGCVBR2sHIy3q2nI1 mphMO3QpS5U7jQxSpW7nPoESPS14DMXTB7PM5ynBKRIohJMyKbYkXh8Zu53N8j1wdBLT cW/XTANXBAJ9V24Ds87XvC6xvHTgEu7+kwW0Ay3h1Iu/Vu0GstEKCWlkOr4X7rnBLNa2 WpLSDMa2+m+p3z846rzU4qw9mG4GOwP+XF5TrnV6HEeehFb/EWq17jyKIJHZm4aBU7wT 8S3Q== 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=bk+KWgdlkiB+MWNzeR3WbAzUisj6JegHIR27QQQBgyQ=; b=ZASjjlVvCdZ0d3fsa2skyvYhl4pLImXNZ9dASm/03a62TBRv26sER04DUG+dbBsfZA w16qWv3fQNXX4MtNnlStpcluOispwKbKXVuTtH2Zku7wKFwEWe7PQUJYGQ1Ig7RjXQWy TbcxqdD85z7L8XDFyyZgjgT0uURmL52UCWNsuN0U6V37IJiu1G4SsIbBXdap591lQZcU OA4+JGBoxv8NK7rcgxFF06Q4zA8pSJcwvd0lQ+3Uo8t93BKUUlBbtcN9lrUF2snSwh6w SG3A1+Hd4ib94aQ5LQ6FnnM8vsL5uen3abl2cXV0ZGnUDGQKtWTpkKyKQ9hM01Ffkgdk deHw== X-Gm-Message-State: ACrzQf2qztKDVs4pE4plYFcKoEzIVk7dPMyYuvIVZp4gvtGi8MBn93CD TudYS3F2NlsL+145uCGTRnTdWd0/bVM= X-Google-Smtp-Source: AMsMyM5N8ZQLeNkoN0ubApdyoZVPYzXh3UKtjk6V1dRHUvCK+wRZxfEtOygHvSJU00j5uoC42C8N3g== X-Received: by 2002:aa7:d454:0:b0:459:9ae7:725b with SMTP id q20-20020aa7d454000000b004599ae7725bmr10881077edr.165.1666022564305; Mon, 17 Oct 2022 09:02:44 -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.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Oct 2022 09:02:43 -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 5/7] mm/vmalloc: Use a trace_purge_vmap_area_lazy event Date: Mon, 17 Oct 2022 18:02:31 +0200 Message-Id: <20221017160233.16582-8-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-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1666022933; a=rsa-sha256; cv=none; b=ZRP3WyI6NNlWqaq/+JgE4+qfdg3W+m+9k7unKiChoB1+CJdUgm7PC2Gn9DNOQA03Uappj7 /QsNOwz9j893wsdvCt0ILhoKfEcVrxDmwInUchksGgAu6YnveEBTIZaYTHzeZ1leFr/2Yp Cqw3biFqgDwzOI25YnOY6BNIsvgvCTI= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=omsUcwkM; spf=pass (imf11.hostedemail.com: domain of urezki@gmail.com designates 209.85.218.52 as permitted sender) smtp.mailfrom=urezki@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1666022933; 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=bk+KWgdlkiB+MWNzeR3WbAzUisj6JegHIR27QQQBgyQ=; b=BHE+pFky/OIdDEMYQihfiOOV/g8TI37plmOtknmmMr4O/s4EysdwFjCfyx/oAP0/d47CWB eGgAsy7rQXkW5tWXm9s3Q0eYrP+0FvD/02Zn/MINgCuBCFdYMxe9sEijzCJDV8kAllF0jG 04QqfWOCUn57aO8BLu8W2FZ+uMjg45o= X-Rspam-User: Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=omsUcwkM; spf=pass (imf11.hostedemail.com: domain of urezki@gmail.com designates 209.85.218.52 as permitted sender) smtp.mailfrom=urezki@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-Stat-Signature: 7nf4cgzgagsbiep4khke4eaerj58xdt9 X-Rspamd-Queue-Id: 628F940034 X-Rspamd-Server: rspam10 X-HE-Tag: 1666022933-18684 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: This is for debug purpose and is called when all outstanding areas are removed back to the vmap space. It gives some extra information about: - a start:end range where set of vmap ares were freed; - a number of purged areas which were backed off. Cc: Steven Rostedt Signed-off-by: Uladzislau Rezki (Sony) --- mm/vmalloc.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/mm/vmalloc.c b/mm/vmalloc.c index f4397817ccd7..912abcd6e8b4 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -1731,6 +1731,7 @@ static void purge_fragmented_blocks_allcpus(void); static bool __purge_vmap_area_lazy(unsigned long start, unsigned long end) { unsigned long resched_threshold; + unsigned int num_purged_areas = 0; struct list_head local_purge_list; struct vmap_area *va, *n_va; @@ -1742,7 +1743,7 @@ static bool __purge_vmap_area_lazy(unsigned long start, unsigned long end) spin_unlock(&purge_vmap_area_lock); if (unlikely(list_empty(&local_purge_list))) - return false; + goto out; start = min(start, list_first_entry(&local_purge_list, @@ -1777,12 +1778,16 @@ static bool __purge_vmap_area_lazy(unsigned long start, unsigned long end) va->va_start, va->va_end); atomic_long_sub(nr, &vmap_lazy_nr); + num_purged_areas++; if (atomic_long_read(&vmap_lazy_nr) < resched_threshold) cond_resched_lock(&free_vmap_area_lock); } spin_unlock(&free_vmap_area_lock); - return true; + +out: + trace_purge_vmap_area_lazy(start, end, num_purged_areas); + return num_purged_areas > 0 ? true:false; } /*