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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1402FC433EF for ; Fri, 8 Apr 2022 07:31:32 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 87E7E6B0071; Fri, 8 Apr 2022 03:31:31 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 82EBC6B0072; Fri, 8 Apr 2022 03:31:31 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6F5B46B0074; Fri, 8 Apr 2022 03:31:31 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.28]) by kanga.kvack.org (Postfix) with ESMTP id 607EB6B0071 for ; Fri, 8 Apr 2022 03:31:31 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 19E5F25BEA for ; Fri, 8 Apr 2022 07:31:31 +0000 (UTC) X-FDA: 79332891582.04.14DF0D1 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf31.hostedemail.com (Postfix) with ESMTP id 5D59820007 for ; Fri, 8 Apr 2022 07:31:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1649403089; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AJie/UdH9Mqf7tAIiWd8hXnktBcEVlo+NQRFJbbT0jQ=; b=LDcAAhGLqqfzc3q+u+GebNjLAWrcMlikEpaSv+ApAbOHjV9j7uzQx1Bmz6K+7UFh1ZS4oD FufWcobHyFWdbq9JirqOaUGynROfY1IDgvvhkGMPOczMObGc0XCl1QCpXB4Q3EJYDwWQ+z 7Szi0SH20NGBMfXBQvnTyTWP5d8s5i4= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-563-sGsEmFwXNE6tBYHyBvcF6w-1; Fri, 08 Apr 2022 03:31:26 -0400 X-MC-Unique: sGsEmFwXNE6tBYHyBvcF6w-1 Received: by mail-wm1-f70.google.com with SMTP id a16-20020a05600c349000b0038e6392a346so3985224wmq.4 for ; Fri, 08 Apr 2022 00:31:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:organization:in-reply-to :content-transfer-encoding; bh=AJie/UdH9Mqf7tAIiWd8hXnktBcEVlo+NQRFJbbT0jQ=; b=s1ccyii1dDD9pTetn5+6G8Mefp3l/YAaxb3Tl+7Y2TaJPWR41PVVn/BLOXoqwbJ8A/ sfZQyKEUpWTsqiWtdPLVccQDFsNKOUigrQ1PBwiCpC4TpwPFKQHfAAD8EAN4FYIW2VI9 t0HEwVIEXBx/lgrUfQzaPme7nbvxw78UaFmWh1Pn7XbgqYdKXb71+IdfvicfE3itM0e0 T3ycTcpPne40Gxc6Aem6AEZr2d6h9HpjHOHgMghc++u6hFTcx2sn5ND1HBWMfEKG+aDZ J8RYFgX8YUhggQAZ7J84TtWs8ZHT4YaGtCgiPU+GesX5vhmYv4ARU1EhEEXMBBE3AGbD JRPQ== X-Gm-Message-State: AOAM531lt0/eh4T8HEGpXhQWg1269hKNIEXVlMX1oVPbQQtSy4hqThOx NDHB+HpFjXw+P+RghaXrq8oCng8ITxwtqLTULK3QdQAgGuWQHSTSg46dgbLbgmU0JWyuBznemi+ efnCJ3/qTZ9w= X-Received: by 2002:a1c:7517:0:b0:38c:8722:9bc6 with SMTP id o23-20020a1c7517000000b0038c87229bc6mr15680347wmc.2.1649403085211; Fri, 08 Apr 2022 00:31:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw3TTJ46O1ZC2FKUoNgMnaa7amF/PK4+JqHt94o201sprDkj+NNKAsFzvfC8rddbjp5DCgwYA== X-Received: by 2002:a1c:7517:0:b0:38c:8722:9bc6 with SMTP id o23-20020a1c7517000000b0038c87229bc6mr15680330wmc.2.1649403084913; Fri, 08 Apr 2022 00:31:24 -0700 (PDT) Received: from ?IPV6:2003:cb:c704:fd00:612:f12b:a4a2:26b0? (p200300cbc704fd000612f12ba4a226b0.dip0.t-ipconnect.de. [2003:cb:c704:fd00:612:f12b:a4a2:26b0]) by smtp.gmail.com with ESMTPSA id i14-20020a0560001ace00b00203da1fa749sm28007860wry.72.2022.04.08.00.31.23 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 08 Apr 2022 00:31:24 -0700 (PDT) Message-ID: Date: Fri, 8 Apr 2022 09:31:23 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.6.2 Subject: Re: [PATCH] delayacct: track delays from COW To: CGEL Cc: akpm@linux-foundation.org, bsingharora@gmail.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Yang Yang , Ran Xiaokai References: <20220322110444.2340748-1-yang.yang29@zte.com.cn> <9f9ddbf7-797a-58d8-2903-beacb2698329@redhat.com> <624d434a.1c69fb81.11e99.b2b8@mx.google.com> From: David Hildenbrand Organization: Red Hat In-Reply-To: <624d434a.1c69fb81.11e99.b2b8@mx.google.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 5D59820007 X-Rspam-User: Authentication-Results: imf31.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=LDcAAhGL; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf31.hostedemail.com: domain of david@redhat.com has no SPF policy when checking 170.10.129.124) smtp.mailfrom=david@redhat.com X-Stat-Signature: iq3cpi3jdq7ejk58bqff5o87nhqmmppd X-HE-Tag: 1649403090-70724 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000001, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 06.04.22 09:37, CGEL wrote: > On Wed, Mar 23, 2022 at 09:49:46AM +0100, David Hildenbrand wrote: >> On 22.03.22 12:04, cgel.zte@gmail.com wrote: >>> From: Yang Yang >>> >>> Delay accounting does not track the delay of COW. When tasks trigger >>> much COW, it may spend a amount of time waiting for it. To get the >>> impact of tasks in COW, measure the delay when it happens. This >>> could help users to do tunnings, such as decide whether to use >>> ksm or not. >>> >>> Also update tools/accounting/getdelays.c: >>> >>> / # ./getdelays -dl -p 231 >>> print delayacct stats ON >>> listen forever >>> PID 231 >>> >>> CPU count real total virtual total delay total delay average >>> 6247 1859000000 2154070021 1674255063 0.268ms >>> IO count delay total delay average >>> 0 0 0ms >>> SWAP count delay total delay average >>> 0 0 0ms >>> RECLAIM count delay total delay average >>> 0 0 0ms >>> THRASHING count delay total delay average >>> 0 0 0ms >>> COMPACT count delay total delay average >>> 3 72758 0ms >>> COW count delay total delay average >>> 3635 271567604 0ms >> >> You should also update Documentation/accounting/delay-accounting.rst >> most probably. >> >> Overall LGTM and this might be of value not only for KSM but for anybody >> using fork(). There will be collisions with [1], especially [2], which I >> want to get in -next early after we have v5.18-rc1 (after rebasing [1] >> on top of this). >> >> We'll have to decide if we want to also account hugetlb wp code >> (hugetlb_cow), and if we want to account "unsharing" here as well under >> cow (I tend to say that we want to for simplicity). For THP, we only >> split and don't copy, so there isn't anything to account. >> > As for simplicity, what about account "PAGECOPY" instead of "COW"? > "PAGECOPY" include COW and unsharing. And we may also account hugetlb > wp in follow-up patches, based on this patch is sufficient reviewed. PAGECOPY might be too generic. You actually want to express "potentially shared page was copied by the write-fault handler while it was write protected". do_wp_page()->wp_page_copy() Maybe simply "WP_COPY" as a prefix ("Write-protect copy") ? -- Thanks, David / dhildenb