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=-12.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham 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 86663C433ED for ; Wed, 7 Apr 2021 20:14:58 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A591F611C1 for ; Wed, 7 Apr 2021 20:14:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A591F611C1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=lespinasse.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id DAC0F6B0073; Wed, 7 Apr 2021 16:14:56 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D5B566B0078; Wed, 7 Apr 2021 16:14:56 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BD4E96B007D; Wed, 7 Apr 2021 16:14:56 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0253.hostedemail.com [216.40.44.253]) by kanga.kvack.org (Postfix) with ESMTP id A0CDD6B0073 for ; Wed, 7 Apr 2021 16:14:56 -0400 (EDT) Received: from smtpin09.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 54C9B180ACEE9 for ; Wed, 7 Apr 2021 20:14:56 +0000 (UTC) X-FDA: 78006674592.09.9EDF1FE Received: from server.lespinasse.org (server.lespinasse.org [63.205.204.226]) by imf14.hostedemail.com (Postfix) with ESMTP id 046CAC0007CB for ; Wed, 7 Apr 2021 20:14:50 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=lespinasse.org; i=@lespinasse.org; q=dns/txt; s=srv-11-ed; t=1617826493; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to : from; bh=1amBocSDkmECZ2mX+Wc/8c6p3WkPnn/9Znd0jYHQysk=; b=1utFFPbwYH/kug0197KEJXeIgLIxpJOV5kRZk+THEpmPkR5sjuxevNPszZCRqfhs8ZgzX VbSfwENbkDiOdRyAQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lespinasse.org; i=@lespinasse.org; q=dns/txt; s=srv-11-rsa; t=1617826493; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to : from; bh=1amBocSDkmECZ2mX+Wc/8c6p3WkPnn/9Znd0jYHQysk=; b=DEKz1SQnJU+nbSR645NCzeOO9THxWML8a9p6boPQGis3vFpMhPs8PQr3QbgvxAvvHslCn TnhKABdkSqoraINfdiXolIpbGsG0/HyHkthR8o2pYO/JWkunCg/m+y7RM8Zy7J6URdLpNVk SrbcSf7rpUqx7pTecUuEMzu0BVnmRyLXVoag4y3hJaYEnTgKyhq4TUp5vp8CZfhv7OKuQEv nojZ9+GLYUKT9Jo6X5fdvc4cKeHtGjf44xHYzXfE2zJzFiAzThgkuA2Un8/FxNJnZA3uyGK j35FL2gSm+wkUNjp7p6Z21ee5TkA7Co3CZTRDEaUUtXUEZgLRMfz1QljNXhQ== Received: by server.lespinasse.org (Postfix, from userid 1000) id B8916160244; Wed, 7 Apr 2021 13:14:53 -0700 (PDT) Date: Wed, 7 Apr 2021 13:14:53 -0700 From: Michel Lespinasse To: Peter Zijlstra Cc: Michel Lespinasse , 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: <20210407201453.GA25738@lespinasse.org> References: <20210407014502.24091-1-michel@lespinasse.org> <20210407014502.24091-12-michel@lespinasse.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 046CAC0007CB X-Stat-Signature: uszrq1uociiur8fkhdum43cjzjst89y5 Received-SPF: none (lespinasse.org>: No applicable sender policy available) receiver=imf14; identity=mailfrom; envelope-from=""; helo=server.lespinasse.org; client-ip=63.205.204.226 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1617826490-628354 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 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.