Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3089897pxk; Tue, 15 Sep 2020 09:46:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxWX34yRsj9qVK1bOfOOA7scVeWCnkQpsvzyxWN4L2iOjR4OXvqdaZ04tCEqkucdI2ycl0L X-Received: by 2002:a17:906:3791:: with SMTP id n17mr20704019ejc.216.1600188418294; Tue, 15 Sep 2020 09:46:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600188418; cv=none; d=google.com; s=arc-20160816; b=GkVA34+KtiXsPI4TKLcKfQx4lxLyxJqGi0LHVgKzF23v0894QOknSpoog5GQ1dfKCR uITlm0IBDKZWWI0ZikwedI/q/35BpnPvXCUdVUA3/VrZ3yipL/BrY5ft89fwDgYyszzV YmcE1mdAGKXXSWin3t4pluaiVlS3eMXQmJGRvwo07s75ODVEwwzjIcCWI92rkC7dXYzT jFWHHpCa5h9KGxnwdT6InueyhZOydxG9KOjg+9YsKHMG41767C7ba9yJqg7KZMIpnUzC 6LhHQCKjoodtoeSFgbJxNe/ErFqgz0sYIKuatks4h62mDOh6IHz12whCMU9sCoXF/yb9 Fyaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=gu3jry4B0AmzKkFeYjUaKPbyQDrej3ixHxhQeqH0BLU=; b=DCSHAH+CfXQg0E3l8GsK18vOUxnAmhWLhAuNvIEPyk4B83bfGJw5IxDcwhzmqoGntF m0YN+JnXUOEpI7IUHwOs9tgW8h1o09ZltblQQQk6LbqsqaR2nWHAvtJYvOvhgBkTTycm 7ap72Hn0cM9FZLwyqhXnNeMxt+otFMAZYzd4DJaWcMznBNRag4eRyfYowGXZvLel16sG PFN9yoMkah8WQD1zMtUd7kUKhezb0fhm/vi3+YwKYyHZVzRN6nMJ68jG2o/CVSjTWp0I pbNN24+TBQBBP4KEmMCEHSBo+IpZLelHdF2P+rTAGGm2zbMLImGdnTMCQdzqWYiyYT5K zdLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=io1LGxHC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bx18si10012381edb.372.2020.09.15.09.46.36; Tue, 15 Sep 2020 09:46:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=io1LGxHC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727707AbgIOQiy (ORCPT + 99 others); Tue, 15 Sep 2020 12:38:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47798 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727532AbgIOP4I (ORCPT ); Tue, 15 Sep 2020 11:56:08 -0400 Received: from mail-pg1-x542.google.com (mail-pg1-x542.google.com [IPv6:2607:f8b0:4864:20::542]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E90AC06178A for ; Tue, 15 Sep 2020 08:56:08 -0700 (PDT) Received: by mail-pg1-x542.google.com with SMTP id z17so2219351pgc.4 for ; Tue, 15 Sep 2020 08:56:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=gu3jry4B0AmzKkFeYjUaKPbyQDrej3ixHxhQeqH0BLU=; b=io1LGxHCa+bzpTsA004NgcNc1/CPR3FyTOIzwxWhYkryYEBxZnX16fd1+ybJ1IqjKt JHTA9TnuQzWt8K+BCuyuSXUCv+gmCFfkCrXdpJEKNVjZ6gfh8ZhVcn9SqlTvYpw0pZ1P q0MJkdS2mVtbRcn/DRRlERCwlJAhZKyFoABcNJDlNfntWr4nebJ3ry1fwQYQBmy8De9B 1AWZAbkGyhhg+8v9QzPBCBOgsg8/dvzqzuOOFqvEoLoVmpL0YnA1oBfqcOMK6HddCrZo pdwJ32lfd+/AElGAnoxGAFw8+i4ljnn60UPn16TzcdxTSdsOEGLC23dk5COBcgnjhxHU peEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=gu3jry4B0AmzKkFeYjUaKPbyQDrej3ixHxhQeqH0BLU=; b=okq/Ilx+9QGsDbEUXIlxs4EWzhNAn36TnaxhPknbp1ElwIERHT0m5hJSQcyv9AnCiK NeOhIlN+NWNb6iusuO0Ne2byAscKisMpr3wLchTpcQ0tL67OgySn9wazhoGCInsq53Tp Hogyskjlyw5BrqicZRHbxiLQ5jek5Prkx4/DFnp5GU3h9w/8uwG3bwZ6gHZAlDV6SAge ueXvzDtklTUrvP3kzbOnNG33xjRAWDNrFgGTCsHEbNbMl0Q4+Y0f1uYgUJ0xSHZAvXLc gfDX/BX6YYHHLOmNEAJ7amFFJGHMMUV5XSD2wnZWCTjv0YS3VsM9CozBGrawmW3vOXrU FmIg== X-Gm-Message-State: AOAM5305rmY8blXAtAmUsf1aU99M6VglFuAgOxr+yg/5mC4ljebBi3AF gZqytxX4c4PDQ9Fc1zZErdMINQ== X-Received: by 2002:a63:4822:: with SMTP id v34mr14875815pga.342.1600185367654; Tue, 15 Sep 2020 08:56:07 -0700 (PDT) Received: from ziepe.ca ([206.223.160.26]) by smtp.gmail.com with ESMTPSA id f5sm13458346pfj.212.2020.09.15.08.56.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Sep 2020 08:56:06 -0700 (PDT) Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1kIDJN-006U3b-68; Tue, 15 Sep 2020 12:56:05 -0300 Date: Tue, 15 Sep 2020 12:56:05 -0300 From: Jason Gunthorpe To: Peter Xu Cc: Leon Romanovsky , Linux-MM , Linux Kernel Mailing List , "Maya B . Gokhale" , Yang Shi , Marty Mcfadden , Kirill Shutemov , Oleg Nesterov , Jann Horn , Jan Kara , Kirill Tkhai , Andrea Arcangeli , Christoph Hellwig , Andrew Morton , Linus Torvalds Subject: Re: [PATCH 1/4] mm: Trial do_wp_page() simplification Message-ID: <20200915155605.GI1221970@ziepe.ca> References: <20200821234958.7896-1-peterx@redhat.com> <20200821234958.7896-2-peterx@redhat.com> <20200914143829.GA1424636@nvidia.com> <20200914183436.GD30881@xz-x1> <20200914211515.GA5901@xz-x1> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200914211515.GA5901@xz-x1> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 14, 2020 at 05:15:15PM -0400, Peter Xu wrote: > On Mon, Sep 14, 2020 at 02:34:36PM -0400, Peter Xu wrote: > > On Mon, Sep 14, 2020 at 10:32:11AM -0700, Linus Torvalds wrote: > > > On Mon, Sep 14, 2020 at 7:38 AM Jason Gunthorpe wrote: > > > > > > > > I don't have a detailed explanation right now, but this patch appears > > > > to be causing a regression where RDMA subsystem tests fail. Tests > > > > return to normal when this patch is reverted. > > > > > > > > It kind of looks like the process is not seeing DMA'd data to a > > > > pin_user_pages()? > > > > > > I'm a nincompoop. I actually _talked_ to Hugh Dickins about this when > > > he raised concerns, and I dismissed his concerns with "but PAGE_PIN is > > > special". > > > > > > As usual, Hugh was right. Page pinning certainly _is_ special, but > > > it's not that different from the regular GUP code. > > > > > > But in the meantime, I have a lovely confirmation from the kernel test > > > robot, saying that commit 09854ba94c results in a > > > "vm-scalability.throughput 31.4% improvement", which was what I was > > > hoping for - the complexity wasn't just complexity, it was active > > > badness due to the page locking horrors. > > > > > > I think what we want to do is basically do the "early COW", but only > > > do it for FOLL_PIN (and not turn them into writes for anything but the > > > COW code). So basically redo the "enforced COW mechanism", but rather > > > than do it for everything, now do it only for FOLL_PIN, and only in > > > that COW path. > > > > > > Peter - any chance you can look at this? I'm still looking at the page > > > lock fairness performance regression, although I now think I have a > > > test patch for Phoronix to test out. > > > > Sure, I'll try to prepare something like that and share it shortly. > > Jason, would you please try the attached patch to see whether it unbreaks the > rdma test? Thanks! Hi Peter, My tester says the patch does not help (modified as Leon pointed to make it compile). He did another test where all forks were removed and the test program succeeds. Overall in our test suites we see failurs on tests that involve fork and success on tests that don't. So fork and COW seem very likely to be the issue. Thanks, Jason