From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx118.postini.com [74.125.245.118]) by kanga.kvack.org (Postfix) with SMTP id 312AE6B002C for ; Mon, 5 Mar 2012 07:15:39 -0500 (EST) Received: by dakp5 with SMTP id p5so5318217dak.8 for ; Mon, 05 Mar 2012 04:15:38 -0800 (PST) MIME-Version: 1.0 In-Reply-To: References: Date: Mon, 5 Mar 2012 20:15:38 +0800 Message-ID: Subject: Re: [PATCH] mm: shmem: unlock valid page From: Hillf Danton Content-Type: text/plain; charset=UTF-8 Sender: owner-linux-mm@kvack.org List-ID: To: Hugh Dickins Cc: Linux-MM , Andrew Morton , LKML On Mon, Mar 5, 2012 at 1:51 AM, Hugh Dickins wrote: > On Sun, 4 Mar 2012, Hillf Danton wrote: >> In shmem_read_mapping_page_gfp() page is unlocked if no error returned, >> so the unlocked page has to valid. >> >> To guarantee that validity, when getting page, success result is feed >> back to caller only when page is valid. >> >> Signed-off-by: Hillf Danton > > I don't understand your description, nor its relation to the patch. > > NAK to the patch: when no page has previously been allocated, the > SGP_READ case avoids allocation and returns NULL - do_shmem_file_read > then copies the ZERO_PAGE instead, avoiding lots of unnecessary memory > allocation when reading a large sparse file. > Hi Hugh Thanks for your review. It was not well prepared as I missed SGP_CACHE. -hd -- 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