From patchwork Mon Oct 17 16:02:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uladzislau Rezki X-Patchwork-Id: 13009005 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 03C00C43217 for ; Mon, 17 Oct 2022 16:02:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8900E6B0075; Mon, 17 Oct 2022 12:02:40 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 819726B0078; Mon, 17 Oct 2022 12:02:40 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 693C66B007B; Mon, 17 Oct 2022 12:02:40 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 5BAD66B0075 for ; Mon, 17 Oct 2022 12:02:40 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 25681AB420 for ; Mon, 17 Oct 2022 16:02:40 +0000 (UTC) X-FDA: 80030909280.19.ECA655F Received: from mail-ej1-f48.google.com (mail-ej1-f48.google.com [209.85.218.48]) by imf18.hostedemail.com (Postfix) with ESMTP id 1AC991C0037 for ; Mon, 17 Oct 2022 16:02:38 +0000 (UTC) Received: by mail-ej1-f48.google.com with SMTP id b2so26017097eja.6 for ; Mon, 17 Oct 2022 09:02:38 -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=UW9p6gqCP8BTkpd3KnUrua005vAUzWUKXVDnMgK4wSE=; b=p7ue2b5p1cSoOlv54tUktRDTVPP4c92MupghFTAiB7PAfixY8Od9qA4Anal/wav/k+ ayqBy3iPRORMqag2K69iY07DYl0HC/MFiVl0niW9mb/mMkozpYDdKxgWRPmQY4WyFLwu c9bbrRIb9lnALtd/DkpaBTHEaWDXXlk4iEjozNede5qOCwtpxo2YI3MMQ/8tIBJx6Ac3 lHqr0+XpxWjPTZJqA0q0MKZX7RC6ErCfQ9xix0Bk3U1F9eHLUbojgx84U9OQ5T/ntJBR Yj6VwsrXhANBCHApVotBbiHAriRfQY313+JPqkUTJLeBHvSR6ADuaGgrlCO2RbWCDOW8 kmSg== 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=UW9p6gqCP8BTkpd3KnUrua005vAUzWUKXVDnMgK4wSE=; b=XSuKX/P9q9my90bXGlgnbbmk86L+dOb/AUbEPesGqIIE4H1TLwLwkzKyz6W9pxG0Ux 7BSm4ZAv0fV1L0Sfn3wMdMjbSYCiGrC2MHZ0AIb5XQs0fhWJi+nIFVPpOponpnG0fj3I tKGmYogO0kPpgs3aSpqmRAjCUBBSuGO1bNRVJNQ6Jg6z4FZp0Dcz51sO8qm1BhHoZoCp 0H77bHeo3bgWzAMWNcs/tyYusCUhLuiw/P0XwVizMR4CNCL0Rk0Xf67Y1/d19YHijNUn vcLiwKbilALivR7ZlDJvgfjS31pXRBMOj4H66t8R6Q5VwD3CVOcxxEOBtG+lN36qsJw7 gfDQ== X-Gm-Message-State: ACrzQf2LOEFcBipkTMSYl0dXWpujvBOcovqzP5pR/uYV049slDxxiQfD 5MRFugDlGiY+a1oWM/KxSS8= X-Google-Smtp-Source: AMsMyM5SxZrbOhitrGkJnUUrBOtivtJ91xTMK9BjD/W3QMvvFR3FFy8S4KBWCllqWlOu7s/nUtGDyA== X-Received: by 2002:a17:906:6a25:b0:78d:4906:b960 with SMTP id qw37-20020a1709066a2500b0078d4906b960mr9490255ejc.647.1666022557707; Mon, 17 Oct 2022 09:02:37 -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.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Oct 2022 09:02:37 -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 Subject: [PATCH 1/7] mm: vmap: Add alloc_vmap_area trace event Date: Mon, 17 Oct 2022 18:02:25 +0200 Message-Id: <20221017160233.16582-2-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=1666022559; 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=UW9p6gqCP8BTkpd3KnUrua005vAUzWUKXVDnMgK4wSE=; b=EwGVzOqCWhRmCNg7gNF+3lwW1xUOqhatRsS+xylG2xdWVYjxxUy+CZ0axEajrWTowUUtGw qVJcSxbe0m7Fq56IWTOxxBZH8ZKdBVe6cXC3pkULNlwX/elfNfTGAlQkTtnUVU34nJeeWc 6mx5RQmUeIrZvLqEfOgbhMBMqCn95so= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=p7ue2b5p; spf=pass (imf18.hostedemail.com: domain of urezki@gmail.com designates 209.85.218.48 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=1666022559; a=rsa-sha256; cv=none; b=U6nnOoma1bBUWs24yzjtIrXqjKZDqzXDfH/vMQTs3rMBvbIsbuiDtg+2M/wujZvnaLE6TV C440AOlm8L8aVMoCyIxA8cgPY8u1Ed65DMbufrttFNy7bl32JgvQlqoz5sJ3wB+Jts/R50 N483GGgo9m/UD+s5s43NBVPqPdjn1cQ= X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 1AC991C0037 X-Rspam-User: Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=p7ue2b5p; spf=pass (imf18.hostedemail.com: domain of urezki@gmail.com designates 209.85.218.48 as permitted sender) smtp.mailfrom=urezki@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-Stat-Signature: mu4mbwsgaq3zm7rccw91dqqnc6ckxzzg X-HE-Tag: 1666022558-302770 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 for validation of passed parameters. To: Steven Rostedt Signed-off-by: Uladzislau Rezki (Sony) --- include/trace/events/vmap.h | 56 +++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 include/trace/events/vmap.h diff --git a/include/trace/events/vmap.h b/include/trace/events/vmap.h new file mode 100644 index 000000000000..504870d95a4e --- /dev/null +++ b/include/trace/events/vmap.h @@ -0,0 +1,56 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#undef TRACE_SYSTEM +#define TRACE_SYSTEM vmap + +#if !defined(_TRACE_VMAP_H) || defined(TRACE_HEADER_MULTI_READ) +#define _TRACE_VMAP_H + +#include + +/** + * alloc_vmap_area - called when a new vmap allocation occurs + * @addr: an allocated address + * @size: a requested size + * @align: a requested alignment + * @vstart: a requested start range + * @vend: a requested end range + * @failed: an allocation failed or not + * + * This event is used for a debug purpose, it can give an extra + * information for a developer about how often it occurs and which + * parameters are passed for further validation. + */ +TRACE_EVENT(alloc_vmap_area, + + TP_PROTO(unsigned long addr, unsigned long size, unsigned long align, + unsigned long vstart, unsigned long vend, int failed), + + TP_ARGS(addr, size, align, vstart, vend, failed), + + TP_STRUCT__entry( + __field(unsigned long, addr) + __field(unsigned long, size) + __field(unsigned long, align) + __field(unsigned long, vstart) + __field(unsigned long, vend) + __field(int, failed) + ), + + TP_fast_assign( + __entry->addr = addr; + __entry->size = size; + __entry->align = align; + __entry->vstart = vstart; + __entry->vend = vend; + __entry->failed = failed; + ), + + TP_printk("va_start: %lu size=%lu align=%lu vstart=0x%lx vend=0x%lx failed=%d", + __entry->addr, __entry->size, __entry->align, + __entry->vstart, __entry->vend, __entry->failed) +); + +#endif /* _TRACE_VMAP_H */ + +/* This part must be outside protection */ +#include From patchwork Mon Oct 17 16:02:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uladzislau Rezki X-Patchwork-Id: 13009006 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 B88B0C433FE for ; Mon, 17 Oct 2022 16:02:42 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B76BE6B0078; Mon, 17 Oct 2022 12:02:41 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AFFC66B007B; Mon, 17 Oct 2022 12:02:41 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 953FD6B007D; Mon, 17 Oct 2022 12:02:41 -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 7F4E16B0078 for ; Mon, 17 Oct 2022 12:02:41 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 291FF120DAF for ; Mon, 17 Oct 2022 16:02:41 +0000 (UTC) X-FDA: 80030909322.28.1E798A1 Received: from mail-ed1-f42.google.com (mail-ed1-f42.google.com [209.85.208.42]) by imf25.hostedemail.com (Postfix) with ESMTP id 65357A0035 for ; Mon, 17 Oct 2022 16:02:40 +0000 (UTC) Received: by mail-ed1-f42.google.com with SMTP id s30so16747178eds.1 for ; Mon, 17 Oct 2022 09:02:39 -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=P/1RiMr1eJ0x+wK6LRLfk+CIs20GXMv9Cr5BUn6E+1A=; b=DLer6Af9yKSB5ehlJqsvjiavXklY9gP8YgB5+o0/x2C9g/bsjaDsVai9moAt1vqXpR gmwM1KoesEPNSUP55KIbw3TmwNkAO8zKzomWb6tfPyWGKUobzY7e3nTOjwhoCx46FPci T8q4RRP3HnXnk4gAgnJdu7gpX/NPRbk544624yw1zuJVNv61ZMumR2OFiWQsLqhAtljB juk/mi7Jiy9pn87anP15eEoDF2FWJOZZyLayMzxOciaDv2tiFNl6b4uBkbFj5KJnqOmr vVpAriTMlwiQyT1AqQe5Lfx2bggjR+L+0OlXbujEaP3SXIT21QBYWmL9+YGPAyOqU+90 zzlA== 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=P/1RiMr1eJ0x+wK6LRLfk+CIs20GXMv9Cr5BUn6E+1A=; b=aojCNMEppzTW8vV1UfYQ9vZ/DmluZ/+TSXF365EmrRHjJjepkukQeKIlmFg5nLzrkK smM2TXeOqINv6Xz9rWC3bV0uId3OzwtkIUH8PO7kH0YR5WVs92lWLt0LnfM6RcfjGWCj 2IjOzAieL8GxG9shSDkfpYE7+zgeiyaatSH7bOXwslVecr0VwiANyUFjliSq2mC0uZyL 44JMWe1Bvbc5HGOK16I4wptuGskGXZbJ7/PMUU/cbN4WQB/krvvXiRObr3F8atmvu7H8 dmjC1XSZLokmZjDJ3stgt5yrjic7GwTxnA6t9D1X1FOg+bW4P+SPKrgMzA3aENg6WpFd bdWA== X-Gm-Message-State: ACrzQf3q9rEwBL+6OMJMLG++7QOfmMAF/zHR1xGzijs6S2pTDcrNqC6S J0aacEDS+ZQ8DSkaWU6YzD0= X-Google-Smtp-Source: AMsMyM7j6l6EW5hrjHaMWS0m06ylnM0/tLTszR1u9HVA9Id5jZFLJTLjoArgj3EMPX3y0vr6F9NWzg== X-Received: by 2002:aa7:dd45:0:b0:458:7474:1fbe with SMTP id o5-20020aa7dd45000000b0045874741fbemr10980661edw.334.1666022558782; Mon, 17 Oct 2022 09:02:38 -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.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Oct 2022 09:02:38 -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 Subject: [PATCH 2/7] mm: vmap: Add a purge_vmap_area_lazy trace event Date: Mon, 17 Oct 2022 18:02:26 +0200 Message-Id: <20221017160233.16582-3-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=1666022560; a=rsa-sha256; cv=none; b=Ea36k4AYQgof5op5XT1GcKMuTZIBl5K7JrbxGqWcI1WZL6UrDNI1+LLY1ftKyeDHh2yp14 CbhK8FGkioIT0/K+BvbLcofXuWfUVHxtrYZ8aGHXh3BHC9i7st9h4YU4RD1+h9PVnn5aWh zoPLtvPVl/bJuAF/TgoHf+nZ7HIOciU= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=DLer6Af9; spf=pass (imf25.hostedemail.com: domain of urezki@gmail.com designates 209.85.208.42 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=1666022560; 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=P/1RiMr1eJ0x+wK6LRLfk+CIs20GXMv9Cr5BUn6E+1A=; b=eE4uvPVmoVMGX8JOJe1CxcsyFhfiAgujuxv2ZADuUSxxTgaJ+TdTtgcVULly1Oh2HGr60i Mq57sC7SR0ExEp1+9qA9s+hGegWYQ6Mom/ZSericjmjkeBTyvmjqi85c9iKRLI8gtRjvQE 9q3K/BHhSXNVxWigfsTQRr4SAz+gkaU= X-Rspam-User: Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=DLer6Af9; spf=pass (imf25.hostedemail.com: domain of urezki@gmail.com designates 209.85.208.42 as permitted sender) smtp.mailfrom=urezki@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-Stat-Signature: cy9hpd8zr3dsygzmg5e38z9ajeup1kej X-Rspamd-Queue-Id: 65357A0035 X-Rspamd-Server: rspam10 X-HE-Tag: 1666022560-507523 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 debug purpose to track number of freed vmaps including a range it occurs on. To: Steven Rostedt Signed-off-by: Uladzislau Rezki (Sony) --- include/trace/events/vmap.h | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/include/trace/events/vmap.h b/include/trace/events/vmap.h index 504870d95a4e..2af2b84c6eb7 100644 --- a/include/trace/events/vmap.h +++ b/include/trace/events/vmap.h @@ -50,6 +50,39 @@ TRACE_EVENT(alloc_vmap_area, __entry->vstart, __entry->vend, __entry->failed) ); +/** + * purge_vmap_area_lazy - called when vmap areas were lazily freed + * @start: purging start address + * @end: purging end address + * @npurged: numbed of purged vmap areas + * + * This event is used for a debug purpose. It gives some + * indication about start:end range and how many objects + * are released. + */ +TRACE_EVENT(purge_vmap_area_lazy, + + TP_PROTO(unsigned long start, unsigned long end, + unsigned int npurged), + + TP_ARGS(start, end, npurged), + + TP_STRUCT__entry( + __field(unsigned long, start) + __field(unsigned long, end) + __field(unsigned int, npurged) + ), + + TP_fast_assign( + __entry->start = start; + __entry->end = end; + __entry->npurged = npurged; + ), + + TP_printk("start=0x%lx end=0x%lx num_purged=%u", + __entry->start, __entry->end, __entry->npurged) +); + #endif /* _TRACE_VMAP_H */ /* This part must be outside protection */ From patchwork Mon Oct 17 16:02:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uladzislau Rezki X-Patchwork-Id: 13009008 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 F285DC4332F for ; Mon, 17 Oct 2022 16:02:45 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CFDB36B007D; Mon, 17 Oct 2022 12:02:43 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C61E78E0001; Mon, 17 Oct 2022 12:02:43 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A63E26B0080; Mon, 17 Oct 2022 12:02:43 -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 8CBD16B007D for ; Mon, 17 Oct 2022 12:02:43 -0400 (EDT) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 64C2AA013F for ; Mon, 17 Oct 2022 16:02:43 +0000 (UTC) X-FDA: 80030909406.23.29FC4D7 Received: from mail-ej1-f53.google.com (mail-ej1-f53.google.com [209.85.218.53]) by imf14.hostedemail.com (Postfix) with ESMTP id 79BAD10002E for ; Mon, 17 Oct 2022 16:02:42 +0000 (UTC) Received: by mail-ej1-f53.google.com with SMTP id ot12so26062465ejb.1 for ; Mon, 17 Oct 2022 09:02:42 -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=V8PGF12HowaED9GsfrGSUOr+T+BR5MJRz00gwWuwNBY=; b=FwjCcmT197rmgh5QI5e3OYcSXGX0J/38zjdy+NQLWYvd36DTytm0a9xBb/IVvrvF0m NeTlftucGk9bI3HSKTXMixH7YlHMB7m/qnAKI+1GzsSdwrrMfD5uVgsEABz9UJ3YKBXF diMaxcKQucmoyB8BbBfaSPCvum3Hk6iPW34T2KUZpguWuKRUVCqpjUhaEuIoPME22BTK uStcrtd21fD5JEXPENWctXC9cYfaidqN8WOdR5ymvUnmYEBfa98t6dq7oL3aGIpJjgxx kSTrDAAJ29nzE08s3MhU+S2C9r/NHfqyHauqVyH3qssZwy8VkCEZj/nIInk/D9vANe+m TgiQ== 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=V8PGF12HowaED9GsfrGSUOr+T+BR5MJRz00gwWuwNBY=; b=vjUbAjUIr3WSs5XVivI15w8j0ZJ0rju6X5oXQ8g+geg8VdL37vIi0ZbuZb5R1Fvhed fpCvoQoTM4t4UttIRzRYGdhLhQNKiFH9ma/R8xEAHrcM1O6NwcimHmE3LqwMhXF3bcGt YxGMtiXH7b+lYNKP0261HAx9yITaTin3AwjC4PhKfd6tl4CeSvaPM5bp5WCEFL80vijV yDQLh6gcMkToYmG5t2xip0E/GaCbyhx0f48zmUCxfrRYeg2k0/ZJqQY6TUBMBLnx4yJd kQegL3g/wWEdu0/sHrN8cOiKfSFS53/EAa0R94aCvfqOx6uau2qaB3yHAkveKwrrOf9u 6c2g== X-Gm-Message-State: ACrzQf2kvMiFKcsOuvQNaF0rSmCSnRlDtcrBUtqxmJhwWRE7aHczsbBf +UNHE3exJLEOpVYuD5xECjGg3UAyiJw= X-Google-Smtp-Source: AMsMyM7mQD7IJcK53cEQL1/Z+YHex7sxuqWGp8otU30wY2tEfaxu2LL184YVDQk0dPc0p6SpQLXgjg== X-Received: by 2002:a17:906:d54d:b0:78e:2fbf:ca2a with SMTP id cr13-20020a170906d54d00b0078e2fbfca2amr9476322ejc.488.1666022561205; Mon, 17 Oct 2022 09:02:41 -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.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Oct 2022 09:02:40 -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 Subject: [PATCH 3/7] mm: vmap: Add a free_vmap_area_noflush trace event Date: Mon, 17 Oct 2022 18:02:28 +0200 Message-Id: <20221017160233.16582-5-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=1666022562; a=rsa-sha256; cv=none; b=hlnjkFyjmxhpVTlHP4Qyfa/af2Wm5ZX0CpwF31TQAcCrPfR4Va5Nwxyp/wmjpxTLVs7mOC BA+ECUbBwT27c6+jAsOrQMXVHemJsewB8KPWIRWAfzdiH+IEoCFRt9RzmOrBAPGpxvFPHv KDsbd1Eje8cPbZ5YZnA5yR0FplADkic= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=FwjCcmT1; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf14.hostedemail.com: domain of urezki@gmail.com designates 209.85.218.53 as permitted sender) smtp.mailfrom=urezki@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1666022562; 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=V8PGF12HowaED9GsfrGSUOr+T+BR5MJRz00gwWuwNBY=; b=eecN2anJcPt7R8FIHoyHQ//v+sfIL9EhyZHVKcA/q9H73FoYToO5bHwrtwSTHykMs9SvMC SLzdnvX0t7IAmVIteohyvJaNv+aYGuB0IhJ4fjH0P9j29n4402Pucf/69TeJOMHHgZ22zK EFPFEmTuUbkWmCXMSbN9v0JZZ0EBuuI= X-Stat-Signature: 63ihjrzu1zgnw98aa3r53dtcnz4gus4w X-Rspamd-Queue-Id: 79BAD10002E X-Rspam-User: Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=FwjCcmT1; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf14.hostedemail.com: domain of urezki@gmail.com designates 209.85.218.53 as permitted sender) smtp.mailfrom=urezki@gmail.com X-Rspamd-Server: rspam11 X-HE-Tag: 1666022562-290834 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 event is used in order to validate/debug a start address of freed VA, number of currently outstanding and maximum allowed areas. To: Steven Rostedt Signed-off-by: Uladzislau Rezki (Sony) --- include/trace/events/vmap.h | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/include/trace/events/vmap.h b/include/trace/events/vmap.h index 2af2b84c6eb7..5ba9bf58772a 100644 --- a/include/trace/events/vmap.h +++ b/include/trace/events/vmap.h @@ -83,6 +83,40 @@ TRACE_EVENT(purge_vmap_area_lazy, __entry->start, __entry->end, __entry->npurged) ); +/** + * free_vmap_area_noflush - called when a vmap area is freed + * @va_start: a start address of VA + * @nr_lazy: number of current lazy pages + * @nr_lazy_max: number of maximum lazy pages + * + * This event is used for a debug purpose. It gives some + * indication about a VA that is released, number of current + * outstanding areas and a maximum allowed threshold before + * dropping all of them. + */ +TRACE_EVENT(free_vmap_area_noflush, + + TP_PROTO(unsigned long va_start, unsigned long nr_lazy, + unsigned long nr_lazy_max), + + TP_ARGS(va_start, nr_lazy, nr_lazy_max), + + TP_STRUCT__entry( + __field(unsigned long, va_start) + __field(unsigned long, nr_lazy) + __field(unsigned long, nr_lazy_max) + ), + + TP_fast_assign( + __entry->va_start = va_start; + __entry->nr_lazy = nr_lazy; + __entry->nr_lazy_max = nr_lazy_max; + ), + + TP_printk("va_start=0x%lx nr_lazy=%lu nr_lazy_max=%lu", + __entry->va_start, __entry->nr_lazy, __entry->nr_lazy_max) +); + #endif /* _TRACE_VMAP_H */ /* This part must be outside protection */ From patchwork Mon Oct 17 16:02:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uladzislau Rezki X-Patchwork-Id: 13009010 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 A5662C433FE for ; Mon, 17 Oct 2022 16:02:49 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5D3BA8E0003; Mon, 17 Oct 2022 12:02:45 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 580EB8E0001; Mon, 17 Oct 2022 12:02:45 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3AF848E0003; Mon, 17 Oct 2022 12:02:45 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 2C6918E0001 for ; Mon, 17 Oct 2022 12:02:45 -0400 (EDT) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id E859F120DC9 for ; Mon, 17 Oct 2022 16:02:44 +0000 (UTC) X-FDA: 80030909448.15.E766574 Received: from mail-ej1-f44.google.com (mail-ej1-f44.google.com [209.85.218.44]) by imf14.hostedemail.com (Postfix) with ESMTP id 7640D100023 for ; Mon, 17 Oct 2022 16:02:44 +0000 (UTC) Received: by mail-ej1-f44.google.com with SMTP id y14so25953065ejd.9 for ; Mon, 17 Oct 2022 09:02:44 -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=JtTLJEmxkngU/xzkXx+LrxeCsOIvLIsQVzHgn6JJ/30=; b=Rfae/Y+4yaGIP0vcpaZVNUfII+7m7g52LOf1BBwmovC33F4FdDhsJTYyIWL6AuKQyJ 00E7hdNbT9AJARRPFsDe+QTTbCVOvP+tYMJdn3lM6XO5CgyjpiptP6Q89gE+W1m+COwH HIeCPuYctOpQLqLjeW8NBHyioUVGGZIfXWGSFqtzWlYBCk3fQzcUr7twHFDxB6r6BW5L KFSwG/f1vRCNHovUODXMUVMhzSQ+3NWuvcbOzn46gaRHV7UEPuNjXWgRV3pLSNYQtIoe cya/NQMrFKU+F/PM631Jf2/A1+xMxqBwxO0MeJ6+eWPO8W3Tq1TO0XHKXup/VIpqLgfW nVjw== 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=JtTLJEmxkngU/xzkXx+LrxeCsOIvLIsQVzHgn6JJ/30=; b=cWiCa5O3ahO1BBppI3+42ah09XueSChsp9Stn8Pp4G9odZr1tid3UPHmo76g+9D2mU U+AsVLdM9XmXBlr1H6oWT8+X/SzUStunhnoNFbssz7ce62ntWNRbi+gkV6KaAyzOzEwW K70ddTpkDzYPvqbQMW+94nOyfCU0kYwMLErm2Vxr1fqciiFcmr+XHG0Uj67bfYLw1Bos 37niDjVjJ0h8m6P8jaXdCFhKKmmzTP0XYtWPlCPc7o0/hhk0Zxq0+CaFyx1ZzEN/gGnS fsaYfJH+4leVpilPOrg5GFNKqwcW1E6vjA3sNS4sXzfbtMksVHLmmUcDTLf1yrGKf7jl e8sA== X-Gm-Message-State: ACrzQf0JKfUOZRf2rgU5dJR7aPyfAPpCSqoSI4LAhK5UxE8xLqN1wYIn /kNIAQpVYp1Cg2AldpvFQFA= X-Google-Smtp-Source: AMsMyM5llVzvSQnQKDP6QZSuQ5Zyi2qyUSdhaPTRPjvw7/c1QoH9pgMxAEO7uSQNp7a9ikcRbXmHEw== X-Received: by 2002:a17:906:7944:b0:73c:838:ac3d with SMTP id l4-20020a170906794400b0073c0838ac3dmr9166590ejo.242.1666022563310; Mon, 17 Oct 2022 09:02:43 -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.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Oct 2022 09:02:42 -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 4/7] mm/vmalloc: Use a trace_alloc_vmap_area event Date: Mon, 17 Oct 2022 18:02:30 +0200 Message-Id: <20221017160233.16582-7-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=1666022564; 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=JtTLJEmxkngU/xzkXx+LrxeCsOIvLIsQVzHgn6JJ/30=; b=4C7gQckGCEZ/2o+JoPSxxr1ImvN3jrtNcwGwCvBfCdji3p5wqInffVcdD9fpb40XqOKAtc svxkSgeYoAcp3Ka0j7G6tGVvdvb+he1Ugj9emksAeraOqKcFLO/FrpwVPo57ae4h+K3Fpj Zkn6G2MgWtouWir132jf63pgC/ADIJ0= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b="Rfae/Y+4"; spf=pass (imf14.hostedemail.com: domain of urezki@gmail.com designates 209.85.218.44 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=1666022564; a=rsa-sha256; cv=none; b=XGIgR7O/E/+WfMREIFgI00iSYISMf4bCnGjMw3O+ekKWcQmSB6xKZ1awN3bDSM5+QAUQRU 3Mcc8jhkKOypyi1tPkKiQBYKAx7a5roQsmulCOb9wd7eAba3Z7v9bkaDcyd6cTLiozOhNb SgKf4bcGM9BoD6fUpJb8C41bkCzdTm4= X-Rspamd-Server: rspam12 X-Rspam-User: Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b="Rfae/Y+4"; spf=pass (imf14.hostedemail.com: domain of urezki@gmail.com designates 209.85.218.44 as permitted sender) smtp.mailfrom=urezki@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-Stat-Signature: msd8imjtew3mmpux966kwfyt4jzj3njy X-Rspamd-Queue-Id: 7640D100023 X-HE-Tag: 1666022564-425456 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 an allocation attempt occurs. This event gives some information about: - a start address of allocated area; - a size that is requested; - an align that is required; - vstart/vend restriction; - if an allocation fails. Cc: Steven Rostedt Signed-off-by: Uladzislau Rezki (Sony) --- mm/vmalloc.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mm/vmalloc.c b/mm/vmalloc.c index 83b54beb12fa..f4397817ccd7 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -43,6 +43,9 @@ #include #include +#define CREATE_TRACE_POINTS +#include + #include "internal.h" #include "pgalloc-track.h" @@ -1621,6 +1624,8 @@ static struct vmap_area *alloc_vmap_area(unsigned long size, size, align, vstart, vend); spin_unlock(&free_vmap_area_lock); + trace_alloc_vmap_area(addr, size, align, vstart, vend, addr == vend); + /* * If an allocation fails, the "vend" address is * returned. Therefore trigger the overflow path. 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; } /* 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); } From patchwork Mon Oct 17 16:02:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uladzislau Rezki X-Patchwork-Id: 13009012 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 28FCEC43217 for ; Mon, 17 Oct 2022 16:02:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9EFED8E0006; Mon, 17 Oct 2022 12:02:48 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 978288E0001; Mon, 17 Oct 2022 12:02:48 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8423C8E0006; Mon, 17 Oct 2022 12:02:48 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 72FC88E0001 for ; Mon, 17 Oct 2022 12:02:48 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 3ED701A0DF1 for ; Mon, 17 Oct 2022 16:02:48 +0000 (UTC) X-FDA: 80030909616.09.B659E64 Received: from mail-ed1-f42.google.com (mail-ed1-f42.google.com [209.85.208.42]) by imf07.hostedemail.com (Postfix) with ESMTP id 9F6BB40034 for ; Mon, 17 Oct 2022 16:02:47 +0000 (UTC) Received: by mail-ed1-f42.google.com with SMTP id s2so16772941edd.2 for ; Mon, 17 Oct 2022 09:02:47 -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=cOp5dHui2KUwGT+5eQKWENO5yt6uGWyvR1ThU0hKA/E=; b=Ulbrgh28jEV/lGImNotOj9dffdC1RexllUrzQaQtpYYjk7xh8ATZSDn4NWtmsJt0ZG L73QhepRAssyp6RC7D07MffAXYOQ6aVWvUSjuDRzoGZSj02VYDKPTjCzkh6i18nN1S79 L7QpRUyawMxDKpBZE+EZFq3gbtIJy/09N7IDTzjQj2ssVDNX/Nns6sjjKpp9rVm6Ld2K 1ja0NXBtDjJNNqwGmxe6jNfJEnMmWUlNqfeHUYC7EfwYpiDF4cIBdRfRcDorDeV0E9ee zyhN1bEHhf2HFW9uBFX3HsvtRnw/GtNW3pfTPt+hsL1MermAd/NKWCbLu6XTMiSysmW4 gPdA== 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=cOp5dHui2KUwGT+5eQKWENO5yt6uGWyvR1ThU0hKA/E=; b=5D6YG5K1Z0iisKqwVmGq1RgCwfwInx9OeY8p01YT4FsLkTJ/BSrfVSy4lsJQaQ1XAv lzFLJY2c1PltpjdOkef2STds2tCHF/ssmhl/1aIkDg/yMgIi778HDlEDDIYj0FjAyjgj JRrQFEdsI0XRjk0PIMXzo0BS2ou6aOMaV+agC3n7J2MhyfTyMY4V9shmi/BSwmNENbFM e31z9wWo9Vd3Ztm79pvjvAVlbBz61N1pA0xrwU2EenV8J/+SHMj+thQeq9HTviVqzHsF XRZoNPnNkYg0m1i44ldX/RZA0YDtsDSNk4UxADmj5CBxmZgajy3j/B+idgoBtNcSD34T LnnQ== X-Gm-Message-State: ACrzQf2Ohz8uNBuvEDLPTfypCiLndbIE3WCuyg1LzEVlzosCzKhQgWGj 1MKNcOqrAJUE8+g9+nZ/d5s= X-Google-Smtp-Source: AMsMyM6daThHHLSBrhl7j4Z6yU0za+Zqoyp1UULFUGi/BMDqzG/RFwI65BX/Rd+wyTS6JUWQcB6ACQ== X-Received: by 2002:a50:fe0a:0:b0:458:dce8:2b6b with SMTP id f10-20020a50fe0a000000b00458dce82b6bmr10732740edt.84.1666022566397; Mon, 17 Oct 2022 09:02:46 -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.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Oct 2022 09:02:45 -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 7/7] vmalloc: Add reviewers for vmalloc code Date: Mon, 17 Oct 2022 18:02:33 +0200 Message-Id: <20221017160233.16582-10-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=1666022567; 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=cOp5dHui2KUwGT+5eQKWENO5yt6uGWyvR1ThU0hKA/E=; b=w+mOMrtLQra5EUcq84S14mqsaY5Fh2Tm8pfCFl3xZxWkT65+AtiY95sEmKsdlyT1UgCvWP Wo1dePexlvYnjzzO24RpzLZCj5FW2HFFmyx/GLWc4w9tkXy4NHskJ02Tvnda2z+b43xiHJ ZjgOFVskpD7wuC8oFYvqQTtGyIgPA3w= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Ulbrgh28; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf07.hostedemail.com: domain of urezki@gmail.com designates 209.85.208.42 as permitted sender) smtp.mailfrom=urezki@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1666022567; a=rsa-sha256; cv=none; b=Eh3T5r8ZcJdHVatZm1tCsQuIspJdrJB/BRZFDpjSjURA6/DTEGbc6YU3nwuvFqgN4LUkJP vGGTY2SV+LL4nfjGa3jNCD5d/rjGrNHCVWqfIAW/dmLvoVh6MrdwqkHhcEfGgzXSddJb1M TmLCesLhGT436UySTojHxPx45I9FwZU= Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Ulbrgh28; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf07.hostedemail.com: domain of urezki@gmail.com designates 209.85.208.42 as permitted sender) smtp.mailfrom=urezki@gmail.com X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 9F6BB40034 X-Rspam-User: X-Stat-Signature: wfq7zkreyoui38g7br8enwndamu9iqhi X-HE-Tag: 1666022567-59449 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: Add myself and Christoph Hellwig as reviewers for vmalloc. Cc: Steven Rostedt Signed-off-by: Uladzislau Rezki (Sony) --- MAINTAINERS | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index 568ad7c5eeb6..a6f4e11755e6 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -13289,10 +13289,20 @@ F: include/linux/memory_hotplug.h F: include/linux/mm.h F: include/linux/mmzone.h F: include/linux/pagewalk.h -F: include/linux/vmalloc.h F: mm/ F: tools/testing/selftests/vm/ +VMALLOC +M: Andrew Morton +R: Uladzislau Rezki +R: Christoph Hellwig +L: linux-mm@kvack.org +S: Maintained +W: http://www.linux-mm.org +T: git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm +F: mm/vmalloc.c +F: include/linux/vmalloc.h + MEMORY HOT(UN)PLUG M: David Hildenbrand M: Oscar Salvador