Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3530487pxk; Mon, 21 Sep 2020 16:50:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwiA6CClukgOxn9AmyqaFWyGfv/AusuC6eLs6KXxyzN9dKEzHyWVI2wAGU9OKNfVPspBgPB X-Received: by 2002:a50:f418:: with SMTP id r24mr1316764edm.295.1600732231067; Mon, 21 Sep 2020 16:50:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600732231; cv=none; d=google.com; s=arc-20160816; b=eO9V1fabPXBQsH/qRjzU5cK0r/DhYX+cRMete6V281DkbgJm3dy59X70diReN4+2Ps 4wucNbOcznRN+rvn3ZeYo7FxPimwLJKlsu+/uepistA9SbIdOacCS9H/toxX2Ag0W1mT GLSTE9/LIr3K65mkp7lzMDXIc1HQc/FzyCxVcfrgcKQ/Fh3kt/Hj0X3UKmota4c89fil MKQj2/ixYqWTYkyYIgoB2DnOpjENlRtxYnnsGGMoodVt8rBg1MhQzDGqCqE2X5kdaB3d lQnAX3RQQcQy/Wvnc6e/3z4/bBoFf+rUFVNHRY2AMGMKC8TzGlBcfTzYbmuAEeOyFEKv Hzew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=KSApC7Na2CgdhhBi62TssFqLybrjuoTgagPGcr/kNG4=; b=KJeNJcJq7kafjzamA2iB+UxJ8EwcYh5ycbu62McKcHYAYdlfPlZYWx0Jp+c2DwFDkI mKk/1leMRI1+RuLUvLM+WAwCX6XdV+k54mgBPZNN2Powj9foVRfj5esydEmgrHt3AdER ZPi95LugdtTmHIvvt8+uX4SXPEjjHF97UIHZeQMSgq6hNKAfRTUdkFRiwQY1lGln8zIQ oUELJ8ErB67AYpbVWg7xoQoous7dZDT/pDsKEF5mSymysFMOuoTQjHkx7GhcNijrtM5z WbS3GBJJryZ+4AsIlLVdkDmZQkbz6+DYp+hJ+3Py5xKT1B4KtkKPoyVEjElvfQqzzAeo GSfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="Le/enJnc"; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i7si12098162ejo.706.2020.09.21.16.50.08; Mon, 21 Sep 2020 16:50:31 -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=@redhat.com header.s=mimecast20190719 header.b="Le/enJnc"; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728532AbgIUWaL (ORCPT + 99 others); Mon, 21 Sep 2020 18:30:11 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:36216 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726467AbgIUWaK (ORCPT ); Mon, 21 Sep 2020 18:30:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600727409; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=KSApC7Na2CgdhhBi62TssFqLybrjuoTgagPGcr/kNG4=; b=Le/enJncr4ewaFF11MXFJdqayyrQBL/vpmuxUY8KTuKUEnvIhN+Rys7C4+4bpkVIjk4nxX BKwi33DIMWVQpyGBAVD8RDiaBrX/Mhvz/okMH148/NGT/TAvXp/j5RPEiCVKfGwbIdZSMZ iyvAxUSlpCVshaZp44f1VP+GAylflJ0= Received: from mail-qt1-f199.google.com (mail-qt1-f199.google.com [209.85.160.199]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-13-Ylkwg5dbP5W25us6ZSsKtg-1; Mon, 21 Sep 2020 18:30:07 -0400 X-MC-Unique: Ylkwg5dbP5W25us6ZSsKtg-1 Received: by mail-qt1-f199.google.com with SMTP id o13so14240965qtl.6 for ; Mon, 21 Sep 2020 15:30:07 -0700 (PDT) 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=KSApC7Na2CgdhhBi62TssFqLybrjuoTgagPGcr/kNG4=; b=lJp9WaU3WmPB/9dNaaLAComuo+XHBbBEcZnJ/CJ2CR8iZyytn3XGeE4jLVpNtJUI6I jSR2IfkyXwBjxpzx7BxInxJNzQ83e5t+QkP0TnOOkp7aPdW8Xh06lBRyW0CL6gqWHtSt vrkv4u6dbfK1Sd2OksGXBneenpVKoUwR1rkHFBmueeJVaU8XKYF0pt96s5HVl/JxiNZ+ 7ySORJ8au64fYVQm12WEcQCRT39zJ6d453rmccfB6INP1L8PInfg1nlyym3sXoVmWSs9 ICgpdKjuPQeleEMBiWOxmrl57IznyHe3FX+XufJ9iPcM/vBalvA5O63Bogdv3HjqngiO 9Nhg== X-Gm-Message-State: AOAM531NPg04w/g3h8X4WT4jdKASg0nAlqMHX4sIWBJrdzvkou/RF+gi jXTyIjBwgydQnyxQ3GaUjFrkXbFUv01GzmpijxOM4b+9Xox7DwzY+GqOxDNtYsu2jo1uYR+iqvL QCUnqlAYY6UzUsG0gRWiDVyHq X-Received: by 2002:ad4:58e3:: with SMTP id di3mr2546930qvb.54.1600727407405; Mon, 21 Sep 2020 15:30:07 -0700 (PDT) X-Received: by 2002:ad4:58e3:: with SMTP id di3mr2546913qvb.54.1600727407197; Mon, 21 Sep 2020 15:30:07 -0700 (PDT) Received: from xz-x1 (bras-vprn-toroon474qw-lp130-11-70-53-122-15.dsl.bell.ca. [70.53.122.15]) by smtp.gmail.com with ESMTPSA id o4sm10218609qkk.75.2020.09.21.15.30.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Sep 2020 15:30:06 -0700 (PDT) Date: Mon, 21 Sep 2020 18:30:04 -0400 From: Peter Xu To: Jann Horn 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 Subject: Re: [PATCH 1/5] mm: Introduce mm_struct.has_pinned Message-ID: <20200921223004.GB19098@xz-x1> References: <20200921211744.24758-1-peterx@redhat.com> <20200921211744.24758-2-peterx@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 21, 2020 at 11:43:38PM +0200, Jann Horn wrote: > 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? Sorry I didn't follow here. Could you help explain with some details? Thanks, -- Peter Xu