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=-15.9 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1, USER_IN_DEF_DKIM_WL 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 2BE24C43457 for ; Tue, 13 Oct 2020 19:42:20 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A1812218AC for ; Tue, 13 Oct 2020 19:42:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="ZMgcmjHl" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A1812218AC Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 1BBDF6B0062; Tue, 13 Oct 2020 15:42:19 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 192C46B006E; Tue, 13 Oct 2020 15:42:19 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 082C0900002; Tue, 13 Oct 2020 15:42:19 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0232.hostedemail.com [216.40.44.232]) by kanga.kvack.org (Postfix) with ESMTP id F016B6B0062 for ; Tue, 13 Oct 2020 15:42:18 -0400 (EDT) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id B96573626 for ; Tue, 13 Oct 2020 19:42:18 +0000 (UTC) X-FDA: 77367923556.18.brain82_0e0af9b27205 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin18.hostedemail.com (Postfix) with ESMTP id 81EF4101F68A5 for ; Tue, 13 Oct 2020 19:42:18 +0000 (UTC) X-HE-Tag: brain82_0e0af9b27205 X-Filterd-Recvd-Size: 4959 Received: from mail-pg1-f195.google.com (mail-pg1-f195.google.com [209.85.215.195]) by imf29.hostedemail.com (Postfix) with ESMTP for ; Tue, 13 Oct 2020 19:42:17 +0000 (UTC) Received: by mail-pg1-f195.google.com with SMTP id o3so317369pgr.11 for ; Tue, 13 Oct 2020 12:42:17 -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=5mrvqvMIaVx8YdFnVM8H9lrWw2mwZ5lC/eqzeoAO6ng=; b=ZMgcmjHlkYwfdx37LKAjX3+FOPNj5GtQEEj01BxtRkZGZXvC5cOBVQiRrw6rbtZdc3 NDFQJrXR6KsTEtAnlY98eUCnEXSAYEV3aeDpHTzNmdJ8HlwPzvGKDP/M1RXhjCKoLtRb z8r8DCS78XwrdBHHCSAQ8LIXPEHKmwMffhT0UAyA1nFhWEaRXzdAR66UDDSThGzDhD3c janb150NhTM9My5elFPfRqO3pJWQDZQYFiCQmOQDxNvV9zkm4c7MBcPrav47ph8ydRDH mIMbCubwp0IzZrm6UGzOjiSouMCDBNc4ucVnyNTZyfEdzROQSgK0W3jUuM9WBEvtBNGM GtcA== 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=5mrvqvMIaVx8YdFnVM8H9lrWw2mwZ5lC/eqzeoAO6ng=; b=Mh3mUX5LJsXl1wdBsI9pIf4acpAr5Bbjzb1Hn2ZVbhE1U10encmLa8xuYhyW1tE+LY P9E0nVOLVtOdoI1lNKeubIBk23bW3iRGKV1i/KdjKYRJcl8HcT5HprK6pLNU2tZGiknS ueAKEOqWPh3+k+ZjYAOY5Zbk6PggorX8R/ARcXOP/XJb0hYXs8g/Inb/YKZGfDWbbgMO YN5CdC4EGuolHBzkIQ0ifMze0eLq3G4E8p4km9ldRxPX8isZB4qCd/EWiJvrd3GcyJ7D ydWmi6VBU4Miuh75jhbXbHtH/AwiKWlAZ77+aVfANNArpStWOX8GjVUJ22S3awwOjiIm q55g== X-Gm-Message-State: AOAM5332dWsK2JymxLAKm0bBggiiZK5zqMXuiAe5qe6zO0qWejAMxmqJ TgSYruaHIoq+ln1oFiWwfJicDg== X-Google-Smtp-Source: ABdhPJwjagE9zWmgTakngcSQaS0UasG+EVCQ8vyFq2nEZtdDJjqIwPbNUPENFBELqAX+4T0bnM7MIw== X-Received: by 2002:a62:5b81:0:b029:156:2dce:5aa with SMTP id p123-20020a625b810000b02901562dce05aamr1171241pfb.15.1602618136899; Tue, 13 Oct 2020 12:42:16 -0700 (PDT) Received: from [2620:15c:17:3:4a0f:cfff:fe51:6667] ([2620:15c:17:3:4a0f:cfff:fe51:6667]) by smtp.gmail.com with ESMTPSA id f9sm737237pjq.26.2020.10.13.12.42.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Oct 2020 12:42:16 -0700 (PDT) Date: Tue, 13 Oct 2020 12:42:15 -0700 (PDT) From: David Rientjes X-X-Sender: rientjes@chino.kir.corp.google.com To: Axel Rasmussen cc: Steven Rostedt , Ingo Molnar , Andrew Morton , Michel Lespinasse , Vlastimil Babka , Daniel Jordan , Laurent Dufour , Jann Horn , Chinwen Chang , Yafang Shao , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH v3 2/2] mmap_lock: add tracepoints around lock acquisition In-Reply-To: <20201009220524.485102-3-axelrasmussen@google.com> Message-ID: References: <20201009220524.485102-1-axelrasmussen@google.com> <20201009220524.485102-3-axelrasmussen@google.com> User-Agent: Alpine 2.23 (DEB 453 2020-06-18) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII 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 Fri, 9 Oct 2020, Axel Rasmussen wrote: > The goal of these tracepoints is to be able to debug lock contention > issues. This lock is acquired on most (all?) mmap / munmap / page fault > operations, so a multi-threaded process which does a lot of these can > experience significant contention. > > We trace just before we start acquisition, when the acquisition returns > (whether it succeeded or not), and when the lock is released (or > downgraded). The events are broken out by lock type (read / write). > > The events are also broken out by memcg path. For container-based > workloads, users often think of several processes in a memcg as a single > logical "task", so collecting statistics at this level is useful. > > The end goal is to get latency information. This isn't directly included > in the trace events. Instead, users are expected to compute the time > between "start locking" and "acquire returned", using e.g. synthetic > events or BPF. The benefit we get from this is simpler code. > > Because we use tracepoint_enabled() to decide whether or not to trace, > this patch has effectively no overhead unless tracepoints are enabled at > runtime. If tracepoints are enabled, there is a performance impact, but > how much depends on exactly what e.g. the BPF program does. > > Signed-off-by: Axel Rasmussen Acked-by: David Rientjes