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=-11.4 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL 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 D9F47C4363A for ; Tue, 27 Oct 2020 10:36:06 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E69B722264 for ; Tue, 27 Oct 2020 10:36:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="Bg0yRl3D" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E69B722264 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 644416B006C; Tue, 27 Oct 2020 06:36:05 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5F3B56B006E; Tue, 27 Oct 2020 06:36:05 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4E2416B0070; Tue, 27 Oct 2020 06:36:05 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0124.hostedemail.com [216.40.44.124]) by kanga.kvack.org (Postfix) with ESMTP id 22D9D6B006C for ; Tue, 27 Oct 2020 06:36:05 -0400 (EDT) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id BBD40824999B for ; Tue, 27 Oct 2020 10:36:04 +0000 (UTC) X-FDA: 77417350248.26.sun30_580cd9f2727b Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin26.hostedemail.com (Postfix) with ESMTP id 98DDA1804B640 for ; Tue, 27 Oct 2020 10:36:04 +0000 (UTC) X-HE-Tag: sun30_580cd9f2727b X-Filterd-Recvd-Size: 3965 Received: from mail-lf1-f68.google.com (mail-lf1-f68.google.com [209.85.167.68]) by imf26.hostedemail.com (Postfix) with ESMTP for ; Tue, 27 Oct 2020 10:36:04 +0000 (UTC) Received: by mail-lf1-f68.google.com with SMTP id a9so1643495lfc.7 for ; Tue, 27 Oct 2020 03:36:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=mDAK9Qmkus2JuFVmISrLkJzFGr6N2n2S3A2eNKiZQ80=; b=Bg0yRl3DQQJVxqp9z1MVtlyenRDUqs8aPuoR+xoioHWwUWs0lLufTQ0M8jBvgOSIIc WyfviguwJb7eVf2UjVyKrPR05ZUJbF9hf+dbjaJLfq1Uv2VIu9tph4Kf3oE+CFQIoZAI Oyd+2XK2nSYUtOcFK29xdNgF+TC5C09ayB9mAe/r2rAvftzT6MiOX3csfK2KaAL2kEEh t+QAlfivOX8He8/C0Kta3s0rQz+3ri+d/JFFoQmKw8e6hW9h2vSJNV7BjzLovAjAL7Ep w310lf/AxYh0alfxlvPz+OW5hevPCYRk9fnNgsPYOQC8q86pup6ZK3hd9vCYw3tWMSCX +ahA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=mDAK9Qmkus2JuFVmISrLkJzFGr6N2n2S3A2eNKiZQ80=; b=tslPNdsOtdxoUm1HBtoyoso28qY9l02Ih+gVRB4XFBZTyfl+QupLZrKTml5ZV0SYhE t/SLKLegGs1n4rfRF89gb29BR/yHUC6nLOJP8HOJBdiYG4+R2SvP3blDQDGEkIHF6hGx BjFByRn8hnuXw+7lqDaM3BCUyMLrpNGza9KUwN7BKBiQVZ70SiiePLfUSqXflfx5GIrI oFfZfKdR/ZqmmPJM/cYQu7EH+S2y1HPZrNryv7txywDHtxcd1k0FBlBuX10y054R/Oxo kcHj7byEt128UKwSpteiGodNkotbXX1hHmTKQRGK7TKW+Sh3HFejUxdls7KT1RY+h+Ii q5Cw== X-Gm-Message-State: AOAM533slNXdHV/V/6xoWFojz2HgYeytF/P6JyjYS1namUVWXVE9zgiy xwJSl5NuinxIKDrq5jP45i4WJFLilhaSnrsStPuD/g== X-Google-Smtp-Source: ABdhPJzzd0v9qutxuBdKKI7KWhwYgFAlqxH6SXNpsTX8Meps08NuGo/cq13wdOHWuN7X4eo0Or1tURBcsH7krfoPslg= X-Received: by 2002:a19:e308:: with SMTP id a8mr587547lfh.573.1603794962371; Tue, 27 Oct 2020 03:36:02 -0700 (PDT) MIME-Version: 1.0 References: <20201012114940.1317510-1-jannh@google.com> <0a090c14-6b70-4284-bb2d-4fbfd1146aaf@gmail.com> In-Reply-To: <0a090c14-6b70-4284-bb2d-4fbfd1146aaf@gmail.com> From: Jann Horn Date: Tue, 27 Oct 2020 11:35:35 +0100 Message-ID: Subject: Re: [PATCH] proc.5: Document inaccurate RSS due to SPLIT_RSS_COUNTING To: "Michael Kerrisk (man-pages)" Cc: linux-man , Linux-MM , Mark Mossberg , Michal Hocko Content-Type: text/plain; charset="UTF-8" X-Bogosity: Ham, tests=bogofilter, spamicity=0.016994, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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...