From mboxrd@z Thu Jan 1 00:00:00 1970 From: Namjae Jeon Subject: Re: [PATCH 3/9] f2fs: remove redundant lock_page calls Date: Wed, 3 Apr 2013 14:58:49 +0900 Message-ID: References: <1364799360-23145-1-git-send-email-jaegeuk.kim@samsung.com> <1364799360-23145-3-git-send-email-jaegeuk.kim@samsung.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net To: Jaegeuk Kim Return-path: In-Reply-To: <1364799360-23145-3-git-send-email-jaegeuk.kim@samsung.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org 2013/4/1, Jaegeuk Kim : > In get_node_page, we do not need to call lock_page all the time. > > If the node page is cached as uptodate, > > 1. grab_cache_page locks the page, > 2. read_node_page unlocks the page, and > 3. lock_page is called for further process. > > Let's avoid this. Instead of removing the function "read_node_page" completely to avoid the redundant locking, we can simply remove the "unlock" part from the read_node_page and use the same code in ra_node_page, get_node_page, get_node_page_ra.. With this patch change, the same code is getting repeated at several places and IMHO It is not good for the puprose of the modularity. Please share your opinion. Thanks. > > Signed-off-by: Jaegeuk Kim > ---