Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754180AbbETWvT (ORCPT ); Wed, 20 May 2015 18:51:19 -0400 Received: from mail.phunq.net ([184.71.0.62]:34751 "EHLO starbase.phunq.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751774AbbETWvQ (ORCPT ); Wed, 20 May 2015 18:51:16 -0400 Message-ID: <555D0FDF.3070303@phunq.net> Date: Wed, 20 May 2015 15:51:11 -0700 From: Daniel Phillips User-Agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Rik van Riel , Jan Kara , David Lang CC: tux3@tux3.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, OGAWA Hirofumi Subject: Re: [FYI] tux3: Core changes References: <8f886f13-6550-4322-95be-93244ae61045@phunq.net> <55545C2F.8040207@phunq.net> <20150519140045.GA16313@quack.suse.cz> <555B8C79.4090909@phunq.net> <20150520144429.GA17783@quack.suse.cz> <555CB4B6.8050305@phunq.net> <555CE62C.5030202@redhat.com> In-Reply-To: <555CE62C.5030202@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1731 Lines: 49 On 05/20/2015 12:53 PM, Rik van Riel wrote: > On 05/20/2015 12:22 PM, Daniel Phillips wrote: >> On 05/20/2015 07:44 AM, Jan Kara wrote: >>> On Tue 19-05-15 13:33:31, David Lang wrote: > >>> Yeah, that's what I meant. If you create a function which manipulates >>> page cache, you better make it work with other functions manipulating page >>> cache. Otherwise it's a landmine waiting to be tripped by some unsuspecting >>> developer. Sure you can document all the conditions under which the >>> function is safe to use but a function that has several paragraphs in front >>> of it explaning when it is safe to use isn't very good API... >> >> Violent agreement, of course. To put it in concrete terms, each of >> the page fork support functions must be examined and determined >> sane. They are: >> >> * cow_replace_page_cache >> * cow_delete_from_page_cache >> * cow_clone_page >> * page_cow_one >> * page_cow_file >> >> Would it be useful to drill down into those, starting from the top >> of the list? > > How do these interact with other page cache functions, like > find_get_page() ? Nicely: https://github.com/OGAWAHirofumi/linux-tux3/blob/hirofumi/fs/tux3/filemap_mmap.c#L182 > How does tux3 prevent a user of find_get_page() from reading from > or writing into the pre-COW page, instead of the current page? Careful control of the dirty bits (we have two of them, one each for front and back). That is what pagefork_for_blockdirty is about. Regards, Daniel -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/