[virtio-dev] Re: [PATCH v35 1/5] mm: support to get hints of free page blocks

2018-07-12 Thread Wei Wang
On 07/12/2018 07:49 PM, Michal Hocko wrote: On Thu 12-07-18 19:34:16, Wei Wang wrote: On 07/12/2018 04:13 PM, Michal Hocko wrote: On Thu 12-07-18 10:52:08, Wei Wang wrote: On 07/12/2018 10:30 AM, Linus Torvalds wrote: On Wed, Jul 11, 2018 at 7:17 PM Wei Wang wrote: Would it be better to

[virtio-dev] Re: [PATCH v35 1/5] mm: support to get hints of free page blocks

2018-07-12 Thread Wei Wang
On 07/12/2018 04:13 PM, Michal Hocko wrote: On Thu 12-07-18 10:52:08, Wei Wang wrote: On 07/12/2018 10:30 AM, Linus Torvalds wrote: On Wed, Jul 11, 2018 at 7:17 PM Wei Wang wrote: Would it be better to remove __GFP_THISNODE? We actually want to get all the guest free pages (from all the

[virtio-dev] Re: [PATCH v35 1/5] mm: support to get hints of free page blocks

2018-07-11 Thread Wei Wang
On 07/12/2018 10:30 AM, Linus Torvalds wrote: On Wed, Jul 11, 2018 at 7:17 PM Wei Wang wrote: Would it be better to remove __GFP_THISNODE? We actually want to get all the guest free pages (from all the nodes). Maybe. Or maybe it would be better to have the memory balloon logic be per-node?

[virtio-dev] Re: [PATCH v35 1/5] mm: support to get hints of free page blocks

2018-07-11 Thread Wei Wang
On 07/12/2018 12:23 AM, Linus Torvalds wrote: On Wed, Jul 11, 2018 at 2:21 AM Michal Hocko wrote: We already have an interface for that. alloc_pages(GFP_NOWAIT, MAX_ORDER -1). So why do we need any array based interface? That was actually my original argument in the original thread - that the

[virtio-dev] Re: [PATCH v35 1/5] mm: support to get hints of free page blocks

2018-07-11 Thread Michael S. Tsirkin
On Wed, Jul 11, 2018 at 01:09:49PM +0200, Michal Hocko wrote: > But let me note that I am not really convinced how this (or previous) > approach will really work in most workloads. We tend to cache heavily so > there is rarely any memory free. It might be that it's worth flushing the cache when

[virtio-dev] RE: [PATCH v35 1/5] mm: support to get hints of free page blocks

2018-07-11 Thread Wang, Wei W
On Wednesday, July 11, 2018 7:10 PM, Michal Hocko wrote: > On Wed 11-07-18 18:52:45, Wei Wang wrote: > > On 07/11/2018 05:21 PM, Michal Hocko wrote: > > > On Tue 10-07-18 18:44:34, Linus Torvalds wrote: > > > [...] > > > > That was what I tried to encourage with actually removing the > > > > pages

[virtio-dev] Re: [PATCH v35 1/5] mm: support to get hints of free page blocks

2018-07-11 Thread Wei Wang
On 07/11/2018 05:21 PM, Michal Hocko wrote: On Tue 10-07-18 18:44:34, Linus Torvalds wrote: [...] That was what I tried to encourage with actually removing the pages form the page list. That would be an _incremental_ interface. You can remove MAX_ORDER-1 pages one by one (or a hundred at a

[virtio-dev] Re: [PATCH v35 1/5] mm: support to get hints of free page blocks

2018-07-10 Thread Michael S. Tsirkin
On Wed, Jul 11, 2018 at 07:00:37AM +0300, Michael S. Tsirkin wrote: > On Tue, Jul 10, 2018 at 10:33:08AM -0700, Linus Torvalds wrote: > > NAK. > > > > On Tue, Jul 10, 2018 at 2:56 AM Wei Wang wrote: > > > > > > + > > > + buf_page = list_first_entry_or_null(pages, struct page, lru); > > > +

[virtio-dev] Re: [PATCH v35 1/5] mm: support to get hints of free page blocks

2018-07-10 Thread Michael S. Tsirkin
On Tue, Jul 10, 2018 at 10:33:08AM -0700, Linus Torvalds wrote: > NAK. > > On Tue, Jul 10, 2018 at 2:56 AM Wei Wang wrote: > > > > + > > + buf_page = list_first_entry_or_null(pages, struct page, lru); > > + if (!buf_page) > > + return -EINVAL; > > + buf = (__le64

[virtio-dev] Re: [PATCH v35 1/5] mm: support to get hints of free page blocks

2018-07-10 Thread Wei Wang
On 07/11/2018 01:33 AM, Linus Torvalds wrote: NAK. On Tue, Jul 10, 2018 at 2:56 AM Wei Wang wrote: + + buf_page = list_first_entry_or_null(pages, struct page, lru); + if (!buf_page) + return -EINVAL; + buf = (__le64 *)page_address(buf_page); Stop this garbage.

[virtio-dev] RE: [PATCH v35 1/5] mm: support to get hints of free page blocks

2018-07-10 Thread Wang, Wei W
On Tuesday, July 10, 2018 5:31 PM, Wang, Wei W wrote: > Subject: [PATCH v35 1/5] mm: support to get hints of free page blocks > > This patch adds support to get free page blocks from a free page list. > The physical addresses of the blocks are stored to a list of buffers passed > from the caller.