From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CA9E9E67492 for ; Fri, 1 Nov 2024 01:23:13 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1t6gNb-0004Dq-MR; Fri, 01 Nov 2024 01:23:11 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1t6gNZ-0004Dc-Oc for linux-f2fs-devel@lists.sourceforge.net; Fri, 01 Nov 2024 01:23:09 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=In-Reply-To:Content-Type:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=Jzy7y6P/lBfK3HvrIgyNtJU919YgrzenIJGTqtSnTjU=; b=nF5O5gYwRje25y6izpIXGNV78S yTLiCFKZVOBdl7X4JIlSzZ2kO+1WlgxvIOUJdva37SKV5BhBRJkrOnc2S7N0MvA6gWKQVjvoGQQeq N+rGuzSroj0Q3JFAdKhdZ1T5YcYu2Rrwpuu8aFGSspGRm6VXdmgBsAvH11+VCyXJMEEQ=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To :From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=Jzy7y6P/lBfK3HvrIgyNtJU919YgrzenIJGTqtSnTjU=; b=db02+KFGaLuL1oP3MA3iLBlQwv 3+pGATd7SGkhxIjImb9kwy5lG3Mf8+d8sveTLpae2mI6oOk4VV3VvjesT38DHoXf4FYSNbzwK5eRO GRnDF2ceXtykkD7j3AMXlYZxa6JjyCnxQdp+I0eepLyphPt9zZ4WcaqH9DpTd+Yrzo5s=; Received: from nyc.source.kernel.org ([147.75.193.91]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1t6gNV-0006F7-Cx for linux-f2fs-devel@lists.sourceforge.net; Fri, 01 Nov 2024 01:23:09 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id 1AA04A414C2; Fri, 1 Nov 2024 01:21:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3F1F2C4CEC3; Fri, 1 Nov 2024 01:22:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1730424179; bh=wzXs1qdakHCZrExniZa/Yr49WnDzRpD4rfPpqytB2AA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=RzXXgyVry1Kt8aZehwH78q50mTUIx92z5UnJtm+a6cRGZshTQ3aXRPibFtizcWwn7 1EA59r4g1WaI0F8Kj+ULKQjfwzxvzA683fONZKldR0YEbn5qRgk55+CNHJynmX+nLd IzlF/DCtyqqbEOojIq4LVZNQx8n0XKOitB18YHxo0Zg9gaSG1xTLULu5FHE2l/mMzi yKBwVSM8XQuAaVdK4Wna1ci9aie4eVtOWLheXDN10iJ2ydrP/ZjQ6ue6SvgrAYFyrP DXvqKeNfblCzgpxh6AE1CukSL4Puu6gf6sIlxujrj5NlMFgDivytBpk/Qh0kcsfJWO cQ6MqBd6JyJzw== Date: Fri, 1 Nov 2024 01:22:57 +0000 To: Chao Yu Message-ID: References: <20241031102200.440407-1-chao@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20241031102200.440407-1-chao@kernel.org> X-Headers-End: 1t6gNV-0006F7-Cx Subject: Re: [f2fs-dev] [PATCH] f2fs: fix to map blocks correctly for direct read X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Jaegeuk Kim via Linux-f2fs-devel Reply-To: Jaegeuk Kim Cc: kernel test robot , linux-kernel@vger.kernel.org, Cyril Hrubis , linux-f2fs-devel@lists.sourceforge.net Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net On 10/31, Chao Yu wrote: > f2fs_map_blocks() supports to map continuous holes or preallocated > address, we should avoid setting F2FS_MAP_MAPPED for these cases > only, otherwise, it may fail f2fs_iomap_begin(), and make direct > write fallbacking to use buffered IO and flush, result in performance > regression. Is this fixing direct write or read? > > Fixes: 9f0f6bf42714 ("f2fs: support to map continuous holes or preallocated address") > Reported-by: kernel test robot > Closes: https://lore.kernel.org/oe-lkp/202409122103.e45aa13b-oliver.sang@intel.com > Cc: Cyril Hrubis > Signed-off-by: Chao Yu > --- > fs/f2fs/data.c | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c > index 306b86b0595d..38b85160c6bd 100644 > --- a/fs/f2fs/data.c > +++ b/fs/f2fs/data.c > @@ -1676,7 +1676,12 @@ int f2fs_map_blocks(struct inode *inode, struct f2fs_map_blocks *map, int flag) > /* reserved delalloc block should be mapped for fiemap. */ > if (blkaddr == NEW_ADDR) > map->m_flags |= F2FS_MAP_DELALLOC; > - if (flag != F2FS_GET_BLOCK_DIO || !is_hole) > + /* > + * f2fs_map_blocks() supports to map continuous holes or > + * preallocated address, don't set F2FS_MAP_MAPPED for these > + * cases only. > + */ > + if (flag != F2FS_GET_BLOCK_DIO || map->m_may_create || !is_hole) So, this is adding map->m_may_create, which is for writes? > map->m_flags |= F2FS_MAP_MAPPED; > > map->m_pblk = blkaddr; > -- > 2.40.1 _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 120F34D8D1 for ; Fri, 1 Nov 2024 01:22:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730424180; cv=none; b=fxrNl2Sp3XWBZmBNuHpitbaInHSMRYMgg8sESDVXSGdl9FFY0UnmSVgUdvcShhs6pmnB0Nc3VIounyDaA5nVazP5f2ojpWZ+DgeEZW1TVEnjS4YtfbnkjsenHusGMDGAW7X+fKRq4yCCybsXIlcmTZzUn2SU6j+BcPbAxW4t2nI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730424180; c=relaxed/simple; bh=wzXs1qdakHCZrExniZa/Yr49WnDzRpD4rfPpqytB2AA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=OiETuyDnDJUf78kX3hrSTpTc3mkxCnRXdbZt7pyRl0YfWs709K0ynbu5vOijyoG4pOaDldd3VEuH7kYN4f6p2wm2E7KCo2/bIoL5jlFXHq0xW/dXlcGnGc/N0oWZpcCCffXhfdzdHijQtLagASsVuRw+HjngsxuegoApEI4t3fM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=RzXXgyVr; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="RzXXgyVr" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3F1F2C4CEC3; Fri, 1 Nov 2024 01:22:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1730424179; bh=wzXs1qdakHCZrExniZa/Yr49WnDzRpD4rfPpqytB2AA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=RzXXgyVry1Kt8aZehwH78q50mTUIx92z5UnJtm+a6cRGZshTQ3aXRPibFtizcWwn7 1EA59r4g1WaI0F8Kj+ULKQjfwzxvzA683fONZKldR0YEbn5qRgk55+CNHJynmX+nLd IzlF/DCtyqqbEOojIq4LVZNQx8n0XKOitB18YHxo0Zg9gaSG1xTLULu5FHE2l/mMzi yKBwVSM8XQuAaVdK4Wna1ci9aie4eVtOWLheXDN10iJ2ydrP/ZjQ6ue6SvgrAYFyrP DXvqKeNfblCzgpxh6AE1CukSL4Puu6gf6sIlxujrj5NlMFgDivytBpk/Qh0kcsfJWO cQ6MqBd6JyJzw== Date: Fri, 1 Nov 2024 01:22:57 +0000 From: Jaegeuk Kim To: Chao Yu Cc: linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, kernel test robot , Cyril Hrubis Subject: Re: [PATCH] f2fs: fix to map blocks correctly for direct read Message-ID: References: <20241031102200.440407-1-chao@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20241031102200.440407-1-chao@kernel.org> On 10/31, Chao Yu wrote: > f2fs_map_blocks() supports to map continuous holes or preallocated > address, we should avoid setting F2FS_MAP_MAPPED for these cases > only, otherwise, it may fail f2fs_iomap_begin(), and make direct > write fallbacking to use buffered IO and flush, result in performance > regression. Is this fixing direct write or read? > > Fixes: 9f0f6bf42714 ("f2fs: support to map continuous holes or preallocated address") > Reported-by: kernel test robot > Closes: https://lore.kernel.org/oe-lkp/202409122103.e45aa13b-oliver.sang@intel.com > Cc: Cyril Hrubis > Signed-off-by: Chao Yu > --- > fs/f2fs/data.c | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c > index 306b86b0595d..38b85160c6bd 100644 > --- a/fs/f2fs/data.c > +++ b/fs/f2fs/data.c > @@ -1676,7 +1676,12 @@ int f2fs_map_blocks(struct inode *inode, struct f2fs_map_blocks *map, int flag) > /* reserved delalloc block should be mapped for fiemap. */ > if (blkaddr == NEW_ADDR) > map->m_flags |= F2FS_MAP_DELALLOC; > - if (flag != F2FS_GET_BLOCK_DIO || !is_hole) > + /* > + * f2fs_map_blocks() supports to map continuous holes or > + * preallocated address, don't set F2FS_MAP_MAPPED for these > + * cases only. > + */ > + if (flag != F2FS_GET_BLOCK_DIO || map->m_may_create || !is_hole) So, this is adding map->m_may_create, which is for writes? > map->m_flags |= F2FS_MAP_MAPPED; > > map->m_pblk = blkaddr; > -- > 2.40.1