lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20201117152936.4bad2b74@canb.auug.org.au>
Date:   Tue, 17 Nov 2020 15:29:36 +1100
From:   Stephen Rothwell <sfr@...b.auug.org.au>
To:     Randy Dunlap <rdunlap@...radead.org>
Cc:     akpm@...ux-foundation.org, broonie@...nel.org,
        linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-mm@...ck.org, linux-next@...r.kernel.org, mhocko@...e.cz,
        mm-commits@...r.kernel.org, Mike Rapoport <rppt@...nel.org>
Subject: Re: mmotm 2020-11-16-16-47 uploaded (m/secretmem.c)

Hi all,

On Mon, 16 Nov 2020 20:20:12 -0800 Randy Dunlap <rdunlap@...radead.org> wrote:
>
> on x86_64:
> 
> as reported on 2020-11-12:
> 
> when CONFIG_MEMCG is not set:
> 
> ../mm/secretmem.c: In function ‘secretmem_memcg_charge’:
> ../mm/secretmem.c:72:4: error: ‘struct page’ has no member named ‘memcg_data’
>    p->memcg_data = page->memcg_data;
>     ^~
> ../mm/secretmem.c:72:23: error: ‘struct page’ has no member named ‘memcg_data’
>    p->memcg_data = page->memcg_data;
>                        ^~
> ../mm/secretmem.c: In function ‘secretmem_memcg_uncharge’:
> ../mm/secretmem.c:86:4: error: ‘struct page’ has no member named ‘memcg_data’
>    p->memcg_data = 0;
>     ^~

(As I said earlier today,) I will apply the following to linux-next today:

From: Stephen Rothwell <sfr@...b.auug.org.au>
Date: Mon, 16 Nov 2020 16:55:10 +1100
Subject: [PATCH] secretmem-add-memcg-accounting-fix2

Signed-off-by: Stephen Rothwell <sfr@...b.auug.org.au>
---
 mm/secretmem.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/mm/secretmem.c b/mm/secretmem.c
index 5ed6b2070136..c7a37b2d01ed 100644
--- a/mm/secretmem.c
+++ b/mm/secretmem.c
@@ -59,6 +59,7 @@ bool secretmem_active(void)
 
 static int secretmem_memcg_charge(struct page *page, gfp_t gfp, int order)
 {
+#ifdef CONFIG_MEMCG
 	unsigned long nr_pages = (1 << order);
 	int i, err;
 
@@ -72,11 +73,13 @@ static int secretmem_memcg_charge(struct page *page, gfp_t gfp, int order)
 		p->memcg_data = page->memcg_data;
 	}
 
+#endif
 	return 0;
 }
 
 static void secretmem_memcg_uncharge(struct page *page, int order)
 {
+#ifdef CONFIG_MEMCG
 	unsigned long nr_pages = (1 << order);
 	int i;
 
@@ -87,6 +90,7 @@ static void secretmem_memcg_uncharge(struct page *page, int order)
 	}
 
 	memcg_kmem_uncharge_page(page, PMD_PAGE_ORDER);
+#endif
 }
 
 static int secretmem_pool_increase(struct secretmem_ctx *ctx, gfp_t gfp)
-- 
2.29.2

-- 
Cheers,
Stephen Rothwell

Content of type "application/pgp-signature" skipped

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ