From patchwork Tue Oct 18 18:10:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uladzislau Rezki X-Patchwork-Id: 13010877 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 8D453C4332F for ; Tue, 18 Oct 2022 18:11:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 182C26B007D; Tue, 18 Oct 2022 14:11:03 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0BFC76B007E; Tue, 18 Oct 2022 14:11:03 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E78756B0080; Tue, 18 Oct 2022 14:11:02 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id DC2496B007D for ; Tue, 18 Oct 2022 14:11:02 -0400 (EDT) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id B0C9C1A069D for ; Tue, 18 Oct 2022 18:11:02 +0000 (UTC) X-FDA: 80034861564.12.345F251 Received: from mail-ed1-f54.google.com (mail-ed1-f54.google.com [209.85.208.54]) by imf13.hostedemail.com (Postfix) with ESMTP id 4AC9820045 for ; Tue, 18 Oct 2022 18:11:02 +0000 (UTC) Received: by mail-ed1-f54.google.com with SMTP id q19so21712415edd.10 for ; Tue, 18 Oct 2022 11:11:02 -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=n8kMXp9BQAd3vgxARQi9NOKOPWDC+b4eB+IRpUUVrl4=; b=WfSPJEGUoF2C9KAvUYS570nptYgLA/TuWUM/Ysm9180aXj8gEJL6TR3123vRXv72s7 XFX+/7g1IMk6mf/h5jeA+hPg0nl725MnZQc7Q38P9jvAXr75fkC63/p0h5UmM5KUegTY D2z9K80d7tlDUECwTADSfkpPpF9Dk4ZY74npnitOV4oqWqarha84ZLQLT3Xz04BFACCB 8PwzK8coREdFHo8Pb8ZxRj4TRiqxAxYTK5AbtLBq81L/WTL8EF+6MFdsPxvosGw0b3DG dZSKqSkKwHzfCv+UALd5/k+1QbABrGTotVu4KWiVPzobmZURCQdTLLx2WkGmS1A3adcB T3Qg== 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=n8kMXp9BQAd3vgxARQi9NOKOPWDC+b4eB+IRpUUVrl4=; b=6oKnk7UamsQDsCbJU/biOGin20OUCqrbsEkr8IH2uS1bXsnRcvGh/HjePtF4GXDYuo bQurFqXAQ08FeldPUCftc34DT3TanaHfEXOoGP8OyFRGWUKk8Eyz9TDm4YWNDfB0Ogqy dVnZSgWjpXgkvmkafUYPv+/DbzAvQJlcbAnQTGz/UOiFHr5UP6kk4W59m/FdwynoDZ3o ua1dIExwGkjb6ZyvWRaz/ZkFz08BlIzm8KTqOIcyx+dpzx7ka6awYGbN15o3PQjsUnOM gTRFtgtTOZyoUD7i4i0iZ2jIEaErOTEEYaxwGUm4rIbgoMgnWBiF1ZVcHvGDJU9qv2RY Zzmg== X-Gm-Message-State: ACrzQf236/duRA4z6iz9mJW1f7hjqjNDTF/olYOxYJFeXPO+AeGYPh/g gF4+WjMKA4dbUsq/IlRz2dM= X-Google-Smtp-Source: AMsMyM7ijjHus1bRUjHQvJYBGDCBkNK0BwtjzEw9/bAky47EzLnOn5lKf4DXyLK+rkXid4XZJwz9xA== X-Received: by 2002:a05:6402:f96:b0:459:4180:6cf4 with SMTP id eh22-20020a0564020f9600b0045941806cf4mr3805343edb.64.1666116661749; Tue, 18 Oct 2022 11:11:01 -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.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Oct 2022 11:11:01 -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 5/7] mm: vmalloc: Use trace_purge_vmap_area_lazy event Date: Tue, 18 Oct 2022 20:10:51 +0200 Message-Id: <20221018181053.434508-6-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=1666116662; 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=n8kMXp9BQAd3vgxARQi9NOKOPWDC+b4eB+IRpUUVrl4=; b=dTv6g+AIbY1bMT40Tp4xslvQoxVpw101wPqAAz9doYI2Ysd9MDIz1CTXKfU3zL4LZdcIH9 /eKiW6fRE5o2C+PrpuGl703z91/vUbYwCKIufTKH71QmTumElZxh+w+BreQYu8rVENdtMO +9xZaWHqISoYB+a2AH6U5tutvVWV/y0= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=WfSPJEGU; spf=pass (imf13.hostedemail.com: domain of urezki@gmail.com designates 209.85.208.54 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=1666116662; a=rsa-sha256; cv=none; b=MwuLM5T/0n6evF1o4nMZ3PKgUOodVVtD1kH2xbYiR4U4O3WvZlwKmMbvuTm0C1hxPy2z0x jEjM93gtYPSRwrgWxM7upr/M4l/YTFx/NgXqQ0b+JqYfMMQusMM2CS9Tm6/USZFZcPa6QL mK6kEfQ73zU4L84XVFNUeCIvKPrerkM= X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 4AC9820045 X-Rspam-User: Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=WfSPJEGU; spf=pass (imf13.hostedemail.com: domain of urezki@gmail.com designates 209.85.208.54 as permitted sender) smtp.mailfrom=urezki@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-Stat-Signature: a7ox33tihgi4ehbzkmh1chswk8bexfnx X-HE-Tag: 1666116662-698367 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. Signed-off-by: Uladzislau Rezki (Sony) Reviewed-by: Christoph Hellwig --- mm/vmalloc.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/mm/vmalloc.c b/mm/vmalloc.c index aa86f21bfad0..4292f44ae670 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; } /*