diff mbox

mm/memblock: print memblock_remove

Message ID 20180508104223.8028-1-minchan@kernel.org (mailing list archive)
State New, archived
Headers show

Commit Message

Minchan Kim May 8, 2018, 10:42 a.m. UTC
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(+)

Comments

Michal Hocko May 9, 2018, 8:12 a.m. UTC | #1
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.
Minchan Kim May 9, 2018, 8:18 a.m. UTC | #2
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.
Michal Hocko May 9, 2018, 8:49 a.m. UTC | #3
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.
diff mbox

Patch

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);
 }