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=-3.9 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 2B545C4727E for ; Mon, 28 Sep 2020 16:17:33 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 81F6D2083B for ; Mon, 28 Sep 2020 16:17:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="euu6Fg5d" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 81F6D2083B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 78FEF6B005C; Mon, 28 Sep 2020 12:17:31 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 73E5E6B005D; Mon, 28 Sep 2020 12:17:31 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 62DA96B0062; Mon, 28 Sep 2020 12:17:31 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0107.hostedemail.com [216.40.44.107]) by kanga.kvack.org (Postfix) with ESMTP id 474BB6B005C for ; Mon, 28 Sep 2020 12:17:31 -0400 (EDT) Received: from smtpin20.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 00551181AE868 for ; Mon, 28 Sep 2020 16:17:30 +0000 (UTC) X-FDA: 77312975502.20.fuel23_620eb2927182 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin20.hostedemail.com (Postfix) with ESMTP id CD1F4180C07AB for ; Mon, 28 Sep 2020 16:17:30 +0000 (UTC) X-HE-Tag: fuel23_620eb2927182 X-Filterd-Recvd-Size: 4656 Received: from mail-lj1-f195.google.com (mail-lj1-f195.google.com [209.85.208.195]) by imf48.hostedemail.com (Postfix) with ESMTP for ; Mon, 28 Sep 2020 16:17:30 +0000 (UTC) Received: by mail-lj1-f195.google.com with SMTP id a15so1528853ljk.2 for ; Mon, 28 Sep 2020 09:17:29 -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=e5eBmJYMQxsPiYEHTP+N8WE8e6PJy08LxGgxCCqvCfE=; b=euu6Fg5dxp3F/Hmc0ddCIZLWIH1whfjy65nYv8nVV1rquMCIwXYMajlID9wTtFxHK8 Cbo31Xb/E1jD+y+fwC/r6bEh2Pcqn3AUPrCoY7pk9cqeYknrMe9RPns+LXDkxVQyg9vE 0YpqeOnguRpHbqeC+u2A5oifieeXZWi4iQqs0= 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=e5eBmJYMQxsPiYEHTP+N8WE8e6PJy08LxGgxCCqvCfE=; b=rmoBDlWOIG8G8KE+E0edB135CBRu4XoK4Fgvc0s+YYckhUDDEqSYWAWbRcdGRPop1a HkvrmzGH/cWstGe99vb3dmY5ETOk/Eei1IHKpX9yWOMi7rUcOqNnPIOItN0f1lmJEEqx N7VgjA9blPxYbBejHTDjU085E84czVGKCvRF77nt3RqrqR0gMA+P5cFY08GsvPzvEZi3 UNgM34ScqKhDcSLL3qQeGhP07waSszzddye6VTEhWMiQ0YgmqoepR88D9ZyM5hy5x2o8 EA1qk2Uovi695elxv8k2NHgulFEIMe7vSmLKwlzJRE7zUPZTmSNbxd/KUvGQXIMb6FNZ e9hQ== X-Gm-Message-State: AOAM533lZiOOhOjPMN4UW/ETWxKVebNsqcuiyQm/G8/qJKvjIMgdiOTp JsoJnYdsBUzqQHFHZ4NWd153MN1u0YSO4Q== X-Google-Smtp-Source: ABdhPJzyrSj0Jehz35SWCBo5xSgedrHON3b9YXdWtVnnVUUsGjX/+c15TdSs9/5C0D5DZAx6+zknlQ== X-Received: by 2002:a2e:81d7:: with SMTP id s23mr710307ljg.69.1601309848210; Mon, 28 Sep 2020 09:17:28 -0700 (PDT) Received: from mail-lf1-f47.google.com (mail-lf1-f47.google.com. [209.85.167.47]) by smtp.gmail.com with ESMTPSA id a17sm2887424lfd.148.2020.09.28.09.17.26 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 28 Sep 2020 09:17:26 -0700 (PDT) Received: by mail-lf1-f47.google.com with SMTP id b12so1949045lfp.9 for ; Mon, 28 Sep 2020 09:17:26 -0700 (PDT) X-Received: by 2002:a19:4186:: with SMTP id o128mr687690lfa.148.1601309846019; Mon, 28 Sep 2020 09:17:26 -0700 (PDT) MIME-Version: 1.0 References: <20200924183953.GG9916@ziepe.ca> <20200924213010.GL79898@xz-x1> <20200926004136.GJ9916@ziepe.ca> <20200927062337.GE2280698@unreal> <20200928124937.GN9916@ziepe.ca> In-Reply-To: <20200928124937.GN9916@ziepe.ca> From: Linus Torvalds Date: Mon, 28 Sep 2020 09:17:09 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 1/5] mm: Introduce mm_struct.has_pinned To: Jason Gunthorpe Cc: Leon Romanovsky , Peter Xu , John Hubbard , Linux-MM , Linux Kernel Mailing List , Andrew Morton , Jan Kara , Michal Hocko , Kirill Tkhai , Kirill Shutemov , Hugh Dickins , Christoph Hellwig , Andrea Arcangeli , Oleg Nesterov , Jann Horn Content-Type: text/plain; charset="UTF-8" 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 Mon, Sep 28, 2020 at 5:49 AM Jason Gunthorpe wrote: > > Not seeing an obvious option besides adding a smp_mb() before > page_maybe_dma_pinned() as Peter once suggested. That is going to be prohibitively expensive - needing it for each pte whether it's pinned or not. I really think the better option is a "don't do that then". This has _never_ worked before either except by pure luck. I also doubt anybody does it. forking with threads is a bad idea to begin with. Doing so while pinning pages even more so. Linus