Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3143132pxk; Mon, 28 Sep 2020 09:21:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwU6EIJOn5U000V3ohKg7ixYApBkbhQBVBf4SMTfCfmtS/+HSBz9Br7bpsimN0P1YmsBViZ X-Received: by 2002:a17:906:9718:: with SMTP id k24mr2256058ejx.365.1601310070485; Mon, 28 Sep 2020 09:21:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601310070; cv=none; d=google.com; s=arc-20160816; b=cyyUB1gctQywVeKoR4YpQiFgBg59py670T+CXN8AqgZlvKX9Fcaz+LZAAW9Yq/bRJF kzjlLAJObdeEFqtAmtUUByxWXvMJ0R/5K6pvjkGbfMetYHcBTQ3xFTL1LVtrbueueJVa HjI6fm2WQJ6lkjsIcZ/nwZmkXasXGQ+nUdLgtN/yMsJjT1umCJS7G4QmtJr6hjbcTBEp u6sJS8cOPNM9bkF0H9sa2YXS0UTlYCr+KxJ7c3OVUmBHf2lF1iWvk4j48Lu8Yw5I6f6H mUgJclMaZWoPek6V9qB/Ys9Q3/IsbdGLSrHDGWS5WSD9PXLlQ8oki5h+p8caIUHlp201 rF7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=e5eBmJYMQxsPiYEHTP+N8WE8e6PJy08LxGgxCCqvCfE=; b=FCoxkPLxdQqd5atqEtJ5sQ1z9/MZ4XHmFXv8A2tNI0EjFfz4m1ub3MICod5TLGWbzP 6ySZAGPaMwZXkncAPEIHMDq2HQ0qjg8J3PAljMprq3pksLqqQuhcbbxK0nB3ZAXlqtrQ r1Ka9ebZtPclW17rpwDpX9maKJCYq6IBB5sBCfxpDMPw2YLQZ+YUGnhRTcyhsph40Pjr 7UYdzNL8YHLa3T+IlnvZ8xy2EEijQftFfoycQf6Gopa3AJXfWwBLh918Onc8YfGhFFPx 8cVcG8NGJFIyQXWl7rnsvp3h4RPUyxWg08WbuwijwH1Gv0Qhji449Y1vbtvbkx7YLQ8S RR3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=euu6Fg5d; 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 p15si931714eds.494.2020.09.28.09.20.45; Mon, 28 Sep 2020 09:21:10 -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=euu6Fg5d; 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 S1726485AbgI1QRa (ORCPT + 99 others); Mon, 28 Sep 2020 12:17:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56780 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726348AbgI1QRa (ORCPT ); Mon, 28 Sep 2020 12:17:30 -0400 Received: from mail-lf1-x144.google.com (mail-lf1-x144.google.com [IPv6:2a00:1450:4864:20::144]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0FAEDC061755 for ; Mon, 28 Sep 2020 09:17:30 -0700 (PDT) Received: by mail-lf1-x144.google.com with SMTP id 77so1999076lfj.0 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=ptQxol5I6L1hQpMYDfRd57aTlA+MRp6Sg9Cu9hnG/mdGRhrN8+gB+/iGQdzq3W33Ng eQIdiFpkGmVCjQUsXheeGmqGRJ6MfhnmHdYtbUJzR+4bQsnpRvrIrPOOWEGKUm9OlDzJ S6m94Z//PUKtfJksPfy29DyvncsSwjr4PR962vJ3yxpDXyCzYX0IMQV2/4ergr8Ab/QJ icQiHf5wpxO9D8iXNercv74w+UEcoV+UtMRYC4mETxWwMbBn9kKUVPj2xlcnEwfjLwls RddHnGD9xThFJFAhE+/z3UEf9a2Lkypb7T/ub0VvGlh/ERFXXjhKs9g86rpD/BY9HrXT 9G+A== X-Gm-Message-State: AOAM533IwyIv3tTuwCZ8S06w/HwtrVZztCRpzsBnv1DIsWZ1tULwKAEf 4DZlUbIDljAlyAbgIqsgETZG/WBR1U7IpQ== X-Received: by 2002:ac2:538c:: with SMTP id g12mr689581lfh.326.1601309848278; Mon, 28 Sep 2020 09:17:28 -0700 (PDT) Received: from mail-lf1-f43.google.com (mail-lf1-f43.google.com. [209.85.167.43]) by smtp.gmail.com with ESMTPSA id x12sm130607ljd.130.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-f43.google.com with SMTP id 77so1998924lfj.0 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" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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