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=-6.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 BCC74C43464 for ; Thu, 17 Sep 2020 21:41:07 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 2A78D2083B for ; Thu, 17 Sep 2020 21:41:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="eLizkE+L" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2A78D2083B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 873006B0003; Thu, 17 Sep 2020 17:41:06 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7FB106B0055; Thu, 17 Sep 2020 17:41:06 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 69C026B005A; Thu, 17 Sep 2020 17:41:06 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0222.hostedemail.com [216.40.44.222]) by kanga.kvack.org (Postfix) with ESMTP id 4F98A6B0003 for ; Thu, 17 Sep 2020 17:41:06 -0400 (EDT) Received: from smtpin05.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 072BB8249980 for ; Thu, 17 Sep 2020 21:41:06 +0000 (UTC) X-FDA: 77273874132.05.soda49_370985427125 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin05.hostedemail.com (Postfix) with ESMTP id E197818020305 for ; Thu, 17 Sep 2020 21:41:05 +0000 (UTC) X-HE-Tag: soda49_370985427125 X-Filterd-Recvd-Size: 5025 Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by imf03.hostedemail.com (Postfix) with ESMTP for ; Thu, 17 Sep 2020 21:41:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600378864; 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=hQ1n2NAsz3VF5VdxDZBasnfNcenN2+9JB5WfZ+Z/fJA=; b=eLizkE+Ln3vDJ0rWGTGL2gsLT5pahnRW4oc8UJTFEOAsbdeoC2LWRWxFCzPL6xFw8aVROZ LEAac81dk0VFrtSKllWZLJ9K1/vrSIi08kuU87mY7BoaImdGAMawX2pKnps7Ypz54ycXkd zNm4Y6zWHc8X0LavtoQ0yjMSvxBUQg0= 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-522-F8AYSsWRMYSXCVSs9JfsgA-1; Thu, 17 Sep 2020 17:41:03 -0400 X-MC-Unique: F8AYSsWRMYSXCVSs9JfsgA-1 Received: by mail-qt1-f199.google.com with SMTP id g1so2995197qtc.22 for ; Thu, 17 Sep 2020 14:41:03 -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=hQ1n2NAsz3VF5VdxDZBasnfNcenN2+9JB5WfZ+Z/fJA=; b=ZlubArmuEzZsstSM6AF3KtmXkv+B/W5LIMZ3gOhJloqrrjdkSYNuXBU+GVLC+pIJaN Qm2haVn5VD6x7/kTlQU0a6chSLl0/k+TEOCQtJucqkcONAOoLDtr5L+OWCqzCMhepiem Xm6G1q/78pxQF7rEpBVA/GwIytOJUqZ9H4aJ4FAprNzBSvSw8RbQycMZqtgEMMzv8s24 2zajbvQvv1eljTmDQC1HdreS5RQx7oh57NhTahSlpS4TUyHI/SUehEXCfBmu6kmOooTL dxVScc545eFyEs5EKoq285qqvb/LsL/HpcaY/fnDt8gSi18G6rt5zVLK7GkEeQjbObR6 6eNw== X-Gm-Message-State: AOAM532pZhOJEgYrLn1+61DBQXt2dK4F1WHOEuoLrtXHkUvSq4JDz/IZ USvXEhTpi1sPQ5ypGuGLG4lvPFV5HYZbo9prUoDdO4AcX4k5L5Jvvrtu51IvHFgK659V2dKDa12 iumja1jwSuFc= X-Received: by 2002:ac8:2934:: with SMTP id y49mr16991435qty.202.1600378862615; Thu, 17 Sep 2020 14:41:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzsMO7lJNEG6rp/cRDai03s8C8GWzPhRnPgWZqUSSBWMOqA8cQnSYxe/cCO2Iqx4US8S+xJCw== X-Received: by 2002:ac8:2934:: with SMTP id y49mr16991404qty.202.1600378862360; Thu, 17 Sep 2020 14:41:02 -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 x197sm791645qkb.17.2020.09.17.14.41.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Sep 2020 14:41:01 -0700 (PDT) Date: Thu, 17 Sep 2020 17:40:59 -0400 From: Peter Xu To: Linus Torvalds Cc: Jason Gunthorpe , John Hubbard , 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 Subject: Re: [PATCH 1/4] mm: Trial do_wp_page() simplification Message-ID: <20200917214059.GA162800@xz-x1> References: <20200916174804.GC8409@ziepe.ca> <20200916184619.GB40154@xz-x1> <20200917112538.GD8409@ziepe.ca> <20200917181411.GA133226@xz-x1> <20200917190332.GB133226@xz-x1> <20200917200638.GM8409@ziepe.ca> MIME-Version: 1.0 In-Reply-To: Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=peterx@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline 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 Thu, Sep 17, 2020 at 01:35:56PM -0700, Linus Torvalds wrote: > For that to happen, we'd need to have the vma flag so that we wouldn't > have any worry about non-pinners, but as you suggested, I think even > just a mm-wide counter - or flag - to deal with the fast-bup case is > likely perfectly sufficient. Would mm_struct.pinned_vm suffice? Though now I'm not 100% certain whether all pin_user_pages*() callers are accounting correctly upon pinned_vm. My gut feeling is that bc3e53f682d93df67 does not convert all the old locked_vm users with page pinnings (e.g., mm_iommu_do_alloc, vaddr_get_pfn, etc.; didn't try harder). -- Peter Xu