* Re: Warning on memory offline (possible in migration ?) [not found] ` <20080417091930.cbac6286.kamezawa.hiroyu@jp.fujitsu.com> @ 2008-04-17 6:38 ` KAMEZAWA Hiroyuki 2008-04-17 6:43 ` Andrew Morton 0 siblings, 1 reply; 3+ messages in thread From: KAMEZAWA Hiroyuki @ 2008-04-17 6:38 UTC (permalink / raw) To: KAMEZAWA Hiroyuki Cc: Andrew Morton, clameter, linux-mm, npiggin, y-goto, LKML On Thu, 17 Apr 2008 09:19:30 +0900 KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> wrote: > > I'd expect that you could reproduce this by disabling readahead with > > fadvise(POSIX_FADV_RANDOM) and then issuing the above four reads. > > > Thank you for advice. I'll try. > (Added lkml to CC:) What happens: When I do memory offline on ia64/NUMA box, __set_page_dirty_buffers() printed out WARNINGS because the page under migration is not up-to-date. Following is my investigation. Assume 16k pages / 4 buffers of 4096bytes block (ext3). 4 buffers on a page of ext3. At page offlining, we can find a page which is not up-to-date. But all buffers of the page seems up-to-date. buffers on a page by prink(). buffer 0, block_nr= some vaule, state= BH_uptodate | BH_Req| BH_Mapped buffer 1, block_nr= -1, state= BH_uptodate buffer 2, block_nr= -1, state= BH_uptodate buffer 3, block_nr= -1, state= BH_uptodate It seems no I/O for 3 buffers. It's because the page is the last page of inode and blocks for buffer[1,2,3] is not assgined. (maybe BH_uptodate is set by block_write_full_page(). Adding below check can hide the warning....but I can't say this is correct. Can we set this page dirty silently in this case ? === + +static int check_fragment_page(struct page *page, struct address_space *mapping ) +{ + struct inode *inode = mapping->host; + unsigned long lastblock, coverblock; + + if (!page_has_buffers(page)) + return 0; + + lastblock = (i_size_read(inode) - 1) >> inode->i_blkbits; + coverblock = (page->index + 1) << (PAGE_SHIFT - inode->i_blkbits); + + return coverblock > lastblock; +} + + + static int __set_page_dirty(struct page *page, struct address_space *mapping, int warn) { @@ -717,7 +734,9 @@ static int __set_page_dirty(struct page write_lock_irq(&mapping->tree_lock); if (page->mapping) { /* Race with truncate? */ - WARN_ON_ONCE(warn && !PageUptodate(page)); + WARN_ON_ONCE(warn + && !PageUptodate(page) + && !check_fragment_page(page, mapping)); if (mapping_cap_account_dirty(mapping)) { __inc_zone_page_state(page, NR_FILE_DIRTY); == Thanks, -Kame ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Warning on memory offline (possible in migration ?) 2008-04-17 6:38 ` Warning on memory offline (possible in migration ?) KAMEZAWA Hiroyuki @ 2008-04-17 6:43 ` Andrew Morton 2008-04-17 6:55 ` KAMEZAWA Hiroyuki 0 siblings, 1 reply; 3+ messages in thread From: Andrew Morton @ 2008-04-17 6:43 UTC (permalink / raw) To: KAMEZAWA Hiroyuki; +Cc: clameter, linux-mm, npiggin, y-goto, LKML On Thu, 17 Apr 2008 15:38:18 +0900 KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> wrote: > On Thu, 17 Apr 2008 09:19:30 +0900 > KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> wrote: > > > I'd expect that you could reproduce this by disabling readahead with > > > fadvise(POSIX_FADV_RANDOM) and then issuing the above four reads. > > > > > Thank you for advice. I'll try. > > > (Added lkml to CC:) > > What happens: > When I do memory offline on ia64/NUMA box, __set_page_dirty_buffers() printed > out WARNINGS because the page under migration is not up-to-date. The warning is in __set_page_dirty(). > Following is my investigation. > > Assume 16k pages / 4 buffers of 4096bytes block (ext3). > 4 buffers on a page of ext3. > > At page offlining, we can find a page which is not up-to-date. > But all buffers of the page seems up-to-date. > > buffers on a page by prink(). > buffer 0, block_nr= some vaule, state= BH_uptodate | BH_Req| BH_Mapped > buffer 1, block_nr= -1, state= BH_uptodate > buffer 2, block_nr= -1, state= BH_uptodate > buffer 3, block_nr= -1, state= BH_uptodate > > It seems no I/O for 3 buffers. It's because the page is the last page of inode > and blocks for buffer[1,2,3] is not assgined. > (maybe BH_uptodate is set by block_write_full_page(). > > Adding below check can hide the warning....but I can't say this is correct. > Can we set this page dirty silently in this case ? > > === > + > +static int check_fragment_page(struct page *page, struct address_space *mapping > ) > +{ > + struct inode *inode = mapping->host; > + unsigned long lastblock, coverblock; > + > + if (!page_has_buffers(page)) > + return 0; > + > + lastblock = (i_size_read(inode) - 1) >> inode->i_blkbits; > + coverblock = (page->index + 1) << (PAGE_SHIFT - inode->i_blkbits); > + > + return coverblock > lastblock; > +} > + > + > + > static int __set_page_dirty(struct page *page, > struct address_space *mapping, int warn) > { > @@ -717,7 +734,9 @@ static int __set_page_dirty(struct page > > write_lock_irq(&mapping->tree_lock); > if (page->mapping) { /* Race with truncate? */ > - WARN_ON_ONCE(warn && !PageUptodate(page)); > + WARN_ON_ONCE(warn > + && !PageUptodate(page) > + && !check_fragment_page(page, mapping)); > > if (mapping_cap_account_dirty(mapping)) { > __inc_zone_page_state(page, NR_FILE_DIRTY); > == The warning is just wrong, I think. We don't nowmally hit it because write() will use mark_buffer_dirty() which supresses the warning and mmaped pages are uptodate. Nick? ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Warning on memory offline (possible in migration ?) 2008-04-17 6:43 ` Andrew Morton @ 2008-04-17 6:55 ` KAMEZAWA Hiroyuki 0 siblings, 0 replies; 3+ messages in thread From: KAMEZAWA Hiroyuki @ 2008-04-17 6:55 UTC (permalink / raw) To: Andrew Morton; +Cc: clameter, linux-mm, npiggin, y-goto, LKML On Wed, 16 Apr 2008 23:43:03 -0700 Andrew Morton <akpm@linux-foundation.org> wrote: > On Thu, 17 Apr 2008 15:38:18 +0900 KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> wrote: > > > On Thu, 17 Apr 2008 09:19:30 +0900 > > KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> wrote: > > > > I'd expect that you could reproduce this by disabling readahead with > > > > fadvise(POSIX_FADV_RANDOM) and then issuing the above four reads. > > > > > > > Thank you for advice. I'll try. > > > > > (Added lkml to CC:) > > > > What happens: > > When I do memory offline on ia64/NUMA box, __set_page_dirty_buffers() printed > > out WARNINGS because the page under migration is not up-to-date. > > The warning is in __set_page_dirty(). > Sorry, __set_page_dirty() in fs/buffer.c Thanks, -Kame ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-04-17 6:51 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20080414145806.c921c927.kamezawa.hiroyu@jp.fujitsu.com>
[not found] ` <Pine.LNX.4.64.0804141044030.6296@schroedinger.engr.sgi.com>
[not found] ` <20080416200036.2ea9b5c2.kamezawa.hiroyu@jp.fujitsu.com>
[not found] ` <20080416113642.8ffd5684.akpm@linux-foundation.org>
[not found] ` <20080417091930.cbac6286.kamezawa.hiroyu@jp.fujitsu.com>
2008-04-17 6:38 ` Warning on memory offline (possible in migration ?) KAMEZAWA Hiroyuki
2008-04-17 6:43 ` Andrew Morton
2008-04-17 6:55 ` KAMEZAWA Hiroyuki
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®