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 X-Spam-Level: X-Spam-Status: No, score=-2.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,URIBL_BLOCKED,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2AF47C10F0C for ; Thu, 4 Apr 2019 21:17:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EC607217D4 for ; Thu, 4 Apr 2019 21:17:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730669AbfDDVRf (ORCPT ); Thu, 4 Apr 2019 17:17:35 -0400 Received: from ipmail06.adl6.internode.on.net ([150.101.137.145]:14819 "EHLO ipmail06.adl6.internode.on.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729863AbfDDVRe (ORCPT ); Thu, 4 Apr 2019 17:17:34 -0400 Received: from ppp59-167-129-252.static.internode.on.net (HELO dastard) ([59.167.129.252]) by ipmail06.adl6.internode.on.net with ESMTP; 05 Apr 2019 07:47:31 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1hC9jm-0001L9-Cr; Fri, 05 Apr 2019 08:17:30 +1100 Date: Fri, 5 Apr 2019 08:17:30 +1100 From: Dave Chinner To: Amir Goldstein Cc: "Darrick J . Wong" , Christoph Hellwig , Matthew Wilcox , linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [POC][PATCH] xfs: reduce ilock contention on buffered randrw workload Message-ID: <20190404211730.GD26298@dastard> References: <20190404165737.30889-1-amir73il@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190404165737.30889-1-amir73il@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Thu, Apr 04, 2019 at 07:57:37PM +0300, Amir Goldstein wrote: > This patch improves performance of mixed random rw workload > on xfs without relaxing the atomic buffered read/write guaranty > that xfs has always provided. > > We achieve that by calling generic_file_read_iter() twice. > Once with a discard iterator to warm up page cache before taking > the shared ilock and once again under shared ilock. This will race with thing like truncate, hole punching, etc that serialise IO and invalidate the page cache for data integrity reasons under the IOLOCK. These rely on there being no IO to the inode in progress at all to work correctly, which this patch violates. IOWs, while this is fast, it is not safe and so not a viable approach to solving the problem. FYI, I'm working on a range lock implementation that should both solve the performance issue and the reader starvation issue at the same time by allowing concurrent buffered reads and writes to different file ranges. IO range locks will allow proper exclusion for other extent manipulation operations like fallocate and truncate, and eventually even allow truncate, hole punch, file extension, etc to run concurrently with other non-overlapping IO. They solve more than just the performance issue you are seeing.... Cheers, Dave. -- Dave Chinner david@fromorbit.com