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 DF80EC38142 for ; Wed, 18 Jan 2023 03:16:21 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4F16B6B0071; Tue, 17 Jan 2023 22:16:21 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 4A13A6B0072; Tue, 17 Jan 2023 22:16:21 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 369046B0074; Tue, 17 Jan 2023 22:16:21 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 24C926B0071 for ; Tue, 17 Jan 2023 22:16:21 -0500 (EST) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id F00D1120C4D for ; Wed, 18 Jan 2023 03:16:19 +0000 (UTC) X-FDA: 80366456478.17.662FA25 Received: from mail-lf1-f47.google.com (mail-lf1-f47.google.com [209.85.167.47]) by imf30.hostedemail.com (Postfix) with ESMTP id 5054980015 for ; Wed, 18 Jan 2023 03:16:18 +0000 (UTC) Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=OE8k0rj1; spf=pass (imf30.hostedemail.com: domain of laoar.shao@gmail.com designates 209.85.167.47 as permitted sender) smtp.mailfrom=laoar.shao@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1674011778; a=rsa-sha256; cv=none; b=iG5YW1vwA0CyaXkTlSxp7UjT6EKrpLchn1alnOpxqq6/ne9hOZFygxvK0Dcbl9977BJT0g r5q0Gs0Nu+zWtsXES+6wGFteN1Q48S9rP1ceSgmLbhmWnnKYN5p+OjfCnLE5LL3iV023Jx V0qM2Jp4SgkzuIIzpmqBnvcRyoYu/q0= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=OE8k0rj1; spf=pass (imf30.hostedemail.com: domain of laoar.shao@gmail.com designates 209.85.167.47 as permitted sender) smtp.mailfrom=laoar.shao@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1674011778; h=from:from:sender: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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=7USbsn5vURMZTsjZ7WiIP6y324JAT/WoLeLdfTSB+aU=; b=7nQglXjoIohZYjXuH6w27px4nfIxffqY0E/a5WpK+nMkbhVt5/dgVORB0je7ab9Ce6nbpC Wmq0riTka0atkijKR53x8jkH3ky0SAl/3RAlWQo7w+DrgGyHWk2BhAsnDmmy98JbLCKiJ9 qtfoeiWeMrS41mSngXRxifdihZSUGCY= Received: by mail-lf1-f47.google.com with SMTP id d30so44976157lfv.8 for ; Tue, 17 Jan 2023 19:16:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=7USbsn5vURMZTsjZ7WiIP6y324JAT/WoLeLdfTSB+aU=; b=OE8k0rj1zQlLle+0H7+C5RwGYS8XQNxg/8DjPA46yrq0bfmMaVWvSJY8ItwosEjVjL H8h7UPsXw39BHgTK6nBaWvGQx+8YflIKr/kgl3ykdriX/wjtAf5pYW/xY8BYEJp4flrK alcDR0sFa0ufyO7dvRpiAxAlRHzlw1gbGhirYny2aWljWBMrRWJXf/o9Qb2Cq5v7Q4f3 XnQp8bmV8ypUovn4uL4JL17v6kOlIQJdq1NR+A+G+1OvbXjFrVk7us0irZJ9CudMbRFR TRrMsWxpgQVGT6uzWPqH9exaYIJQcCr2Q3Iu96++EFSbr57APAuosqw4rSeJDPxUz5hV QUew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=7USbsn5vURMZTsjZ7WiIP6y324JAT/WoLeLdfTSB+aU=; b=FIHbuZKY7pzYjktU7ADW2iRCdtx4Li05+iXQTwONh5NDt4Z88/E+e6gQS8unxthNwf sAbX5OMtOI1HqTXRGJQfnYLF02+rRo6MbYDeR4PKf7OTrld5Z43n8Fzw/cO3DhSU3NKS hTAlnkkWVXnpQxlHgnzCOeA+8xO4YrtYLVBGvyadR4WgQi4vIgAnCMPGXTSQ5rksDI0Q HQdo86+ERbkRwa5fx58mhD3IqEavyVaY2bd9cv1wvGjepqbS/8y8MKwrQgu4lY/uig2a JC/BovEUegHJwWbNDdbI+G4dgZk4r4B42vuP94ynqWaKyCjeJ9RCHGC7lkAhKU1Ehfiu 4Vgg== X-Gm-Message-State: AFqh2ko4vs7sZ3p+BlLgyAgM6wdakOub1rWDV6kcGOtf+Kpondgy8ITZ Yxe9DS2PwKE5/HmIGXei5ouN5LL5ucGNNJ7gQRg= X-Google-Smtp-Source: AMrXdXv1IYbO2qgUh1mppolqzJrUTnRBRIi10QWonMLM2mb1oH6IiJ0A8dkMpd9T2Ag12hMSMNaYt6Vwng1s3Fpi5A0= X-Received: by 2002:a19:7712:0:b0:4cc:9c4b:6dfa with SMTP id s18-20020a197712000000b004cc9c4b6dfamr251430lfc.307.1674011776449; Tue, 17 Jan 2023 19:16:16 -0800 (PST) MIME-Version: 1.0 References: <20221217105833.24851-1-laoar.shao@gmail.com> In-Reply-To: From: Yafang Shao Date: Wed, 18 Jan 2023 11:15:40 +0800 Message-ID: Subject: Re: [PATCH -mm 0/2] mm: page_ext: split page_ext flags To: Vlastimil Babka Cc: akpm@linux-foundation.org, 42.hyeyoo@gmail.com, willy@infradead.org, linux-mm@kvack.org Content-Type: text/plain; charset="UTF-8" X-Rspam-User: X-Rspamd-Queue-Id: 5054980015 X-Rspamd-Server: rspam01 X-Stat-Signature: a8out5ptr9zua1z7pzfy8tjffsj47d3o X-HE-Tag: 1674011778-360499 X-HE-Meta: U2FsdGVkX1+VS6yL3HlVkGWPDoQLnVCbL0mubTWovy1Me2rTSlN2e0xbcy5BOn9KEvrQmHQuVe46JLtzJ6NqPGXQBg/SyLeU3YfLTL74VCv5e9GqsiS4u4ApSOYB8WQ87jxRTAsCLpaIXLuNHGuJnC4oiFdv3zDjFK5B32x66qCaW3OWpuILcAmJ4R4kHvppkylm9+ovNVbgA43BoMYdMGEEDb/QRa4mScYAWe48XSrrSc2Zqxhsnaw9d5uKRgDqdciDb4Q7/pr8oDzuwC7WXYo0BIXQXjYXiQ10a2CCDG3A8UD2S4YIN/LNoYeVmuzNznj+nZuG+b4PhZvOY+Lx4iE2HdKHV49wfUU82kYKls+RNMKYFiYPXhXYiVimLVCDrze/VTPc8o0IvefpoKqHkwXobW41IqJzbm9lXIjnWcJaH2vCWx+2K51RyTCPPbkkyTyPG2uwHu5+I1lwsPQJt06AG2Vf6rzRq+qkk/jwOPkME+wX0NLI6cCbCMT+4q+dN3b5CX3Rc1F3VnkkE19Cja+Ac0SclXBeIeKWZM2Sq/RvJXvdbEXRll76LDitS+NnG9jsYRzD6bmfcqC+6Q02AV8KdPnoTb2e9fRRV/aQPxEl2+UjHSwersJVwbkp5qVWW2OKJa6cO0h3LdOVEbXZOXA3PWC5yLxmAqDPfjJU8YZj7trcXVVzqqE+9Yw5a9RjDWSXQheIaHUEuMQ5jyGCU1zdTdEPrNNisPay/UsyxIASmQqlbLM+leC1dyVgOR4OFpK0ofwlEACPJFbDxJgys1wB32/0QSxDBgCnT1ckbGScNR+8M+hiMPRsHkQMHqWGbaBZrs3BCNVI5Umq8xqSrXzLrVuAEVcIznHg2fOE0XvqAOO3dXEKoBzAtYRAFor36JpMKZyE01qOywEEvL8hWYgO6fyZoExJOUPpSar11WP5jtv9L5i4ayJHLFtu9pDHthh1Ss2rMBhjwkzlAav 0E8ZpsJC 20gxE5loOCPOuD+/4JWLh4odo1lZVRQpyDu6gCfYgorWPLpkTIGlFJ8C0hpI6wqUPub8fl5EaxxgiqGgICAwkxjXq3o4iuUyABvUisnvb7Ou0zqYosgZWVjTQijwm55Ths04CxKFsqUWrzH1w9qUlpQh1eQgkwn31Jm4YdbjIQd2d/EN6XqBgCckS9cjt4Djn75RmJQQGg2jEL6s= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000003, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, Jan 16, 2023 at 6:58 PM Vlastimil Babka wrote: > > On 12/17/22 11:58, Yafang Shao wrote: > > On 64bit system, page extension is for debugging purpose only currently, > > because of its overhead, in particular the memory overhead. > > > > Once a page_ext is enabled, at least it will take 0.2% of the total > > memory because of the page_ext flags, no matter this page_ext uses it or > > not. Currently this page_ext flags is only used for page_owner on 64bit > > system. So it doesn't make sense to allocate this flags for all page_ext > > by default. We'd better move it into page_owner's structure, then when > > someone wants to introduce a new page_ext which may be memory-overhead > > sensitive, it will save this unneeded overhead. > > > > On 32bit system, there's page_idle running on production envrionment, > > which also uses this page_ext flags. So it will take another 0.2% of > > total memory if the user enable both page_idle and page_owner after this > > change, but considering page_owner is for debugging purpose only, the > > memory overhead in this case won't be a problem. > > > > So, let split the page_ext flags. > > Hi, > > FYI I think Pasha's solution should work to avoid the waste even without the > split: > > https://lore.kernel.org/all/20230113154253.92480-1-pasha.tatashin@soleen.com/ > Thanks for the information! Splitting the flags could make page extensions more clear. We'd better modularize these page extensions. Different page extensions should maintain their members in their own implementations. But if the maintainer prefers Pasha's solution, I don't have strong objectation. Regards Yafang