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=-0.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no 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 D1E39C33CBA for ; Mon, 20 Jan 2020 13:54:41 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 92E4A22464 for ; Mon, 20 Jan 2020 13:54:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="G/5kXvqR" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 92E4A22464 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 3F1956B0660; Mon, 20 Jan 2020 08:54:41 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 3A2206B0661; Mon, 20 Jan 2020 08:54:41 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2B86B6B0662; Mon, 20 Jan 2020 08:54:41 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0219.hostedemail.com [216.40.44.219]) by kanga.kvack.org (Postfix) with ESMTP id 171296B0660 for ; Mon, 20 Jan 2020 08:54:41 -0500 (EST) Received: from smtpin14.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with SMTP id C2BAE180AD80F for ; Mon, 20 Jan 2020 13:54:40 +0000 (UTC) X-FDA: 76398157920.14.aunt71_45e9bcbe99c39 X-HE-Tag: aunt71_45e9bcbe99c39 X-Filterd-Recvd-Size: 4977 Received: from mail-io1-f65.google.com (mail-io1-f65.google.com [209.85.166.65]) by imf25.hostedemail.com (Postfix) with ESMTP for ; Mon, 20 Jan 2020 13:54:40 +0000 (UTC) Received: by mail-io1-f65.google.com with SMTP id x1so33712439iop.7 for ; Mon, 20 Jan 2020 05:54:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=A9BomRl8cOqD5J6VizMdaO4qtRV2qD8Sxz+xVA/FCwY=; b=G/5kXvqRu1WxCz3g1HVe00s3Xff3vBvEvqpGz/eGT7WcOdxfQsr01Tnwu4vt9jApWy nuSgta0xztw4dSoRI2mZFEHqyW0y5wEsRaQhdKbbPmv1ilZuPg75Z9DE4ZVanolNYjzi Zcm9L7afSxsLPz+6ldqFYEaaNT1ioxglNJI6R/pIY6//qpaavBYlUOyZrtyvAkukg0Bo NVlO3lASc5pCd7mP2WWe80vY/l+wAwtoBrz8VnZnFNXKU8nE3XboNJce7rMhXYskE8dk xuaTwBUJQcqzQhSq3F0dtePOpn8bvY6DCDsjl8lAUK3myukdsMTYGePZp32rAhq4lZR+ a+Kg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=A9BomRl8cOqD5J6VizMdaO4qtRV2qD8Sxz+xVA/FCwY=; b=rb+4xEQKzM8MrZzzaSh5hcH5u9CoaZA2+HaRdvNHu/KYg06z0xxwbvAGFs+02Ts51j 39cjGvhZjuZJ5Zi+o3ASgOF4n0wuBwrJQTsEESVcdVdi7lsNiYyex557PUUXk3tT86T0 V7PDlnrGq5LBIve37thTBMdmGh7kYMHP1jkzn+LTEBGH++03Bj3pwR0so4UtBgRZhGxr pXx5Z1Jtt1NJgO33yfZfdrtltMtBVQfRLiX+jh4j94ftLjtuSCLDbr1kIvUQCiz10fKY rN/3NSVia20LV3s70QQqL18AqMdC+GrqodE6YAvbbNN+4nA2PDfrKWvfX8IffpjALcjh avxg== X-Gm-Message-State: APjAAAWF09rTi0iEYXQnp6ZXSJY7DowS2gK9tvKof9xp/x+DBUyJzLvW 6oLm2GqJ0xX8rsX8jiPA6/5qkbNa8AG2zB5NyBI= X-Google-Smtp-Source: APXvYqzJYVTTnME9AcE53rOwW95R5jUMm4G5XkLB9kyPpoSSXoCZtLZqNzywfWbx31CI1a8KPWD3R6NlSsDblYCZr8Q= X-Received: by 2002:a6b:f214:: with SMTP id q20mr43607002ioh.137.1579528479611; Mon, 20 Jan 2020 05:54:39 -0800 (PST) MIME-Version: 1.0 References: <20190829131034.10563-1-jack@suse.cz> <20200120120333.GG19861@quack2.suse.cz> In-Reply-To: <20200120120333.GG19861@quack2.suse.cz> From: Amir Goldstein Date: Mon, 20 Jan 2020 15:54:28 +0200 Message-ID: Subject: Re: [PATCH 0/3 v2] xfs: Fix races between readahead and hole punching To: Jan Kara Cc: linux-xfs , Linux MM , "Darrick J. Wong" , Boaz Harrosh , linux-fsdevel , Matthew Wilcox , Jens Axboe , Kent Overstreet Content-Type: text/plain; charset="UTF-8" X-Bogosity: Ham, tests=bogofilter, spamicity=0.000001, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, Jan 20, 2020 at 2:03 PM Jan Kara wrote: > > Hi Amir! > > On Fri 17-01-20 12:50:58, Amir Goldstein wrote: > > On Thu, Aug 29, 2019 at 4:10 PM Jan Kara wrote: > > > > > > Hello, > > > > > > this is a patch series that addresses a possible race between readahead and > > > hole punching Amir has discovered [1]. The first patch makes madvise(2) to > > > handle readahead requests through fadvise infrastructure, the third patch > > > then adds necessary locking to XFS to protect against the race. Note that > > > other filesystems need similar protections but e.g. in case of ext4 it isn't > > > so simple without seriously regressing mixed rw workload performance so > > > I'm pushing just xfs fix at this moment which is simple. > > > > > > > Could you give a quick status update about the state of this issue for > > ext4 and other fs. I remember some solutions were discussed. > > Shortly: I didn't get to this. I'm sorry :-|. I'll bump up a priority but I > can't promise anything at the moment. > > > Perhaps this could be a good topic for a cross track session in LSF/MM? > > Maybe although this is one of the cases where it's easy to chat about > possible solutions but somewhat tedious to write one so I'm not sure how > productive that would be. BTW my discussion with Kent [1] is in fact very > related to this problem (the interval lock he has is to stop exactly races > like this). > Well, I was mostly interested to know if there is an agreement on the way to solve the problem. If we need to discuss it to reach consensus than it might be a good topic for LSF/MM. If you already know what needs to be done, there is no need for a discussion. > > Aren't the challenges posed by this race also relevant for RWF_UNCACHED? > > Do you have anything particular in mind? I don't see how RWF_UNCACHED would > make this any better or worse than DIO / readahead... > Not better nor worse. I meant that RFW_UNCACHED is another case that would suffer the same races. Thanks, Amir.