Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1913738ybt; Thu, 2 Jul 2020 17:53:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx5ABj5CXxUljhPIfDhgdSsmqAelosFQ1YRuP8PWRQvGfVOdMDgJzJNgDx9Glv8dBgvj0uH X-Received: by 2002:a17:906:19c7:: with SMTP id h7mr29223397ejd.403.1593737614136; Thu, 02 Jul 2020 17:53:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593737614; cv=none; d=google.com; s=arc-20160816; b=RUHUCSKRHFE20Dpc8xl5v1IjJqZL1NLE1YSAfizhcsmboh+I2pGAPMj91dIMPCTOcy 6XLuWMM/0qfK99290ZY72hd08HjXw7zsS0ogYMdoonAnA9pWB919oXTlDtHA29BWJpsQ pawNPdIplqbVvQPso3dwzf3WwCo9phh5rTDijU2W6qrSCaih7MfYCBEkqQlNX28mOGbP juvpX8nhEOwYC+tgEPl61yd8mw2NsrX28NmzE3+cgH4a7PqmFPAm8OuhsI/BIdXH+m5b /Odu60EU/Ec3Gc+r83We6m8STU9fGTA9c+/mtkBUVtDU09Bjo/+Mrg8wHTb/dgyHwZ7k TM5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=CULJFp+mODjg6iHDkj5D4GeB51UD2IHVmmu+m4v/Di4=; b=aZmqeNM2z0+flO4VIF1m6UYbtNdNANBlNrlUA098wc5XDR8jymXbPRY3NEe1ExGMDb rplrjmK4vbFTMBkY0MlS1Br6P2i7TNnscj3rBQGsxxrHq6Gj6KgOhETaliMRpVfjY9K1 t6OW1fH2Iw0ycQKPsFrbtNTb1faKzTPl5fiYKH41n20k5hV97KbU+QK8XNf3NUme2XNH ND097VuXkUfWOAsQcac3cvwgd4zx2/lnxq/qXdX7wp4Godee9jPzSaUFV6a78/aWtOJ+ Fh1Tt67ksEopPaC/P5gN6lDvfqGFP6OBLJHCAl+rP3wFgepn8az2Z1GLYKZ5HRdJ5LJZ RKyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=fJtjmx5d; 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 d4si5757281ejb.349.2020.07.02.17.53.11; Thu, 02 Jul 2020 17:53:34 -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=fJtjmx5d; 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 S1726340AbgGCAxC (ORCPT + 99 others); Thu, 2 Jul 2020 20:53:02 -0400 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:32527 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726028AbgGCAxC (ORCPT ); Thu, 2 Jul 2020 20:53:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593737580; 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=CULJFp+mODjg6iHDkj5D4GeB51UD2IHVmmu+m4v/Di4=; b=fJtjmx5dYNHTJiFx0Tr26pgI15ciNshqFU8r5FwDsQ3RWufZN/QisnYOss7O5gBBQ+VABy cno6bxKAYZz9zyDO0CrWLtjrpY8S5crZGF/p7G3WHgmofIscDJ0w6qXelZt3+bK8evBK0j hMgQL0kWWty8jGFZTcED7vy/gqHTNFU= Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-60-CoHJ-_jGMyOBu-MUTq2h_Q-1; Thu, 02 Jul 2020 20:52:58 -0400 X-MC-Unique: CoHJ-_jGMyOBu-MUTq2h_Q-1 Received: by mail-qt1-f197.google.com with SMTP id o11so20575385qti.23 for ; Thu, 02 Jul 2020 17:52:58 -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=CULJFp+mODjg6iHDkj5D4GeB51UD2IHVmmu+m4v/Di4=; b=dbwSLG4gM4Y7szQl2+XIGuo7/1GT0433LiTuMPt2YAxZgj8DKv+Zb1OR/TfYMD3nQ5 bb+2NsmdZvL4miBCnaEy1grkhXOO+6cnYccs4SoKBRwtv7hbGiD34iIXENccS6VYXQV/ bSB8V3XNf4q7hxBmRUD2dp1IVbBqgz+lWPLVSLNY0c6dN2G+xbbkIoKJMrYkdc0tn9Re c5WeQ+P0EPJ/8cND9vodnBNyWoFNqQyXDPPyDhHmC0k+b9kbllx2jMfN3ntnI3bjRzbe bFu/jImbKskzZR9i+8AtBffSvORhIkVO4xjmQsXjtkjry3iSIUvyZRu0be/tcQPijwxv PzJQ== X-Gm-Message-State: AOAM530mJeJv0N2FQM5nWeEtVMrQYxczX2f+FWE8cndcXj+tayW3gYJQ TUbCjK5yTS6gR4SYg9z9ORdmtNLaAi4/8dAtsMcNwnIVF0KuWt4JXWQx2hxHiUtAH70zojh11d9 ggEFtjnJJ10VjyFDpOeCp0Cog X-Received: by 2002:a0c:fb47:: with SMTP id b7mr22636074qvq.129.1593737578213; Thu, 02 Jul 2020 17:52:58 -0700 (PDT) X-Received: by 2002:a0c:fb47:: with SMTP id b7mr22636058qvq.129.1593737577992; Thu, 02 Jul 2020 17:52:57 -0700 (PDT) Received: from xz-x1 ([2607:9880:19c0:32::2]) by smtp.gmail.com with ESMTPSA id j9sm9602885qtr.60.2020.07.02.17.52.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Jul 2020 17:52:57 -0700 (PDT) Date: Thu, 2 Jul 2020 20:52:55 -0400 From: Peter Xu To: John Hubbard Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrew Morton , Michael Ellerman , Gerald Schaefer , Andrea Arcangeli , Linus Torvalds , Will Deacon Subject: Re: [PATCH v4 26/26] mm/gup: Remove task_struct pointer for all gup code Message-ID: <20200703005255.GB6677@xz-x1> References: <20200630204609.39736-1-peterx@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 01, 2020 at 02:55:40PM -0700, John Hubbard wrote: > On 2020-06-30 13:46, Peter Xu wrote: > > After the cleanup of page fault accounting, gup does not need to pass > > task_struct around any more. Remove that parameter in the whole gup stack. > > > > Signed-off-by: Peter Xu > > --- > > arch/arc/kernel/process.c | 2 +- > > arch/s390/kvm/interrupt.c | 2 +- > > arch/s390/kvm/kvm-s390.c | 2 +- > > arch/s390/kvm/priv.c | 8 +- > > arch/s390/mm/gmap.c | 4 +- > > drivers/gpu/drm/i915/gem/i915_gem_userptr.c | 2 +- > > drivers/infiniband/core/umem_odp.c | 2 +- > > drivers/vfio/vfio_iommu_type1.c | 4 +- > > fs/exec.c | 2 +- > > include/linux/mm.h | 9 +- > > kernel/events/uprobes.c | 6 +- > > kernel/futex.c | 2 +- > > mm/gup.c | 92 +++++++++------------ > > mm/memory.c | 2 +- > > mm/process_vm_access.c | 2 +- > > security/tomoyo/domain.c | 2 +- > > virt/kvm/async_pf.c | 2 +- > > virt/kvm/kvm_main.c | 2 +- > > 18 files changed, 65 insertions(+), 82 deletions(-) > > > > Looks good: > > Reviewed-by: John Hubbard > > One minor refinement: in gup.c, if you add the following hunk on top of your > changes, that will eradicate the last reference to struct task, in that file: > > > diff --git a/mm/gup.c b/mm/gup.c > index 8ddc48022d74..75c4b305828b 100644 > --- a/mm/gup.c > +++ b/mm/gup.c > @@ -1902,10 +1902,9 @@ static long __get_user_pages_remote(struct mm_struct *mm, > * Or NULL if the caller does not require them. > * > * This is the same as get_user_pages_remote(), just with a > - * less-flexible calling convention where we assume that the task > - * and mm being operated on are the current task's and don't allow > - * passing of a locked parameter. We also obviously don't pass > - * FOLL_REMOTE in here. > + * less-flexible calling convention where we assume that the mm being operated > + * on belongs to the current task, and doesn't allow passing of a locked > + * parameter. We also obviously don't pass FOLL_REMOTE in here. > */ > long get_user_pages(unsigned long start, unsigned long nr_pages, > unsigned int gup_flags, struct page **pages, Right. Fixed it up, and with the r-b kept. Thanks! -- Peter Xu