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.6 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 4C864C433E1 for ; Thu, 13 Aug 2020 23:46:46 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 08D65206DC for ; Thu, 13 Aug 2020 23:46:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="OHgB634I" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 08D65206DC 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 A126B8D000B; Thu, 13 Aug 2020 19:46:45 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9C36C8D0002; Thu, 13 Aug 2020 19:46:45 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8DB288D000B; Thu, 13 Aug 2020 19:46:45 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0194.hostedemail.com [216.40.44.194]) by kanga.kvack.org (Postfix) with ESMTP id 77C4E8D0002 for ; Thu, 13 Aug 2020 19:46:45 -0400 (EDT) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 3DF68181AEF1E for ; Thu, 13 Aug 2020 23:46:45 +0000 (UTC) X-FDA: 77147182770.19.walk36_581818a26ff8 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin19.hostedemail.com (Postfix) with ESMTP id F1E411AD31E for ; Thu, 13 Aug 2020 23:46:44 +0000 (UTC) X-HE-Tag: walk36_581818a26ff8 X-Filterd-Recvd-Size: 4869 Received: from mail-vk1-f196.google.com (mail-vk1-f196.google.com [209.85.221.196]) by imf29.hostedemail.com (Postfix) with ESMTP for ; Thu, 13 Aug 2020 23:46:44 +0000 (UTC) Received: by mail-vk1-f196.google.com with SMTP id q72so1654639vkb.11 for ; Thu, 13 Aug 2020 16:46:44 -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=jj2WWrfQhQ2PEnUg+tzTRbX/ZRC6+f1KYIGfCL+6gAI=; b=OHgB634IZZVmVMljDuN64qJsKtPYhCQMJhOHebmjxpbQqdV7NPOcY/BrU6LEiwxGLt sNEUsrFXnXsD/zxlBi011E7qR1+sBq3Ub5D88Wae+53CtFeSEjNmnDWQul9Z1m7fPt23 nfmeC3d+ImhCg+4zNFbupuqBm0G34/Bd8iyQb0fG3+psRb/ZOOJnhjLHe7Qt5KS2GzeB FlnE3yyreRi2KsjHH1pFosOnTFk+xV3sCbBRj5Chy1heJyafHhGN6pa1TdaThWcXV+Wx xRsT2Vr/+B7DujVyR61xtUzCg2S2XqlU/sxZT38+ZKGxUGLzv4hjeCP0OsRZkoOtZ9b7 bitw== 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=jj2WWrfQhQ2PEnUg+tzTRbX/ZRC6+f1KYIGfCL+6gAI=; b=JOWcf/Z1pM0WWhLClS3dy+0cRutl4MnFYKZSaGSLJpm/1WzlRK5Z9U8Qo8790NB8XY DxdXAupbNUAHWvTSZjhfLUCBx4B0t3sbYCCyFEJvtcVLJFJERG1pY9DKt45Opi7Lfs41 xg4ACSIak6BeVtoJkBFGMeAzdtaiPrU79Jp90XLEBCmljBlZm1Mlsqqjfp2Vl0dzEKCh NmDebcpYfG8TMHu7YAkpLikK6ntwpidQ1ZHG2SwrNkwuy8v58VMmPiDc9ijxjwkJn97w FkGFArQKKQz+B1v5medKR/zaXTrQqUtPVX1i9UG5xTfvm+cOrrUKUm3nFyueowV0cWVz iXZA== X-Gm-Message-State: AOAM5300efhowV7kaf5YCNoRnLYPxgWJUNX2G0yT7Me66n+AZSaza2Fd nIIWHmTkkPj7jtS9QTus9dqtB0jGVnBks0jkkOwuvg== X-Google-Smtp-Source: ABdhPJyPgjyg/Pki4rB7mvkpeGhSVQjcC9MjYdVJXBffclDnFxuI1td73HSJLLQthY8XC9q5U0U/mvBl3evCQ+yAElA= X-Received: by 2002:ac5:c925:: with SMTP id u5mr74722vkl.68.1597362403440; Thu, 13 Aug 2020 16:46:43 -0700 (PDT) MIME-Version: 1.0 References: <20200813220937.40973-1-pcc@google.com> <20200813223122.GR17456@casper.infradead.org> In-Reply-To: <20200813223122.GR17456@casper.infradead.org> From: Peter Collingbourne Date: Thu, 13 Aug 2020 16:46:31 -0700 Message-ID: Subject: Re: [PATCH v2] mm: introduce reference pages To: Matthew Wilcox Cc: John Hubbard , "Kirill A . Shutemov" , Andrew Morton , Catalin Marinas , Evgenii Stepanov , Linux ARM , linux-mm@kvack.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: F1E411AD31E X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam05 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 Thu, Aug 13, 2020 at 3:31 PM Matthew Wilcox wrote: > > On Thu, Aug 13, 2020 at 03:09:37PM -0700, Peter Collingbourne wrote: > > In order to measure the performance and RSS impact of reference pages, > > a version of this patch backported to kernel version 4.14 was tested on > > a Pixel 4 together with a modified [2] version of the Scudo allocator > > that uses reference pages to implement pattern initialization. A > > PDFium test program was used to collect the measurements like so: > > > > $ wget https://static.docs.arm.com/ddi0487/fb/DDI0487F_b_armv8_arm.pdf > > $ /system/bin/time -v ./pdfium_test --pages=1-100 DDI0487F_b_armv8_arm.pdf > > > > and the median of 100 runs measurement was taken with three variants > > of the allocator: > > > > - "anon" is the baseline (no pattern init) > > - "memset" is with pattern init of allocator pages implemented by > > initializing anonymous pages with memset > > - "refpage" is with pattern init of allocator pages implemented > > by creating reference pages > > > > All three variants are measured using the patch that I linked. "anon" > > is without the patch, "refpage" is with the patch and "memset" is > > with a previous version of the patch [3] with "#if 0" in place of > > "#if 1" in linux.cpp. The measurements are as follows: > > > > Real time (s) Max RSS (KiB) > > anon 2.237081 107088 > > memset 2.252241 112180 > > refpage 2.243786 107128 > > > > We can see that RSS for refpage is almost the same as anon, and real > > time overhead is 44% that of memset. > > Umm. These numbers aren't all /that/ compelling. memset takes 0.7% > longer than the baseline and consumes 4.8% more memory. I was expecting > better, to be honest ;-( It really depends on your environment and the program that you're running. 5% can go a long way on memory constrained hardware like low-end phones. And the number will go higher if the program makes sparse use of its allocations. Peter