linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Ingo Molnar <mingo@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Todd Brandt <todd.e.brandt@linux.intel.com>,
	linux-mm@kvack.org, Vlastimil Babka <vbabka@suse.cz>,
	Mel Gorman <mgorman@techsingularity.net>,
	Peter Zijlstra <peterz@infradead.org>
Subject: Re: [RFC][PATCH 4/4] ftrace: Allow for function tracing to record init functions on boot up
Date: Wed, 8 Mar 2017 15:07:08 -0500	[thread overview]
Message-ID: <20170308150708.3df9bf15@gandalf.local.home> (raw)
In-Reply-To: <20170307212943.573855971@goodmis.org>


Dear mm folks,

Are you OK with this change? I need a hook to when the init sections
are being freed along with the address that are being freed. As each
arch frees their own init sections I need a single location to place my
hook. The archs all call free_reserved_area(). As this isn't a critical
section (ie. one that needs to be really fast), calling into ftrace
with the freed address should not be an issue. The ftrace code uses a
binary search within the blocks of locations so it is rather fast
itself.

Thoughts? Acks? :-)

-- Steve


> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index 2c6d5f64feca..95ac03de4cda 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -64,6 +64,7 @@
>  #include <linux/page_owner.h>
>  #include <linux/kthread.h>
>  #include <linux/memcontrol.h>
> +#include <linux/ftrace.h>
>  
>  #include <asm/sections.h>
>  #include <asm/tlbflush.h>
> @@ -6441,6 +6442,9 @@ unsigned long free_reserved_area(void *start, void *end, int poison, char *s)
>  	void *pos;
>  	unsigned long pages = 0;
>  
> +	/* This may be .init text, inform ftrace to remove it */
> +	ftrace_free_mem(start, end);
> +
>  	start = (void *)PAGE_ALIGN((unsigned long)start);
>  	end = (void *)((unsigned long)end & PAGE_MASK);
>  	for (pos = start; pos < end; pos += PAGE_SIZE, pages++) {

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

      reply	other threads:[~2017-03-08 20:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20170307212833.964734229@goodmis.org>
2017-03-07 21:28 ` [RFC][PATCH 4/4] ftrace: Allow for function tracing to record init functions on boot up Steven Rostedt
2017-03-08 20:07   ` Steven Rostedt [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170308150708.3df9bf15@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@techsingularity.net \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=todd.e.brandt@linux.intel.com \
    --cc=vbabka@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).