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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 31E82C54EAA for ; Mon, 30 Jan 2023 21:57:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CAC666B0072; Mon, 30 Jan 2023 16:57:09 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C35216B0073; Mon, 30 Jan 2023 16:57:09 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AAF8C6B0074; Mon, 30 Jan 2023 16:57:09 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 9CA056B0072 for ; Mon, 30 Jan 2023 16:57:09 -0500 (EST) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 65B1940BDF for ; Mon, 30 Jan 2023 21:57:09 +0000 (UTC) X-FDA: 80412826578.10.0289D7E Received: from mail-io1-f52.google.com (mail-io1-f52.google.com [209.85.166.52]) by imf21.hostedemail.com (Postfix) with ESMTP id 801F51C000E for ; Mon, 30 Jan 2023 21:57:07 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=kernel-dk.20210112.gappssmtp.com header.s=20210112 header.b=cmbI+LjE; spf=pass (imf21.hostedemail.com: domain of axboe@kernel.dk designates 209.85.166.52 as permitted sender) smtp.mailfrom=axboe@kernel.dk; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1675115827; a=rsa-sha256; cv=none; b=vVjnHRroRc6HLJ6gZV2BOr/lw6pnWddbtTo1SA6W7IjTTZMFic4KPwDRHGinO3gozy9n4g 49QStqQAZE2kK/XB4l7k6y+ALpVrOsk0A+Nl621g0bJjB2Z8qbOUi1pqvsPUEGI4toE6B1 72WHlyp8ScU+MFxSyqc/6Pd81V1j13U= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=kernel-dk.20210112.gappssmtp.com header.s=20210112 header.b=cmbI+LjE; spf=pass (imf21.hostedemail.com: domain of axboe@kernel.dk designates 209.85.166.52 as permitted sender) smtp.mailfrom=axboe@kernel.dk; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1675115827; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=zM1FAPN4aVgv0PsNwh2Z6SiEmu+VWU974/d4fqRl+L4=; b=J828USLtXeYGKqEh6aSdlgJVDY2ocnqn6WjUUlOAKpowHhZH/R8oCReUQw1lQP+xCa82f9 13DQJ8LePorncwP95zQOWhzhHtvbYyCCFU17djUbBR0aFnEq/OoouoPABF6rOloA6ZJYJ2 FVxiUj7zWxnUkNxLQOtXRmu1VNiRgtU= Received: by mail-io1-f52.google.com with SMTP id r6so2517155ioj.5 for ; Mon, 30 Jan 2023 13:57:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:in-reply-to:references:cc:to:from :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=zM1FAPN4aVgv0PsNwh2Z6SiEmu+VWU974/d4fqRl+L4=; b=cmbI+LjEdovrcfZ4O1yo+gizi6OKfj93sPfiIfwj4ga1EwlBOLUO0wsGKXP5qSit0Y Oh7msuM7dEWAwQyADtiJ70s4K2d7pTcrWG3+yMWc/m+n++dGUQevrjaOoCoSvuVz54UB evfCDwN4DlQOrx0MfeXqiWTH7pSppx+Y+6pVxsdWM00TqiAfypFtyDZnoM8/+Yw4bTkq 7IcYWk8uSaeIqj94xXqr8puaAdRZuWW6ZWnaqRrYM5UBvzv17MMCZDlAV9Uw0WghH5Gx pPWCawpU9Ct8m+Z/REB4HcHNv4FNNOZTBmaZdyn2GdN42cgaZ/7NyP/fpGBcm0nqU7KD RXYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:references:cc:to:from :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=zM1FAPN4aVgv0PsNwh2Z6SiEmu+VWU974/d4fqRl+L4=; b=pKOHmSQI3BeHgpfkg2XNQ80Hlcs7G+vIzyB3WB0EqlN4ecgvPIE9LnRlY3wrDttxgn WipSFKAvtfcSPJYX0o91IIq0BjtZorMfilUFie7eePT76m7T2t3b2bZ+P0v/XK8suNRF Tkk6zlD14tAl/EO9e+y6xihcFmPR74lKPXu3pngyt9EqO0FDFGAoO2QzC91ukR52vXM8 r3wbAxz1g1gjzF1PHgevllCtOjmAVDvMgPn2rC26hbpX6AbMfhsMenEHy4CgwWyE+A2j jrRtMbjP4ghYjXAvRrmRCJewJj/0KpaCFn2Wa50Mi4hXlSEsICiCm5owyyMUCE7QXgEu +grg== X-Gm-Message-State: AO0yUKXizg1j317i2cebZ996nCo2h1mL4SfyTWbT7rOZxdEraEvxo+Vl y3i0bE27kK8uVDC82XXdTyJfCiUH98jsIITg X-Google-Smtp-Source: AK7set99KniAMbHUWWBpzRRRsc73wD+V6XoR2N5DlGbxFcMtJ50G+uGAY70+qpAis+xzPW+Vg5ZAbQ== X-Received: by 2002:a05:6602:88f:b0:719:6a2:99d8 with SMTP id f15-20020a056602088f00b0071906a299d8mr1372843ioz.0.1675115826654; Mon, 30 Jan 2023 13:57:06 -0800 (PST) Received: from [192.168.1.94] ([96.43.243.2]) by smtp.gmail.com with ESMTPSA id w69-20020a025d48000000b00375a885f908sm5004931jaa.36.2023.01.30.13.57.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 30 Jan 2023 13:57:06 -0800 (PST) Message-ID: Date: Mon, 30 Jan 2023 14:57:04 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0 Subject: Re: [GIT PULL] iov_iter: Improve page extraction (pin or just list) Content-Language: en-US From: Jens Axboe To: David Howells Cc: Al Viro , Christoph Hellwig , Matthew Wilcox , Jan Kara , David Hildenbrand , John Hubbard , Jason Gunthorpe , Logan Gunthorpe , Jeff Layton , linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <3351099.1675077249@warthog.procyon.org.uk> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspam-User: X-Rspamd-Queue-Id: 801F51C000E X-Rspamd-Server: rspam01 X-Stat-Signature: swwch3suf6tfr1ur7mteuxb613uupykk X-HE-Tag: 1675115827-362401 X-HE-Meta: U2FsdGVkX1/p78sh5EP4NYCfns55Se6oQLoENJ9Cp0ioT2F1eyADQZFNWvhBIWZ/ZCwMoaXQGxK9JSt8P3Mcar7w9mXnu68batIfoMUvNLxX4O7hQrKw5Us/1aofuoa4PbH7hDqjPh18OXr1mwCjGbCvYNYCqhKCcT4lobpy1q43knwHoqWbYJhHraeEo1bHhnunVPPky30vyJQImfuoRPHLEU+PUeWYifld0oLAWTkP01YWsQ9I3ErJyxCCSbqEjkt93hw4ARTwkd3oQ6Y4B4W/4Ybf8fN5XqP4gWjwEk/KJaXbGT6uBzswCMU8aqaJq9nL9A2clRcU//opLW/iexO2WPn4An6UuPJxhe/R20JNT6y6KzIi2GmOdXfAVHXxnSx3xTo+ey2wI+S/LxNXXh1HhHfugGHDSPA0yDX+wcucH8hxgyaorJZZ037+cDfuQvDc3HjYBLUn0sE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owner-majordomo@kvack.org List-ID: On 1/30/23 2:55 PM, Jens Axboe wrote: > On 1/30/23 2:33 PM, Jens Axboe wrote: >> On 1/30/23 4:14 AM, David Howells wrote: >>> Hi Jens, >>> >>> Could you consider pulling this patchset into the block tree? I think that >>> Al's fears wrt to pinned pages being removed from page tables causing deadlock >>> have been answered. Granted, there is still the issue of how to handle >>> vmsplice and a bunch of other places to fix, not least skbuff handling. >>> >>> I also have patches to fix cifs in a separate branch that I would also like to >>> push in this merge window - and that requires the first two patches from this >>> series also, so would it be possible for you to merge at least those two >>> rather than manually applying them? >> >> I've pulled this into a separate branch, but based on the block branch, >> for-6.3/iov-extract. It's added to for-next as well. > > This does cause about a 2.7% regression for me, using O_DIRECT on a raw > block device. Looking at a perf diff, here's the top: > > +2.71% [kernel.vmlinux] [k] mod_node_page_state > +2.22% [kernel.vmlinux] [k] iov_iter_extract_pages > > and these two are gone: > > 2.14% [kernel.vmlinux] [k] __iov_iter_get_pages_alloc > 1.53% [kernel.vmlinux] [k] iov_iter_get_pages > > rest is mostly in the noise, but mod_node_page_state() sticks out like > a sore thumb. They seem to be caused by the node stat accounting done > in gup.c for FOLL_PIN. Confirmed just disabling the node_stat bits in mm/gup.c and now the performance is back to the same levels as before. An almost 3% regression is a bit hard to swallow... -- Jens Axboe