From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Wed, 23 Apr 2008 12:44:25 +0900 From: KAMEZAWA Hiroyuki Subject: Re: Warning on memory offline (and possible in usual migration?) Message-Id: <20080423124425.5c80d3cf.kamezawa.hiroyu@jp.fujitsu.com> In-Reply-To: <20080423025358.GA9751@wotan.suse.de> References: <20080414145806.c921c927.kamezawa.hiroyu@jp.fujitsu.com> <20080422045205.GH21993@wotan.suse.de> <20080422165608.7ab7026b.kamezawa.hiroyu@jp.fujitsu.com> <20080422094352.GB23770@wotan.suse.de> <20080423004804.GA14134@wotan.suse.de> <20080423114107.b8df779c.kamezawa.hiroyu@jp.fujitsu.com> <20080423025358.GA9751@wotan.suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org Return-Path: To: Nick Piggin Cc: Christoph Lameter , "linux-mm@kvack.org" , Andrew Morton , GOTO List-ID: On Wed, 23 Apr 2008 04:53:58 +0200 Nick Piggin wrote: > > BTW, can I ask a question for understanding this change ? > > > > ==this check== > > WARN_ON_ONCE(!PagePrivate(page) && !PageUptodate(page)); > > > > in __set_page_dirty_nobuffers() seems to check "the page should have buffer or > > be up-to-date when it calls this function." > > > > When it comes to __set_page_dirty() (in fs/buffer.c) > > == this check== > > WARN_ON_ONCE(warn && !PageUptodate(page)); > > > > is used and doesn't see page has buffers or not. > > What's difference between two functions's condition for WARNING ? > > Yes, __set_page_dirty_nobuffers confusingly can also be called for pages > with buffers. In the case that the page has buffers (or any other private > metadata), then __set_page_dirty_nobuffers does not have enough information > to know whether the page should be uptodate before being marked dirty. > > In the __set_page_dirty case in fs/buffer.c, we _do_ know that the page > has buffers and that it would be wrong to have a situation where the > page is !uptodate at this point. > > Is that clear? Or have I explained it poorly? > Hmm...does that comes from difference of the purpose of the functions ? Is this correct ? == set_page_dirty_buffers() (in fs/buffer.c) makes a page and _all_ buffers on it dirty. So, a page *must* be up-to-date when it calls set_page_dirty_buffers(). This is used for mapped pages or some callers which requires the whole page containes valid data. In set_page_dirty_nobuffers()case , it just makes a page to be dirty. We can't see whether a page is really up-to-date or not when PagePrivate(page) && !PageUptodate(page). This is used for a page which contains some data to be written out. (part of buffers contains data.) == Thank you. -Kame -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org