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.3 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 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 A7ADAC2D0CD for ; Tue, 17 Dec 2019 16:42:39 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 6BD7321D7D for ; Tue, 17 Dec 2019 16:42:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=kernel-dk.20150623.gappssmtp.com header.i=@kernel-dk.20150623.gappssmtp.com header.b="Ln434Cl8" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6BD7321D7D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.dk Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 1EE8B8E0092; Tue, 17 Dec 2019 11:42:39 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 19E6B8E0079; Tue, 17 Dec 2019 11:42:39 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 08D538E0092; Tue, 17 Dec 2019 11:42:39 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0189.hostedemail.com [216.40.44.189]) by kanga.kvack.org (Postfix) with ESMTP id E46EA8E0079 for ; Tue, 17 Dec 2019 11:42:38 -0500 (EST) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with SMTP id A9E3B2472 for ; Tue, 17 Dec 2019 16:42:38 +0000 (UTC) X-FDA: 76275201996.10.foot35_8b6cf28116932 X-HE-Tag: foot35_8b6cf28116932 X-Filterd-Recvd-Size: 4373 Received: from mail-io1-f65.google.com (mail-io1-f65.google.com [209.85.166.65]) by imf21.hostedemail.com (Postfix) with ESMTP for ; Tue, 17 Dec 2019 16:42:37 +0000 (UTC) Received: by mail-io1-f65.google.com with SMTP id z8so9885508ioh.0 for ; Tue, 17 Dec 2019 08:42:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=85tJwjfPsvm0o1CtqUKLxcZhYUO7faTPrBd2G2sD4nI=; b=Ln434Cl87LG0Fhc5QQ+fjnUtO5EBQMmZiQA99NPbXKIHMXwk/CPV+7eXQR+spZiR05 7NZSGPylcPDhe+hrtQph4Tcz0HA/+Ps3tu/nv5ff6mp21dQy/mT2GfSpvy2N/T6TD1n8 y7F97PxPMZbr+l/VcpvRiEZuGi6A7oz61Hv1tz6+m5uZtiCdhpmrDGf1JSiEfNX9q2XT ePkiPEVerc7ksamxDVA0yRuJogydPUe7WKUtflNHHlZ358RLNEeBBDLR/nh8su474x// /ViR/BWI7rg1ZfJ8neJTkrDj2ChUBd4naTOK7WEH37/hFINrV+PS56fZ3tN2QekQzt53 1Wug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=85tJwjfPsvm0o1CtqUKLxcZhYUO7faTPrBd2G2sD4nI=; b=Oz4M5ZTkadTxOmrvYr2ZjwzlqpCGSIcS91qhk9WyiQ30u56leJPnRaRR9udem9wCWI ulFKKbjVmGmSTSTzdV8S3PD+euQOHWmgkPV1pUI11EK10syALyIvVozwV476uTrD4S+H h2CpTD88G9bm9EXRyoHjvhY+RadZENQPY2vrf9aMHbkd5juKC79Lbj+iaT2jUWcP0Umh qgVKUvDn6K90DYjl0hm398qw8X1357xKrBB01Q7MU8RMafpJl8Lg2E6qavLcyPVpLY3u pNphkrDR0Z5EydtTHLbgtruwQ0bC2bfYUPDQrk6qsPYb66ZDioBGmsre7n8hT9aAi8P9 75vA== X-Gm-Message-State: APjAAAXTQH0lo06Mbxtck3dJDfSSocbOrja8bSRCdGy+OytNCDwPyDM4 +6dG43/v/k58ZifwAjyqFI58iw== X-Google-Smtp-Source: APXvYqyYO5RxUVG/bXRqYescBr8YitSiwk6ahy0P0Apkt/Qsr+xKR6Zn0kyBe2qQk4SjmxlWjKkIeQ== X-Received: by 2002:a5d:9d4a:: with SMTP id k10mr4619158iok.134.1576600957011; Tue, 17 Dec 2019 08:42:37 -0800 (PST) Received: from [192.168.1.159] ([65.144.74.34]) by smtp.gmail.com with ESMTPSA id y75sm6925426ill.87.2019.12.17.08.42.36 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 17 Dec 2019 08:42:36 -0800 (PST) Subject: Re: [PATCH 1/6] fs: add read support for RWF_UNCACHED To: Guoqing Jiang , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org Cc: willy@infradead.org, clm@fb.com, torvalds@linux-foundation.org, david@fromorbit.com References: <20191217143948.26380-1-axboe@kernel.dk> <20191217143948.26380-2-axboe@kernel.dk> <1d0bf482-8786-00b7-310d-4de38607786d@cloud.ionos.com> From: Jens Axboe Message-ID: Date: Tue, 17 Dec 2019 09:42:35 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: <1d0bf482-8786-00b7-310d-4de38607786d@cloud.ionos.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 12/17/19 8:16 AM, Guoqing Jiang wrote: > > On 12/17/19 3:39 PM, Jens Axboe wrote: >> If RWF_UNCACHED is set for io_uring (or preadv2(2)), we'll use private >> pages for the buffered reads. These pages will never be inserted into >> the page cache, and they are simply droped when we have done the copy at >> the end of IO. >> >> If pages in the read range are already in the page cache, then use those >> for just copying the data instead of starting IO on private pages. >> >> A previous solution used the page cache even for non-cached ranges, but >> the cost of doing so was too high. Removing nodes at the end is >> expensive, even with LRU bypass. On top of that, repeatedly >> instantiating new xarray nodes is very costly, as it needs to memset 576 >> bytes of data, and freeing said nodes involve an RCU call per node as >> well. All that adds up, making uncached somewhat slower than O_DIRECT. >> >> With the current*solition*, we're basically at O_DIRECT levels of > > Maybe it is 'solution' here. Indeed, fixed up, thanks. -- Jens Axboe