lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sat, 11 Apr 2009 22:58:31 +0900
From:	KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>
To:	Andrew Morton <akpm@...ux-foundation.org>
Cc:	Wu Fengguang <fengguang.wu@...el.com>,
	linux-kernel@...r.kernel.org, lpk@....spb.su,
	wli@...ementarian.org, torvalds@...ux-foundation.org,
	yinghan@...gle.com, Nick Piggin <npiggin@...e.de>,
	Hugh Dickins <hugh@...itas.com>, Rik van Riel <riel@...hat.com>
Subject: Re: [PATCH 6/9] readahead: clean up and simplify the code for filemap 
	page fault readahead

2009/4/11 Andrew Morton <akpm@...ux-foundation.org>:
> On Fri, 10 Apr 2009 14:10:03 +0800
> Wu Fengguang <fengguang.wu@...el.com> wrote:
>
>> @@ -1553,18 +1581,18 @@ retry_find:
>>       if (unlikely(!PageUptodate(page)))
>>               goto page_not_uptodate;
>>
>> -     /* Must recheck i_size under page lock */
>> +     /*
>> +      * Found the page and have a reference on it.
>> +      * We must recheck i_size under page lock.
>> +      */
>>       size = (i_size_read(inode) + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT;
>> -     if (unlikely(vmf->pgoff >= size)) {
>> +     if (unlikely(offset >= size)) {
>>               unlock_page(page);
>>               page_cache_release(page);
>>               return VM_FAULT_SIGBUS;
>>       }
>
> This hunk broke
> mm-update_page_reclaim_stat-is-called-from-page-fault-path.patch.
>
>
> I fixed it thusly:
>
>        /*
>         * Found the page and have a reference on it.
>         * We must recheck i_size under page lock.
>         */
>        size = (i_size_read(inode) + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT;
>        if (unlikely(offset >= size)) {
>                unlock_page(page);
>                page_cache_release(page);
>                return VM_FAULT_SIGBUS;
>        }
> +       update_page_reclaim_stat(page);
>        ra->prev_pos = (loff_t)offset << PAGE_CACHE_SHIFT;
>        vmf->page = page;
>        return ret | VM_FAULT_LOCKED;
>
> which seems logical to me.
>
> Although now I look at it, it seems that
> mm-update_page_reclaim_stat-is-called-from-page-fault-path.patch should
> go into 2.6.30?

I haven't see this patch detail and I don't think
mm-update_page_reclaim_stat-is-called-from-page-fault-path.patch
should go into 2.6.30, but I have one question.


> Ah.  But I have a note here that I didn't like it, because it adds lots
> of new spinlocking to fastpaths.  So I'll leave things as they stand
> until we have had a little talk about that.

add?

old code: grab zone->lru_lock via mark_page_accessed()
new code: grab zone->lru_lock via update_reclaim_stat()

one remove, one add.

But I agree its lock can be removed maybe..
I'm sorry my late work.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ