Received: by 10.213.65.68 with SMTP id h4csp1001023imn; Thu, 22 Mar 2018 13:06:08 -0700 (PDT) X-Google-Smtp-Source: AG47ELt8bc3VvVE3OVQB50SEmABY+KqFlpzyDWceiWU2FXR5/c8/ASWSQx4zQDfWkUmLbkiBiF8c X-Received: by 10.101.85.9 with SMTP id f9mr18965294pgr.189.1521749168334; Thu, 22 Mar 2018 13:06:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521749168; cv=none; d=google.com; s=arc-20160816; b=R5CGXb5Jaln7H951QHVJO/dL18epyqb9LgT85pNcm4IANZqTgtrPId6ABDjM9pbOO/ +KeeX6ANEBRiMvQ63bzL8CD390EfIAHRRStFPuj9L2PuDszxKXsEKVFxAeTpd0hUCJwb EBcKwRs4n3be4jkj+GiSrwOsikBgLcuiBqMg/qzf6DGCVZJiy3gAMnlMbD9VFxmAI2B5 m0hBQFMUP5nVthPBnDfeS9QuUK58nX/Xxq9g9YLs02r8/181v9iSIMiqgwFInsXO75Lm BPQfehjdlOzOSIbpWWTGUq8h0bq/B1cBrPOD8EKUdnUxZQpNxvpZwbcyZmvrB+W4CF3b J/og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=J1LxKwwqTUfeNZI1zWb2WL5nD6oO4HOPsphIT+kn91Q=; b=LHbFCtR7/FJR3V1UCZNl9KZ7/Ut3ofWSBckC4cRmBXGVdD+HYBs96+46dIBK6ci6oy XbCVXRwUSiuAQhPA93ZXJDjKjBErcJGAbWY6P9iSot/eKKX2tP5IAmaiQRKMkmWxihjo 7d+7okJ745vAmkQRlQNd6RovqTCPtrjetZxmXCOpWS7Q5c0yINoDWLH39xpFY43JeEJW ZVPPweMrfkz7BD/7JlJFv98fOrbt9gcPdqew7AMQTYeS4RsQSIrVqyWcDWwcdfiEgUm5 SQKeZmHoUsDOtLpHO4WcymVS9CySNk/3rH2RUMUzwQyurBuanfgKvlMr1QWSoKsCr+nL wVZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=JC9tK/td; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v1-v6si2632288plb.657.2018.03.22.13.05.48; Thu, 22 Mar 2018 13:06:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=JC9tK/td; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751909AbeCVUDR (ORCPT + 99 others); Thu, 22 Mar 2018 16:03:17 -0400 Received: from mail-pf0-f180.google.com ([209.85.192.180]:45254 "EHLO mail-pf0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751731AbeCVUDQ (ORCPT ); Thu, 22 Mar 2018 16:03:16 -0400 Received: by mail-pf0-f180.google.com with SMTP id l27so3795105pfk.12 for ; Thu, 22 Mar 2018 13:03:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=J1LxKwwqTUfeNZI1zWb2WL5nD6oO4HOPsphIT+kn91Q=; b=JC9tK/tdMwjv1b1XOPV0C8tRmxIWIOmfeRsjvQVAjLEUiWZsprZ33mIBbHBgMqiPXP tpEBuIhuyXAw8QRo6AnvAr4nE89RjuIGaa9DcUN5GtuXYLjbBxw4zxhl2M6hTVJ2zvxr 3aWhERXPH6WJcN1xEcYURoGbPVplMUIZ/TzqYgI6SRi/7maT8matZEN22ryFNvjnIyUG xJsue+sTMK5KCdUv9xwGUJC40Ham67qjv6aNVguXWsp5kUYt0vT10/VQdFOrXk4QRSxn FGOa8iWLUnDF1weL93ALqPL09oNNV+8WWsIyM7wo4Cv05h/KZ+Exk8pMlVJNXF667/qk umKg== 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:in-reply-to:message-id :references:user-agent:mime-version; bh=J1LxKwwqTUfeNZI1zWb2WL5nD6oO4HOPsphIT+kn91Q=; b=YcpeLzSGwQ9LbrBuWQ30XiRZqPEjaRPyuNVmGBhnk8XVMoDqU3u/55Yy5msUeD10rw sVs5oXp05yHL/kYTh6B7z3wnl4/qklP0pFZeBT+QegJi86iHb6hx1hQZqFkC3RMNqxeD 3qFw5/5UQVTVURw0Pw+TqlMEN8RBbm4NWiAhfEtedDtPduTfZK/dc5NwlEt122eMd9L1 Oe1OWYsIm+j9hfnP8cod9LgiH2Ken2SMLWq1CooEuJmKcNxwQS8LomI4nsfWQIILuqBL sS9kqnx9Ya+rEEa6jRueLLuEF342Swcj9Csje92eiyMWH9nU3fa6Uv9WMVgGWCYq1ErF p7xQ== X-Gm-Message-State: AElRT7F00BNFPs9FwScWh9PlWNwcZv7MGIjmMmtPbTSLXIcAhuylp4AL VXF9W4Zbdz7FBYU6YksykEhPJg== X-Received: by 10.98.200.130 with SMTP id i2mr12244202pfk.221.1521748995383; Thu, 22 Mar 2018 13:03:15 -0700 (PDT) Received: from [2620:15c:17:3:3a5:23a7:5e32:4598] ([2620:15c:17:3:3a5:23a7:5e32:4598]) by smtp.gmail.com with ESMTPSA id q15sm11863806pgv.49.2018.03.22.13.03.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Mar 2018 13:03:14 -0700 (PDT) Date: Thu, 22 Mar 2018 13:03:13 -0700 (PDT) From: David Rientjes X-X-Sender: rientjes@chino.kir.corp.google.com To: Steven Rostedt cc: LKML , linux-mm@kvack.org, Michal Hocko , Mel Gorman , Vlastimil Babka , Andrew Morton , Linus Torvalds , Alexei Starovoitov Subject: Re: [PATCH] mm, vmscan, tracing: Use pointer to reclaim_stat struct in trace event In-Reply-To: <20180322121003.4177af15@gandalf.local.home> Message-ID: References: <20180322121003.4177af15@gandalf.local.home> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 22 Mar 2018, Steven Rostedt wrote: > > The trace event trace_mm_vmscan_lru_shrink_inactive() currently has 12 > parameters! Seven of them are from the reclaim_stat structure. This > structure is currently local to mm/vmscan.c. By moving it to the global > vmstat.h header, we can also reference it from the vmscan tracepoints. In > moving it, it brings down the overhead of passing so many arguments to the > trace event. In the future, we may limit the number of arguments that a > trace event may pass (ideally just 6, but more realistically it may be 8). > > Before this patch, the code to call the trace event is this: > > 0f 83 aa fe ff ff jae ffffffff811e6261 > 48 8b 45 a0 mov -0x60(%rbp),%rax > 45 8b 64 24 20 mov 0x20(%r12),%r12d > 44 8b 6d d4 mov -0x2c(%rbp),%r13d > 8b 4d d0 mov -0x30(%rbp),%ecx > 44 8b 75 cc mov -0x34(%rbp),%r14d > 44 8b 7d c8 mov -0x38(%rbp),%r15d > 48 89 45 90 mov %rax,-0x70(%rbp) > 8b 83 b8 fe ff ff mov -0x148(%rbx),%eax > 8b 55 c0 mov -0x40(%rbp),%edx > 8b 7d c4 mov -0x3c(%rbp),%edi > 8b 75 b8 mov -0x48(%rbp),%esi > 89 45 80 mov %eax,-0x80(%rbp) > 65 ff 05 e4 f7 e2 7e incl %gs:0x7ee2f7e4(%rip) # 15bd0 <__preempt_count> > 48 8b 05 75 5b 13 01 mov 0x1135b75(%rip),%rax # ffffffff8231bf68 <__tracepoint_mm_vmscan_lru_shrink_inactive+0x28> > 48 85 c0 test %rax,%rax > 74 72 je ffffffff811e646a > 48 89 c3 mov %rax,%rbx > 4c 8b 10 mov (%rax),%r10 > 89 f8 mov %edi,%eax > 48 89 85 68 ff ff ff mov %rax,-0x98(%rbp) > 89 f0 mov %esi,%eax > 48 89 85 60 ff ff ff mov %rax,-0xa0(%rbp) > 89 c8 mov %ecx,%eax > 48 89 85 78 ff ff ff mov %rax,-0x88(%rbp) > 89 d0 mov %edx,%eax > 48 89 85 70 ff ff ff mov %rax,-0x90(%rbp) > 8b 45 8c mov -0x74(%rbp),%eax > 48 8b 7b 08 mov 0x8(%rbx),%rdi > 48 83 c3 18 add $0x18,%rbx > 50 push %rax > 41 54 push %r12 > 41 55 push %r13 > ff b5 78 ff ff ff pushq -0x88(%rbp) > 41 56 push %r14 > 41 57 push %r15 > ff b5 70 ff ff ff pushq -0x90(%rbp) > 4c 8b 8d 68 ff ff ff mov -0x98(%rbp),%r9 > 4c 8b 85 60 ff ff ff mov -0xa0(%rbp),%r8 > 48 8b 4d 98 mov -0x68(%rbp),%rcx > 48 8b 55 90 mov -0x70(%rbp),%rdx > 8b 75 80 mov -0x80(%rbp),%esi > 41 ff d2 callq *%r10 > > After the patch: > > 0f 83 a8 fe ff ff jae ffffffff811e626d > 8b 9b b8 fe ff ff mov -0x148(%rbx),%ebx > 45 8b 64 24 20 mov 0x20(%r12),%r12d > 4c 8b 6d a0 mov -0x60(%rbp),%r13 > 65 ff 05 f5 f7 e2 7e incl %gs:0x7ee2f7f5(%rip) # 15bd0 <__preempt_count> > 4c 8b 35 86 5b 13 01 mov 0x1135b86(%rip),%r14 # ffffffff8231bf68 <__tracepoint_mm_vmscan_lru_shrink_inactive+0x28> > 4d 85 f6 test %r14,%r14 > 74 2a je ffffffff811e6411 > 49 8b 06 mov (%r14),%rax > 8b 4d 8c mov -0x74(%rbp),%ecx > 49 8b 7e 08 mov 0x8(%r14),%rdi > 49 83 c6 18 add $0x18,%r14 > 4c 89 ea mov %r13,%rdx > 45 89 e1 mov %r12d,%r9d > 4c 8d 45 b8 lea -0x48(%rbp),%r8 > 89 de mov %ebx,%esi > 51 push %rcx > 48 8b 4d 98 mov -0x68(%rbp),%rcx > ff d0 callq *%rax > > Link: http://lkml.kernel.org/r/2559d7cb-ec60-1200-2362-04fa34fd02bb@fb.com > > Reported-by: Alexei Starovoitov > Signed-off-by: Steven Rostedt (VMware) Acked-by: David Rientjes