From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michal Nazarewicz Subject: Re: [PATCH] [RFC] CMA: clear buffer-head lru before page migration Date: Mon, 14 Jul 2014 17:25:41 +0200 Message-ID: References: <53B664E5.5060102@lge.com> <20140707155252.15e81dff6683393ba3590478@linux-foundation.org> <20140714070225.GE11317@js1304-P5Q-DELUXE> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Andrew Morton , Gioh Kim , Laura Abbott , Marek Szyprowski , Alexander Viro , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?B?7J206rG07Zi4?= , Gi-Oh Kim To: Joonsoo Kim Return-path: In-Reply-To: <20140714070225.GE11317@js1304-P5Q-DELUXE> Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Mon, Jul 14 2014, Joonsoo Kim wrote: > On Tue, Jul 08, 2014 at 06:46:31PM +0200, Michal Nazarewicz wrote: >> This seems reasonable, except I think [invalidate_bh_lrus()] should >> go after start_isolate_page_range call because otherwise there's no >> guarantee that someone won't grab those pages back. >>=20 >> Also to avoid the #ifdef perhaps we want this as well: > > I think that we just want to remove ifdef CONFIG_CMA on above code > snippet, because invalidate_bh_lrus() would also help user of > alloc_contig_range() with MIGRATE_MOVABLE. Sounds good to me. >> The purpose is to get free non-buddy pages (so pages on PCP lists fo= r >> instance) back onto the buddy list. It's safe to move those calls a= bove >> the call to __alloc_contig_migrate_range, but I don't think it will >> change anything (except of course the fact that if migration fails, >> we'll do the draining for nothing). > At a glance, we don't need that drain_all_pages(), because > drain_all_pages() is also called by set_migratetype_isolate() after > changing migratetype. You are likely correct. > And, it is better to move up lru_add_drain_all() to ahead of > __alloc_contig_migrate_range(), because some pages could be skipped > to migrate due to this lru page caching mechanism. Again, sounds good to me. --=20 Best regards, _ _ =2Eo. | Liege of Serenely Enlightened Majesty of o' \,=3D./ `o =2E.o | Computer Science, Micha=C5=82 =E2=80=9Cmina86=E2=80=9D Nazarew= icz (o o) ooo +------ooO--(_)--Ooo--