Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2338503pxk; Mon, 14 Sep 2020 10:36:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzKJOmcj/q1Zmh3ZRhgQ+HGpS4dzxBtPWp8XDe8Sv596dVXvFIJ+rPOjgFBJXk36q5mwbcj X-Received: by 2002:a05:6402:3192:: with SMTP id di18mr18470205edb.116.1600104961725; Mon, 14 Sep 2020 10:36:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600104961; cv=none; d=google.com; s=arc-20160816; b=Z1YQFxPrq1rF/IE+tQ7w5TZNpmPLqWthy+l6qSGnE6A9ubJP3TfNUFhineHpHyGz3u UJQr90iPWZc2CaTeb1YGhI8ddoasUE+uIb9/By8zj3YYBszOp1Kx7yNcgc4TMGLlJaX/ 9Ud8bBoABCEsWJb1uuiboVEJeZ7b6BjUpowS95H58yFeAiTcUmgdUwoVue0kencib8TN JTVq6ZT1rYKgH58TQhLOMsFVUDY/OB1EVFxydnVfN+TxBJUfW7s0t0ITLPuHA0xy9PPs BPhVxaBiaaMiDMTss8gFPoN4wuEeOPKck2O1ZrnH0saFgJkbPghYb3rVMzrKklmLNUPv FHZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=3xtDFEIrvwA/6L1bjyoorbZAuxfj/GqXppLxNbWixgs=; b=GWNbgZciRWiUSZA5e/31KXJYDDUyJcXGIWlpW/x/GA3OWDsrZkflA3RpPbPrPVs9qy CTfkQuA6hOw93Ar8kuDHtL/MYUj/gL/8VdRtiMCz37CwNcsQUE8JBz8yi445HJLA33Zu Xkv96oXBhT0Ai962hTvx5WNPvM2Mc4gAlLqvdnNpbkeHCDj12KgecsaeKI7c8pQI9zCb mplR9IF6fClTatZC2cTrFNwkP+3ErHgQdBeydhKTMQhUtwIC6WK5T3XxIW8xHi3XZvg3 TBKDPFf+11vluX07xu7h19PAzCh/J4/QDkapp8Q5ApmREO/x3sdw7Ky+N5tFbuc58zFM MJAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=U9lHjJaT; 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 z2si7288635ejj.455.2020.09.14.10.35.39; Mon, 14 Sep 2020 10:36:01 -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=@linux-foundation.org header.s=google header.b=U9lHjJaT; 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 S1726361AbgINRc7 (ORCPT + 99 others); Mon, 14 Sep 2020 13:32:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38176 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726106AbgINRcc (ORCPT ); Mon, 14 Sep 2020 13:32:32 -0400 Received: from mail-lf1-x142.google.com (mail-lf1-x142.google.com [IPv6:2a00:1450:4864:20::142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA0A2C06174A for ; Mon, 14 Sep 2020 10:32:31 -0700 (PDT) Received: by mail-lf1-x142.google.com with SMTP id m5so137770lfp.7 for ; Mon, 14 Sep 2020 10:32:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=3xtDFEIrvwA/6L1bjyoorbZAuxfj/GqXppLxNbWixgs=; b=U9lHjJaTQ2ejYDJEjf9MUl/d/ihUqXM/TqkzXUb4AZOxhoEk7TVNn0COhc84RxSaLV 3+pcJlf0crqOlq4vrcIb8dqZd4MQ0SeI25NKoH0hAKjXq1cgkB4ZXEqDD1m0tRBT8ip6 SQGeknRq4aJyT20tR2LNEMQ0JT7ImcwsFJHlo= 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=3xtDFEIrvwA/6L1bjyoorbZAuxfj/GqXppLxNbWixgs=; b=IQeZ1AZ1Nz9D2OYxVuEbyJf/2+Ekx+CTFV0KKgr7aGUUSUhJiJenXuKHghd2239WWI jWAx2A9o/9wkVGZSnrzVuV6bm9UmH2tyJMETU35SGl9Fl7AQicnwzrLPRah+4ho2OgXy 5ky93TwW+6mq+OfpmSA7YUwdjmvTvLoyU4rO2nhzJfFehE+RkxbGm2QYNjLSuRD8aDwm 4gVwqMEOGVGVG60ZQgcjdZyb+gDI28mHW+mVaT6a/RfQw5N5klepnVmDxrN9wRE+EfeO oN+XV1YXZpxoIATMuiJ23+KKzV+nGLx5jVa8HaWiKTiOiOQ7xpqs4L1HY8hSrFiW8Kw1 zv8Q== X-Gm-Message-State: AOAM530ebH+zWzex2mOkpJl6kNHWFSfggCwT31pIyq9aSrifGEXIqkF6 ceaTaCjlqQKdxlVi8GpQhPv1LJval0LS+g== X-Received: by 2002:a19:cb52:: with SMTP id b79mr2123687lfg.592.1600104749956; Mon, 14 Sep 2020 10:32:29 -0700 (PDT) Received: from mail-lj1-f173.google.com (mail-lj1-f173.google.com. [209.85.208.173]) by smtp.gmail.com with ESMTPSA id x2sm4147266lji.9.2020.09.14.10.32.28 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 14 Sep 2020 10:32:28 -0700 (PDT) Received: by mail-lj1-f173.google.com with SMTP id k25so425544ljk.0 for ; Mon, 14 Sep 2020 10:32:28 -0700 (PDT) X-Received: by 2002:a05:651c:32e:: with SMTP id b14mr4983630ljp.314.1600104747758; Mon, 14 Sep 2020 10:32:27 -0700 (PDT) MIME-Version: 1.0 References: <20200821234958.7896-1-peterx@redhat.com> <20200821234958.7896-2-peterx@redhat.com> <20200914143829.GA1424636@nvidia.com> In-Reply-To: <20200914143829.GA1424636@nvidia.com> From: Linus Torvalds Date: Mon, 14 Sep 2020 10:32:11 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 1/4] mm: Trial do_wp_page() simplification To: Jason Gunthorpe Cc: Peter Xu , 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 Content-Type: text/plain; charset="UTF-8" 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 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. Linus