Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp2593201rbb; Wed, 28 Feb 2024 06:46:51 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWpUMCu5+Hq2dAWPqLJJv4SmlWBhMR/QDWYbECuqh48jcG+wL/uPYuGFzixynyoxBuKJV8OPfb68pTY7cG7sb+mkQIHZh1vrtvZ+/XBlQ== X-Google-Smtp-Source: AGHT+IE2YUwldTQf5/1ot0jcnF+v8I49aenu1kyQgUakUbznlRsPhQtvMEWe4HY2jcGYyTI2BJXw X-Received: by 2002:a05:6871:4cd:b0:21a:46a6:b069 with SMTP id n13-20020a05687104cd00b0021a46a6b069mr16742575oai.14.1709131611482; Wed, 28 Feb 2024 06:46:51 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709131611; cv=pass; d=google.com; s=arc-20160816; b=yssGpRRY4yqIfDzV2x2NfJnFRpAREejiDPyQO+bupz2/LDvLvCJeCnMTFIbxMW7UuR F4FwkIFKeWPpnk1bHkgJOzpPrHlkj608wkEK2oxpVAK3iipo8hQv18TbdRwFpgVwXazv 1eGdMaRJkB9iyRzG9jpVBCWpjybdASV6n8DyyTPbiefbVxbb1dGUjqRGtZcsl4Cy04n5 V+D5Ni+nzsK/72Ij0ewKmc2TcrjbCvEthCirFxIuaqdxrUBn+JMb+Sve4fIXn5VtHYso a0Uu6bP6XFmoFdP6gkfAuKNM6m3Rjalj+dSYgwW0iCSw3d5Dtw9QisPdWYcxlhTJN7Ir XCSw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date; bh=n8Wi1Rs6i7bxtFbEc3nTCW9ulUDYTgEUWijKmkN35bQ=; fh=gxmD7nJseD6CBvgyDr8VJHxTTPfwtCcjpyj3NVfLBEA=; b=OqO52y4RFTSzx1oNNKDDRUoUatZczs0abilcur66+s2zSBjIl0hi+P5M6IXZiRJ2pc kq0WUJTMOQrBysw9fERNcQTprtoU+n3vAW5/Hcqzg+HtbagfhJEQQoVfo7tBxTT2jPlG mqgIrPUQg6MF8xVjBrxA4vp+lcPj0Gc1WBfxZ0iy7Ygj44sWrZO8ShyPptRvId4L+8ph Xeo473+E9WbYCAVJfPWXBpZVRZs8kYeCwWYgsb77VKnwc9gREkrUtj8Q4KdPtJvSrKdt W1PYl+7JLNwhY83MHBCQIVeTGAJBI+n1RI+9CjVtL2uGV1msfXcngbWMqlM1IrvpO+ca H8Pw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-85204-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85204-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id fc15-20020a056a002e0f00b006e537cc7299si4771725pfb.256.2024.02.28.06.46.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 06:46:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-85204-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-85204-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85204-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 9E421289E77 for ; Wed, 28 Feb 2024 14:45:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A753B15B116; Wed, 28 Feb 2024 14:45:01 +0000 (UTC) Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2D44112E1DD; Wed, 28 Feb 2024 14:45:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709131501; cv=none; b=BUla82nyXzbb9sUBjfDnqYk8rnRLh87bBGommDEtIsoBeBtYqoyW1doHwd4eVFt8u4v40Zc7OGktsUnQgPhR1moHRUsU7USE5RQ+f6I3WF70Dx8jEDgq9Xo+X4FujF6Tv3i9x6ojaQ4CTm5okpDqZye23xOSkJpMyxuCggVF5ws= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709131501; c=relaxed/simple; bh=6mLpCvN3tUZqYmSTfdBCQXOuAi1GkNzVxWE3hU2gaoU=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=AUCX58J//+1FyJOnYVOSizF5cW6rQ0x4L1M0Cf7INLEaGtBCoG4hf0LNePuUDnasaf7wBtB/1e0FaZg2F6rQy7h3An2z6cKBhbReH+McFzj0QlGzlrzW4aoAqWZOMlLNVw+7GM7dFD9ZcyUHFjZibRwL0C5+NvhlB0K4dZtkthA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6C8FEC433C7; Wed, 28 Feb 2024 14:44:59 +0000 (UTC) Date: Wed, 28 Feb 2024 09:47:03 -0500 From: Steven Rostedt To: Richard Chang Cc: mhiramat@kernel.org, mathieu.desnoyers@efficios.com, akpm@linux-foundation.org, liumartin@google.com, surenb@google.com, minchan@kernel.org, linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH v2] mm: add alloc_contig_migrate_range allocation statistics Message-ID: <20240228094703.0aeb5ae5@gandalf.local.home> In-Reply-To: <20240228051127.2859472-1-richardycc@google.com> References: <20240226120728.3f495fa7@gandalf.local.home> <20240228051127.2859472-1-richardycc@google.com> X-Mailer: Claws Mail 3.19.1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Wed, 28 Feb 2024 05:11:17 +0000 Richard Chang wrote: > alloc_contig_migrate_range has every information to be able to > understand big contiguous allocation latency. For example, how many > pages are migrated, how many times they were needed to unmap from > page tables. > > This patch adds the trace event to collect the allocation statistics. > In the field, it was quite useful to understand CMA allocation > latency. > > Signed-off-by: Richard Chang > --- > * from v1 - https://lore.kernel.org/linux-mm/20240226100045.2083962-1-richardycc@google.com/ > * Move the trace event int field to the end of the longs - rostedt > * Do the calculation only when tracing is enabled - rostedt > > include/trace/events/kmem.h | 38 +++++++++++++++++++++++++++++++++++++ > mm/internal.h | 3 ++- > mm/page_alloc.c | 32 ++++++++++++++++++++++++++----- > mm/page_isolation.c | 2 +- > 4 files changed, 68 insertions(+), 7 deletions(-) > > diff --git a/include/trace/events/kmem.h b/include/trace/events/kmem.h > index 58688768ef0f..6e62cc64cd92 100644 > --- a/include/trace/events/kmem.h > +++ b/include/trace/events/kmem.h > @@ -304,6 +304,44 @@ TRACE_EVENT(mm_page_alloc_extfrag, > __entry->change_ownership) > ); > > +TRACE_EVENT(mm_alloc_contig_migrate_range_info, > + > + TP_PROTO(unsigned long start, > + unsigned long end, > + unsigned long nr_migrated, > + unsigned long nr_reclaimed, > + unsigned long nr_mapped, > + int migratetype), Well, you didn't need to change the order of the parameters. Anyway, from a tracing point of view: Reviewed-by: Steven Rostedt (Google) + > + TP_ARGS(start, end, nr_migrated, nr_reclaimed, nr_mapped, migratetype), > + > + TP_STRUCT__entry( > + __field(unsigned long, start) > + __field(unsigned long, end) > + __field(unsigned long, nr_migrated) > + __field(unsigned long, nr_reclaimed) > + __field(unsigned long, nr_mapped) > + __field(int, migratetype) > + ), > +