linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] watch_queue: make locked_vm accessible
@ 2019-09-06 15:32 Arnd Bergmann
  2019-09-06 15:32 ` [PATCH 2/2] [don't apply] watch_queue: disable sample Arnd Bergmann
  2019-09-06 15:39 ` [PATCH 1/2] watch_queue: make locked_vm accessible Jens Axboe
  0 siblings, 2 replies; 3+ messages in thread
From: Arnd Bergmann @ 2019-09-06 15:32 UTC (permalink / raw)
  To: David Howells; +Cc: Arnd Bergmann, Jann Horn, Jens Axboe, linux-kernel

The locked_vm member of struct user_struct is guarded by an #ifdef,
which breaks building the new watch_queue driver when all the other
subsystems that need it are disabled:

drivers/misc/watch_queue.c:315:38: error: no member named 'locked_vm' in 'struct user_struct'; did you mean 'locked_shm'?

Add watch_queue to the list.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 include/linux/sched/user.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/sched/user.h b/include/linux/sched/user.h
index 917d88edb7b9..6cd21c7bb83e 100644
--- a/include/linux/sched/user.h
+++ b/include/linux/sched/user.h
@@ -33,7 +33,7 @@ struct user_struct {
 	kuid_t uid;
 
 #if defined(CONFIG_PERF_EVENTS) || defined(CONFIG_BPF_SYSCALL) || \
-    defined(CONFIG_NET) || defined(CONFIG_IO_URING)
+    defined(CONFIG_NET) || defined(CONFIG_IO_URING) || defined(CONFIG_WATCH_QUEUE)
 	atomic_long_t locked_vm;
 #endif
 
-- 
2.20.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] [don't apply] watch_queue: disable sample
  2019-09-06 15:32 [PATCH 1/2] watch_queue: make locked_vm accessible Arnd Bergmann
@ 2019-09-06 15:32 ` Arnd Bergmann
  2019-09-06 15:39 ` [PATCH 1/2] watch_queue: make locked_vm accessible Jens Axboe
  1 sibling, 0 replies; 3+ messages in thread
From: Arnd Bergmann @ 2019-09-06 15:32 UTC (permalink / raw)
  To: David Howells; +Cc: Arnd Bergmann, Masahiro Yamada, linux-kernel

Building in a separate object directory causes a compilation
failure for a missing header:

samples/watch_queue/watch_test.c:23:10: fatal error: linux/watch_queue.h: No such file or directory

I could not figure out why this does not work and applied this
patch locally. It would be good to fix this properly for 5.4
instead.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 samples/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/samples/Makefile b/samples/Makefile
index a61a39047d02..068b28113be9 100644
--- a/samples/Makefile
+++ b/samples/Makefile
@@ -20,4 +20,4 @@ obj-$(CONFIG_SAMPLE_TRACE_PRINTK)	+= trace_printk/
 obj-$(CONFIG_VIDEO_PCI_SKELETON)	+= v4l/
 obj-y					+= vfio-mdev/
 subdir-$(CONFIG_SAMPLE_VFS)		+= vfs
-subdir-$(CONFIG_SAMPLE_WATCH_QUEUE)	+= watch_queue
+#subdir-$(CONFIG_SAMPLE_WATCH_QUEUE)	+= watch_queue
-- 
2.20.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/2] watch_queue: make locked_vm accessible
  2019-09-06 15:32 [PATCH 1/2] watch_queue: make locked_vm accessible Arnd Bergmann
  2019-09-06 15:32 ` [PATCH 2/2] [don't apply] watch_queue: disable sample Arnd Bergmann
@ 2019-09-06 15:39 ` Jens Axboe
  1 sibling, 0 replies; 3+ messages in thread
From: Jens Axboe @ 2019-09-06 15:39 UTC (permalink / raw)
  To: Arnd Bergmann, David Howells; +Cc: Jann Horn, linux-kernel

On 9/6/19 9:32 AM, Arnd Bergmann wrote:
> The locked_vm member of struct user_struct is guarded by an #ifdef,
> which breaks building the new watch_queue driver when all the other
> subsystems that need it are disabled:
> 
> drivers/misc/watch_queue.c:315:38: error: no member named 'locked_vm' in 'struct user_struct'; did you mean 'locked_shm'?
> 
> Add watch_queue to the list.

Should we either:

1) Make it unconditionally available

or

2) Introduce a symbol for this that others can select, like
   CONFIG_NEEDS_USER_LOCKED_VM or something like that.

?

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-09-06 15:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-06 15:32 [PATCH 1/2] watch_queue: make locked_vm accessible Arnd Bergmann
2019-09-06 15:32 ` [PATCH 2/2] [don't apply] watch_queue: disable sample Arnd Bergmann
2019-09-06 15:39 ` [PATCH 1/2] watch_queue: make locked_vm accessible Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).