Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3470447pxk; Mon, 21 Sep 2020 14:46:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJygqny77oZtBUaCO287umMAR5R/DtiL1bHvrdUYULDG4QlDkl3R81B0gcIJaL8qGDf2UVpK X-Received: by 2002:a17:906:390d:: with SMTP id f13mr1596391eje.86.1600724813471; Mon, 21 Sep 2020 14:46:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600724813; cv=none; d=google.com; s=arc-20160816; b=R3ZfYv9yLX/VnOF93nBsf8vT9ty5MB9VbTgUhgO6d6ZKYfQx9HjaMRzE0IBaxhnpb2 l9FLBY1ZSOow6x3SCNZUi0O7JPdROCWMx7HLFOtSnTTNXfgEaLDuHJo98aS0lrUi6sMb DcGK2SAvCT150wjvyMXNCow+kQrod+Mvl8wqqEb9WMIulAVi4rCXbaDtukpZje7Rgw3/ Jx+Af/yWC29zw07YM+enSmVo4GZmaj3KDH0iR90i9J+8y78VT4+9NkB307QAnHjM58MQ pc4JZJ2lp4obPZXnaNZlT+UbD+816au3fMM2NAqU2qGmuSp2mS1tYg6prftEQ3Al8SIb 0PdQ== 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=FBnY2mGkBlFH+IxSO6esO9hEh+IRERtFDhquE+Lbxw8=; b=JBS5elYZrsN28BKO69TfJLH0jrBHvy471JPbawHSDVrqOFWv/RS7DSPYXtak5inrnR 9pQW/icwtlWoxzdf+XQjEszpM0cPwjjbeIlfM4BrLVQGf/edXGqury4arpW7yEgiV7dq NTGh4Jz9hHY404clLd7PC1jULRb2xwlcFjZroZTQTRPeBiS5XxMwXUf9yvywRIe7vRP+ uCG1KqL/bDYCehY/A+HW177Kvilvm7qx2N9hR+AjTw5qssp5bK97QOcEE42PcF2ZHRa1 dGa/n+zd9ioxCcTt4zurhsNDYlMQekb36j/Qi0UFxlQ7lambp0yJr0KNCKJfI/XPVZYk JiiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=vPSZJ0cc; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h23si9614866ejx.721.2020.09.21.14.46.28; Mon, 21 Sep 2020 14:46:53 -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=@google.com header.s=20161025 header.b=vPSZJ0cc; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727639AbgIUVoG (ORCPT + 99 others); Mon, 21 Sep 2020 17:44:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52134 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726452AbgIUVoG (ORCPT ); Mon, 21 Sep 2020 17:44:06 -0400 Received: from mail-ed1-x543.google.com (mail-ed1-x543.google.com [IPv6:2a00:1450:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 43D0DC061755 for ; Mon, 21 Sep 2020 14:44:06 -0700 (PDT) Received: by mail-ed1-x543.google.com with SMTP id b12so14213430edz.11 for ; Mon, 21 Sep 2020 14:44:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=FBnY2mGkBlFH+IxSO6esO9hEh+IRERtFDhquE+Lbxw8=; b=vPSZJ0ccTDOAJwum3dIpeLxmBLFcJRM0RqCZ00ufRLomhDw+Vtg9oI0Xoar2bgt3Ux bANb5fhL5Ie/XU28/thsoHsuqRgJzsca1V5wUgJIwv87vBCY+Y54xz9RTWlbmuFJ7oRg J69OMrOGkrQQug7qucKP5bn8CKJIL9w9FbxAlIgGLo2Q6LvAe2uOw4X8yhP4PDCxKX0S vfyiV1RXGowiCESCRKjLOMuFoV9++v06DhBuFyCew4/NUvtlViOtdlv+mTiA6wlTOsrF NQSJ6PnOTMSemSyKzTMal+DDffP+Y9pXfwEmBUsjDbM/1S1LLFFmFkvFZTm02uED9u5A M5kw== 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=FBnY2mGkBlFH+IxSO6esO9hEh+IRERtFDhquE+Lbxw8=; b=BSbBfs36pORLLjjrU/sYyTWn+T8GemYi3JAMfc7rn+j9yaV0TZ7sxIeXak5wxUV59y o+khJxK1CPeE0zDLtej4a+uuoEFEPXY7R6O6TsjQdeB4TtmlMcOb7vT0GNVHt+FNUcXk Hfs6ns9CVzObUiUKLIbx0tnmshIFp8RdKHV6fnIHvN4U8YR+upcY0e5IH/2Zdpco8Xp7 H1hlyn1xN+VyRlIfP5KEeu+dBBcHlsvtjxvlQ7Bt5YO88w3+Wseeuq90MEB2zm4AO5D+ FogglnIwFxunwZ9gmwo7hMkBfzhg0pYg/CW+/8a8Q2XOIXCJUlO33liSaV8ru4DlQhZa yHVw== X-Gm-Message-State: AOAM531pZdrW3kyHqPCHtIN6CY5v7PdKOqzrL97N7oA8BX+Euv/ZMkFy LC3pEt7oICKB0kLLg8fX/FYQpYWvPENBpI3Ms+fTk/HtBTM= X-Received: by 2002:a05:6402:176c:: with SMTP id da12mr978510edb.386.1600724644777; Mon, 21 Sep 2020 14:44:04 -0700 (PDT) MIME-Version: 1.0 References: <20200921211744.24758-1-peterx@redhat.com> <20200921211744.24758-2-peterx@redhat.com> In-Reply-To: <20200921211744.24758-2-peterx@redhat.com> From: Jann Horn Date: Mon, 21 Sep 2020 23:43:38 +0200 Message-ID: Subject: Re: [PATCH 1/5] mm: Introduce mm_struct.has_pinned To: Peter Xu Cc: Linux-MM , kernel list , Jason Gunthorpe , Andrew Morton , Jan Kara , Michal Hocko , Kirill Tkhai , Kirill Shutemov , Hugh Dickins , Christoph Hellwig , Andrea Arcangeli , John Hubbard , Oleg Nesterov , Leon Romanovsky , Linus Torvalds Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 21, 2020 at 11:17 PM Peter Xu wrote: > > (Commit message collected from Jason Gunthorpe) > > Reduce the chance of false positive from page_maybe_dma_pinned() by keeping > track if the mm_struct has ever been used with pin_user_pages(). mm_structs > that have never been passed to pin_user_pages() cannot have a positive > page_maybe_dma_pinned() by definition. There are some caveats here, right? E.g. this isn't necessarily true for pagecache pages, I think?