Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp916538pxf; Wed, 7 Apr 2021 15:00:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy6djwx26B4yaxLwNdiVkN1UcPf/e4lvURzIIeWdogfOIhPWI6EqPQBcLbczNuYicQVNw9+ X-Received: by 2002:a17:90a:1642:: with SMTP id x2mr5595449pje.88.1617832855850; Wed, 07 Apr 2021 15:00:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617832855; cv=none; d=google.com; s=arc-20160816; b=nXHswRAKc+aGU0ysqc0g0mvQB/XpFqDvHZV4XSDe0BPbbJSrLqFScTDEHqQvk5qDx4 0qrLeKlz/CL9JgEFT5/IrqqcZ4DyBVBVvVilVAJCjZJ0+5nWOH0aOB3DIgMWyrDJllxc Oz1nFegPgmWpSMnaPT6y687IYc447PZ/DIgWLB1kRIgCfNbHnzGzHrI4gASSOA7wPmgu ShPwD8vjBjy+re/cIEqxaPLi/s2iRVBzexdEpqinctnL16PKhC7IefnODpHikbFEbiPV kU0ttjALdtoB4XzR1jV94ogV+qq11bnvuTXeRnQsmib9ju5keeoNWvrqILZr6wPhtS9v wsxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature:dkim-signature; bh=BMiaa8iBHRjb1Y23X3q4l5RYCgQNoBRvKGEa2NM3GUA=; b=n8+7Q6t5ZTZ6VYb6CRZgIkP45oxW7MGkQ+zV7UhkliP774EkzRIvFljFHUqRGftRIC R59RYDVQQe4X+pDd4Kb9Oad2FoFQclcoxtNlLECNfuKRKbWf8Vi3lQ1Ka0E1g104IpfX o+E1jVkocg46flkkchKeLNpcYrTOFfeNfEi+jmi/M3mu1pWtHxYc/7ganWtEnViHy+qK +1JmYt7/vY6xuYegwxe4FqFIBb8MhLD3BwFW+s/4SGXT2H/kUz1J0DnZaTgt30ftxgVu 7U2rXYjsoWLRs7ULVCIryJifrehap4wxJW9eWrLujFZX9SNj3GARJiI1OEBc1mFl4yr8 tygQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (no key) header.i=@lespinasse.org header.s=srv-11-ed header.b=pUzorbQl; dkim=pass (test mode) header.i=@lespinasse.org header.s=srv-11-rsa header.b=YRKshN74; 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=lespinasse.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 34si13252867plf.51.2021.04.07.15.00.43; Wed, 07 Apr 2021 15:00:55 -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=neutral (no key) header.i=@lespinasse.org header.s=srv-11-ed header.b=pUzorbQl; dkim=pass (test mode) header.i=@lespinasse.org header.s=srv-11-rsa header.b=YRKshN74; 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=lespinasse.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346203AbhDGUSe (ORCPT + 99 others); Wed, 7 Apr 2021 16:18:34 -0400 Received: from server.lespinasse.org ([63.205.204.226]:39091 "EHLO server.lespinasse.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244142AbhDGUSd (ORCPT ); Wed, 7 Apr 2021 16:18:33 -0400 DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=lespinasse.org; i=@lespinasse.org; q=dns/txt; s=srv-11-ed; t=1617826703; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to : from; bh=BMiaa8iBHRjb1Y23X3q4l5RYCgQNoBRvKGEa2NM3GUA=; b=pUzorbQlmiOvh+76D2Eb3d9ga2sF6fjQBpr+oyMkL8VIaUWhbEbdZ5YtUubU7Ai3UpRxZ kvfrFmrH6fmPzPvCw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lespinasse.org; i=@lespinasse.org; q=dns/txt; s=srv-11-rsa; t=1617826703; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to : from; bh=BMiaa8iBHRjb1Y23X3q4l5RYCgQNoBRvKGEa2NM3GUA=; b=YRKshN74su2o+lCWMmNX0OPJ4i3iGAoKI5u5Rbc9WHo+0J2etYamQM4Zy+nIJvdycFTTU s3cTlcAB/ugm3Q++zVVLTAFbCuUhfpDxyD5FlcsWE844/9w2fN5QLbsbyUNnkcR6pFsVK7l PR+1cgq28IUDUWbJwcHgQEreqISrMQbJqzFBovNjXMLd+QecwYHtbft0Ssj9xjDe73vxQ7p VGgCmQ/rIE63n8rvTlil+M1UFcTw8jAuXVPoCVxThgMgWwBIWLW6YGoQtqObCIj2tSoDNQ8 Wvw4H0myAgZ7h23wlHH6bF5M1Zy6XIKF0cgvKOVVI1H1s8twM44EoUVuYHNQ== Received: by server.lespinasse.org (Postfix, from userid 1000) id C4F72160244; Wed, 7 Apr 2021 13:18:23 -0700 (PDT) Date: Wed, 7 Apr 2021 13:18:23 -0700 From: Michel Lespinasse To: Michel Lespinasse Cc: Peter Zijlstra , Linux-MM , Laurent Dufour , Michal Hocko , Matthew Wilcox , Rik van Riel , Paul McKenney , Andrew Morton , Suren Baghdasaryan , Joel Fernandes , Rom Lemarchand , Linux-Kernel Subject: Re: [RFC PATCH 11/37] x86/mm: attempt speculative mm faults first Message-ID: <20210407201823.GB25738@lespinasse.org> References: <20210407014502.24091-1-michel@lespinasse.org> <20210407014502.24091-12-michel@lespinasse.org> <20210407201453.GA25738@lespinasse.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210407201453.GA25738@lespinasse.org> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 07, 2021 at 01:14:53PM -0700, Michel Lespinasse wrote: > On Wed, Apr 07, 2021 at 04:48:44PM +0200, Peter Zijlstra wrote: > > On Tue, Apr 06, 2021 at 06:44:36PM -0700, Michel Lespinasse wrote: > > > --- a/arch/x86/mm/fault.c > > > +++ b/arch/x86/mm/fault.c > > > @@ -1219,6 +1219,8 @@ void do_user_addr_fault(struct pt_regs *regs, > > > struct mm_struct *mm; > > > vm_fault_t fault; > > > unsigned int flags = FAULT_FLAG_DEFAULT; > > > + struct vm_area_struct pvma; > > > > That's 200 bytes on-stack... I suppose that's just about acceptible, but > > perhaps we need a comment in struct vm_area_struct to make people aware > > this things lives on-stack and size really is an issue now. > > Right, I agree that having the vma copy on-stack is not ideal. > > I think what really should be done, is to copy just the attributes of > the vma that will be needed during the page fault. Things like vm_mm, > vm_page_prot, vm_flags, vm_ops, vm_pgoff, vm_file, vm_private_data, > vm_policy. We definitely do not need rbtree and rmap fields such as > vm_prev, vm_next, vm_rb, rb_subtree_gap, shared, anon_vma_chain etc... > > The reason I did things this way, is because changing the entire fault > handler to use attributes stored in struct vm_fault, rather than in > the original vma, would be quite intrusive. I think it would be a > reasonable step to consider once there is agreement on the rest of the > speculative fault patch set, but it's practical doing it before then. I meant it's NOT practical using attributes rather than a vma copy until there is sufficient agreement to merge the patchset.