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=-7.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no 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 B7BD9C55178 for ; Tue, 27 Oct 2020 13:49:20 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 0E19E21D24 for ; Tue, 27 Oct 2020 13:49:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="eWDZCIUP" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0E19E21D24 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 4727F6B0068; Tue, 27 Oct 2020 09:49:19 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3FB456B0070; Tue, 27 Oct 2020 09:49:19 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2C4596B0071; Tue, 27 Oct 2020 09:49:19 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0050.hostedemail.com [216.40.44.50]) by kanga.kvack.org (Postfix) with ESMTP id EF7146B0068 for ; Tue, 27 Oct 2020 09:49:18 -0400 (EDT) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 939F6180AD802 for ; Tue, 27 Oct 2020 13:49:18 +0000 (UTC) X-FDA: 77417837196.22.actor78_2e110b92727c Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin22.hostedemail.com (Postfix) with ESMTP id 734BD18038E60 for ; Tue, 27 Oct 2020 13:49:18 +0000 (UTC) X-HE-Tag: actor78_2e110b92727c X-Filterd-Recvd-Size: 5026 Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by imf31.hostedemail.com (Postfix) with ESMTP for ; Tue, 27 Oct 2020 13:49:17 +0000 (UTC) Received: by mail-wr1-f67.google.com with SMTP id y12so1988277wrp.6 for ; Tue, 27 Oct 2020 06:49:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=cc:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=kRHHTQrp6yT0152MnBrHRRLynfUppz+NSGI66c0v2vE=; b=eWDZCIUPAOgoBsALYXvYwj3B5bGkmRtLAPz6nXPhACYjQi6Jw7rqUENAIJgf6qxS+v WvhHnfgp2Z3aE3AOxJKMdIj+c/cN5Fvxfq7rXvYzVYU/+T3TQU4rSSMrJBgovUXPKP+L 7rA0+RGaGULoTL1YFRUFDgmk0hZjZ3eXKWWl1kIPZZs6VWi9exJyadVGpQcpGZANI+OE 4lESwpGj3jv+Aw7sNTazYtuY40vzlAMmxeXtrMFffExk6mVUzWzBw4nL1lCAScM9IAbK m1PndXCo7YjRRgW9qjxB4qT2kra7bifJaN9hpblOOfPiK2yQEYX/1jafOwPYJJNjdOTm Bggg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:cc:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=kRHHTQrp6yT0152MnBrHRRLynfUppz+NSGI66c0v2vE=; b=PyssjJuH+WMOQst9POErRGKyhDe1joR4jST8Pb1ShUvvwl6plucDhTlNu3Fl9Ga8y/ Sdi93C+mlEgaF5D9xXOBkjYcFJ89IpK+CxUbh9ThUaMqt/FNjAnd/NRKhFrU0DNS7smr 9jDnIq1plswiNBWc0VY0MzYS3r/u7hLZgR5Z3r676mdc9+WFre9WtCTzyhOqZIBrUiSL +f0p5XU/4aS/zKMOdlnEH5Yj/scqjoshwHBQIYgEGSWmkmOjAz46ud1UKXAdr4xlYUQu OfLMgSnmm/PEPXry2HdEawyuDS3CtHPz1rLb4Dw3D6OeQTBQLJNCMLmpjx9B3vARbqrb iB6w== X-Gm-Message-State: AOAM532kaloq8HKj5DvvZQkBVl801OafGJnU/imWSLzbtILqaW/nbO1E jM8U619xmtIJR9Zx8rbiWEc= X-Google-Smtp-Source: ABdhPJxrq9imRCCQB/25UMOKQaR3KYm3htFxX6iZ5ey+qapDghbL52QvkuDwhemquZpkgY4TXMre4A== X-Received: by 2002:adf:df03:: with SMTP id y3mr2998505wrl.70.1603806556703; Tue, 27 Oct 2020 06:49:16 -0700 (PDT) Received: from ?IPv6:2001:a61:245a:d801:2e74:88ad:ef9:5218? ([2001:a61:245a:d801:2e74:88ad:ef9:5218]) by smtp.gmail.com with ESMTPSA id w7sm2385959wre.9.2020.10.27.06.49.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 27 Oct 2020 06:49:15 -0700 (PDT) Cc: mtk.manpages@gmail.com, linux-man , Linux-MM , Mark Mossberg , Michal Hocko Subject: Re: [PATCH] proc.5: Document inaccurate RSS due to SPLIT_RSS_COUNTING To: Jann Horn References: <20201012114940.1317510-1-jannh@google.com> <0a090c14-6b70-4284-bb2d-4fbfd1146aaf@gmail.com> From: "Michael Kerrisk (man-pages)" Message-ID: Date: Tue, 27 Oct 2020 14:49:14 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit 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 10/27/20 11:35 AM, Jann Horn wrote: > On Tue, Oct 27, 2020 at 8:05 AM Michael Kerrisk (man-pages) > wrote: >> On 10/12/20 4:52 PM, Jann Horn wrote: >>> On Mon, Oct 12, 2020 at 1:49 PM Jann Horn wrote: >>>> Since 34e55232e59f7b19050267a05ff1226e5cd122a5 (introduced back in >>>> v2.6.34), Linux uses per-thread RSS counters to reduce cache contention on >>>> the per-mm counters. With a 4K page size, that means that you can end up >>>> with the counters off by up to 252KiB per thread. >>> >>> Actually, as Mark Mossberg pointed out to me off-thread, the counters >>> can actually be off by many times more... >> >> So, does your patch to proc.5 need tweaking, or can I just apply as is? > > The "(up to 63 pages per thread)" would have to go, the rest should be correct. > > But as Michal said, if someone volunteers to get rid of this > optimization, maybe we don't need the documentation after all? But > that would probably require actually doing some careful > heavily-multithreaded benchmarking on a big machine with a few dozen > cores, or something like that, so that we know whether this > optimization actually is unimportant enough that we can just get rid > of it... Okay -- in the meantime, I've applied your patch, with your suggested edit, to remove "(up to 63 pages per thread)". Thanks! Cheers, Michael -- Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Linux/UNIX System Programming Training: http://man7.org/training/