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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120626152734.GA6509@breakpoint.cc>
Date:	Tue, 26 Jun 2012 17:27:34 +0200
From:	Sebastian Andrzej Siewior <sebastian@...akpoint.cc>
To:	Mel Gorman <mgorman@...e.de>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	Linux-MM <linux-mm@...ck.org>,
	Linux-Netdev <netdev@...r.kernel.org>,
	LKML <linux-kernel@...r.kernel.org>,
	David Miller <davem@...emloft.net>, Neil Brown <neilb@...e.de>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Mike Christie <michaelc@...wisc.edu>,
	Eric B Munson <emunson@...bm.net>,
	Eric Dumazet <eric.dumazet@...il.com>
Subject: Re: [PATCH 09/16] netvm: Allow skb allocation to use PFMEMALLOC
 reserves

On Fri, Jun 22, 2012 at 03:30:36PM +0100, Mel Gorman wrote:
> diff --git a/net/core/sock.c b/net/core/sock.c
> index 5c9ca2b..159dccc 100644
> --- a/net/core/sock.c
> +++ b/net/core/sock.c
> @@ -271,6 +271,9 @@ __u32 sysctl_rmem_default __read_mostly = SK_RMEM_MAX;
>  int sysctl_optmem_max __read_mostly = sizeof(unsigned long)*(2*UIO_MAXIOV+512);
>  EXPORT_SYMBOL(sysctl_optmem_max);
>  
> +struct static_key memalloc_socks = STATIC_KEY_INIT_FALSE;
> +EXPORT_SYMBOL_GPL(memalloc_socks);
> +

This is used via sk_memalloc_socks() by SLAB.

>From 3da9ab9972845974da114c5a6624335e6371b2d5 Mon Sep 17 00:00:00 2001
From: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
Date: Tue, 26 Jun 2012 17:18:20 +0200
Subject: [PATCH] export sk_memalloc_socks() only with CONFIG_NET

|mm/built-in.o: In function `atomic_read':
|include/asm/atomic.h:25: undefined reference to `memalloc_socks'
|include/asm/atomic.h:25: undefined reference to `memalloc_socks'
|include/asm/atomic.h:25: undefined reference to `memalloc_socks'
|include/asm/atomic.h:25: undefined reference to `memalloc_socks'
|include/asm/atomic.h:25: undefined reference to `memalloc_socks'
|mm/built-in.o:include/asm/atomic.h:25: more undefined references to `memalloc_socks' follow

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
---
 include/net/sock.h |    9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/include/net/sock.h b/include/net/sock.h
index db0c20c..767c443 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -659,11 +659,20 @@ static inline bool sock_flag(const struct sock *sk, enum sock_flags flag)
 	return test_bit(flag, &sk->sk_flags);
 }
 
+#ifdef CONFIG_NET
 extern struct static_key memalloc_socks;
 static inline int sk_memalloc_socks(void)
 {
 	return static_key_false(&memalloc_socks);
 }
+#else
+
+static inline int sk_memalloc_socks(void)
+{
+	return 0;
+}
+
+#endif
 
 static inline gfp_t sk_gfp_atomic(struct sock *sk, gfp_t gfp_mask)
 {
-- 
1.7.10

Sebastian
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ