Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1721652

Re: [PATCH v15 4/5] mm: support reporting free page blocks

From Michal Hocko <mhocko@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH v15 4/5] mm: support reporting free page blocks
Date 2017-08-28 16:20 +0200
Message-ID <ujt3s-6CP-15@gated-at.bofh.it> (permalink)
References <ujpsS-4p8-9@gated-at.bofh.it> <ujpsS-4p8-31@gated-at.bofh.it> <ujsqK-6aY-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Mon 28-08-17 15:33:26, Michal Hocko wrote:
> On Mon 28-08-17 18:08:32, Wei Wang wrote:
> > This patch adds support to walk through the free page blocks in the
> > system and report them via a callback function. Some page blocks may
> > leave the free list after zone->lock is released, so it is the caller's
> > responsibility to either detect or prevent the use of such pages.
> > 
> > One use example of this patch is to accelerate live migration by skipping
> > the transfer of free pages reported from the guest. A popular method used
> > by the hypervisor to track which part of memory is written during live
> > migration is to write-protect all the guest memory. So, those pages that
> > are reported as free pages but are written after the report function
> > returns will be captured by the hypervisor, and they will be added to the
> > next round of memory transfer.
> 
> OK, looks much better. I still have few nits.
> 
> > +extern void walk_free_mem_block(void *opaque,
> > +				int min_order,
> > +				bool (*report_page_block)(void *, unsigned long,
> > +							  unsigned long));
> > +
> 
> please add names to arguments of the prototype

And one more thing. Your callback returns bool and true usually means a
success while you are using it to break out from the loop. This is
rather confusing. I would expect iterating until false is returned so
the opposite than what you have. You could also change this to int and
return 0 on success and < 0 to break out. 

-- 
Michal Hocko
SUSE Labs

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v15 4/5] mm: support reporting free page blocks Wei Wang <wei.w.wang@intel.com> - 2017-08-28 12:30 +0200
  Re: [PATCH v15 4/5] mm: support reporting free page blocks Michal Hocko <mhocko@kernel.org> - 2017-08-28 15:40 +0200
    Re: [PATCH v15 4/5] mm: support reporting free page blocks Michal Hocko <mhocko@kernel.org> - 2017-08-28 16:20 +0200
    Re: [PATCH v15 4/5] mm: support reporting free page blocks Wei Wang <wei.w.wang@intel.com> - 2017-08-29 05:30 +0200

csiph-web