From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx169.postini.com [74.125.245.169]) by kanga.kvack.org (Postfix) with SMTP id 79ABE6B0044 for ; Tue, 1 May 2012 11:20:38 -0400 (EDT) From: Jeff Moyer Subject: Re: [PATCH] Describe race of direct read and fork for unaligned buffers References: <1335778207-6511-1-git-send-email-jack@suse.cz> Date: Tue, 01 May 2012 11:11:26 -0400 In-Reply-To: (KOSAKI Motohiro's message of "Tue, 1 May 2012 10:37:20 -0400") Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-linux-mm@kvack.org List-ID: To: KOSAKI Motohiro Cc: Jan Kara , Michael Kerrisk , LKML , linux-man@vger.kernel.org, linux-mm@kvack.org, mgorman@suse.de, npiggin@gmail.com KOSAKI Motohiro writes: >> Hello, >> >> Thank you revisit this. But as far as my remember is correct, this issue is NOT >> unaligned access issue. It's just get_user_pages(_fast) vs fork race issue. i.e. >> DIRECT_IO w/ multi thread process should not use fork(). > > The problem is, fork (and its COW logic) assume new access makes cow break, > But page table protection can't detect a DMA write. Therefore DIO may override > shared page data. Hm, I've only seen this with misaligned or multiple sub-page-sized reads in the same page. AFAIR, aligned, page-sized I/O does not get split. But, I could be wrong... Cheers, Jeff -- 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/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: email@kvack.org