linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/memblock: print memblock_remove
@ 2018-05-08 10:42 Minchan Kim
  2018-05-09  8:12 ` Michal Hocko
  0 siblings, 1 reply; 4+ messages in thread
From: Minchan Kim @ 2018-05-08 10:42 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Michal Hocko, LKML, linux-mm, Minchan Kim

memblock_remove report is useful to see why MemTotal of /proc/meminfo
between two kernels makes difference.

Signed-off-by: Minchan Kim <minchan@kernel.org>
---
 mm/memblock.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/mm/memblock.c b/mm/memblock.c
index 5228f594b13c..03d48d8835ba 100644
--- a/mm/memblock.c
+++ b/mm/memblock.c
@@ -697,6 +697,11 @@ static int __init_memblock memblock_remove_range(struct memblock_type *type,
 
 int __init_memblock memblock_remove(phys_addr_t base, phys_addr_t size)
 {
+	phys_addr_t end = base + size - 1;
+
+	memblock_dbg("memblock_remove: [%pa-%pa] %pS\n",
+		     &base, &end, (void *)_RET_IP_);
+
 	return memblock_remove_range(&memblock.memory, base, size);
 }
 
-- 
2.17.0.441.gb46fe60e1d-goog

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] mm/memblock: print memblock_remove
  2018-05-08 10:42 [PATCH] mm/memblock: print memblock_remove Minchan Kim
@ 2018-05-09  8:12 ` Michal Hocko
  2018-05-09  8:18   ` Minchan Kim
  0 siblings, 1 reply; 4+ messages in thread
From: Michal Hocko @ 2018-05-09  8:12 UTC (permalink / raw)
  To: Minchan Kim; +Cc: Andrew Morton, LKML, linux-mm

On Tue 08-05-18 19:42:23, Minchan Kim wrote:
> memblock_remove report is useful to see why MemTotal of /proc/meminfo
> between two kernels makes difference.
> 
> Signed-off-by: Minchan Kim <minchan@kernel.org>
> ---
>  mm/memblock.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/mm/memblock.c b/mm/memblock.c
> index 5228f594b13c..03d48d8835ba 100644
> --- a/mm/memblock.c
> +++ b/mm/memblock.c
> @@ -697,6 +697,11 @@ static int __init_memblock memblock_remove_range(struct memblock_type *type,
>  
>  int __init_memblock memblock_remove(phys_addr_t base, phys_addr_t size)
>  {
> +	phys_addr_t end = base + size - 1;
> +
> +	memblock_dbg("memblock_remove: [%pa-%pa] %pS\n",
> +		     &base, &end, (void *)_RET_IP_);

Other callers of memblock_dbg use %pF. Is there any reason to be
different here?

Other that that looks ok to me.
-- 
Michal Hocko
SUSE Labs

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] mm/memblock: print memblock_remove
  2018-05-09  8:12 ` Michal Hocko
@ 2018-05-09  8:18   ` Minchan Kim
  2018-05-09  8:49     ` Michal Hocko
  0 siblings, 1 reply; 4+ messages in thread
From: Minchan Kim @ 2018-05-09  8:18 UTC (permalink / raw)
  To: Michal Hocko; +Cc: Andrew Morton, LKML, linux-mm

On Wed, May 09, 2018 at 10:12:14AM +0200, Michal Hocko wrote:
> On Tue 08-05-18 19:42:23, Minchan Kim wrote:
> > memblock_remove report is useful to see why MemTotal of /proc/meminfo
> > between two kernels makes difference.
> > 
> > Signed-off-by: Minchan Kim <minchan@kernel.org>
> > ---
> >  mm/memblock.c | 5 +++++
> >  1 file changed, 5 insertions(+)
> > 
> > diff --git a/mm/memblock.c b/mm/memblock.c
> > index 5228f594b13c..03d48d8835ba 100644
> > --- a/mm/memblock.c
> > +++ b/mm/memblock.c
> > @@ -697,6 +697,11 @@ static int __init_memblock memblock_remove_range(struct memblock_type *type,
> >  
> >  int __init_memblock memblock_remove(phys_addr_t base, phys_addr_t size)
> >  {
> > +	phys_addr_t end = base + size - 1;
> > +
> > +	memblock_dbg("memblock_remove: [%pa-%pa] %pS\n",
> > +		     &base, &end, (void *)_RET_IP_);
> 
> Other callers of memblock_dbg use %pF. Is there any reason to be
> different here?

checkpatch hit me.

WARNING: Deprecated vsprintf pointer extension '%pF' - use %pS instead
#24: FILE: mm/memblock.c:702:
+       memblock_dbg("memblock_remove: [%pa-%pa] %pF\n",
+                    &base, &end, (void *)_RET_IP_);

> 
> Other that that looks ok to me.

Thanks, Michal.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] mm/memblock: print memblock_remove
  2018-05-09  8:18   ` Minchan Kim
@ 2018-05-09  8:49     ` Michal Hocko
  0 siblings, 0 replies; 4+ messages in thread
From: Michal Hocko @ 2018-05-09  8:49 UTC (permalink / raw)
  To: Minchan Kim; +Cc: Andrew Morton, LKML, linux-mm

On Wed 09-05-18 17:18:25, Minchan Kim wrote:
> On Wed, May 09, 2018 at 10:12:14AM +0200, Michal Hocko wrote:
> > On Tue 08-05-18 19:42:23, Minchan Kim wrote:
> > > memblock_remove report is useful to see why MemTotal of /proc/meminfo
> > > between two kernels makes difference.
> > > 
> > > Signed-off-by: Minchan Kim <minchan@kernel.org>
> > > ---
> > >  mm/memblock.c | 5 +++++
> > >  1 file changed, 5 insertions(+)
> > > 
> > > diff --git a/mm/memblock.c b/mm/memblock.c
> > > index 5228f594b13c..03d48d8835ba 100644
> > > --- a/mm/memblock.c
> > > +++ b/mm/memblock.c
> > > @@ -697,6 +697,11 @@ static int __init_memblock memblock_remove_range(struct memblock_type *type,
> > >  
> > >  int __init_memblock memblock_remove(phys_addr_t base, phys_addr_t size)
> > >  {
> > > +	phys_addr_t end = base + size - 1;
> > > +
> > > +	memblock_dbg("memblock_remove: [%pa-%pa] %pS\n",
> > > +		     &base, &end, (void *)_RET_IP_);
> > 
> > Other callers of memblock_dbg use %pF. Is there any reason to be
> > different here?
> 
> checkpatch hit me.
> 
> WARNING: Deprecated vsprintf pointer extension '%pF' - use %pS instead
> #24: FILE: mm/memblock.c:702:
> +       memblock_dbg("memblock_remove: [%pa-%pa] %pF\n",
> +                    &base, &end, (void *)_RET_IP_);

OK, I see. Then we probably need some mass replacement as well. Anyway
Acked-by: Michal Hocko <mhocko@suse.com>
for this one.
-- 
Michal Hocko
SUSE Labs

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-05-09  8:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-08 10:42 [PATCH] mm/memblock: print memblock_remove Minchan Kim
2018-05-09  8:12 ` Michal Hocko
2018-05-09  8:18   ` Minchan Kim
2018-05-09  8:49     ` Michal Hocko

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).