Displaying 20 results from an estimated 118 matches for "use_mm".
2009 Aug 27
1
[PATCHv5 1/3] mm: export use_mm/unuse_mm to modules
vhost net module wants to do copy to/from user from a kernel thread,
which needs use_mm (like what fs/aio has). Move that into mm/ and
export to modules.
Acked-by: Andrew Morton <akpm at linux-foundation.org>
Acked-by: Andrea Arcangeli <aarcange at redhat.com>
Signed-off-by: Michael S. Tsirkin <mst at redhat.com>
---
fs/aio.c | 47 +-----------...
2009 Aug 27
1
[PATCHv5 1/3] mm: export use_mm/unuse_mm to modules
vhost net module wants to do copy to/from user from a kernel thread,
which needs use_mm (like what fs/aio has). Move that into mm/ and
export to modules.
Acked-by: Andrew Morton <akpm at linux-foundation.org>
Acked-by: Andrea Arcangeli <aarcange at redhat.com>
Signed-off-by: Michael S. Tsirkin <mst at redhat.com>
---
fs/aio.c | 47 +-----------...
2020 Apr 16
0
[PATCH 2/3] kernel: better document the use_mm/unuse_mm API contract
Switch the function documentation to kerneldoc comments, and add
WARN_ON_ONCE asserts that the calling thread is a kernel thread and
does not have ->mm set (or has ->mm set in the case of unuse_mm).
Also give the functions a kthread_ prefix to better document the
use case.
Signed-off-by: Christoph Hellwig <hch at lst.de>
Acked-by: Felix Kuehling <Felix.Kuehling at amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h | 4 +--
drivers/gpu/drm/i915/gvt/kvmgt.c | 4...
2020 Apr 04
0
[PATCH 5/6] kernel: better document the use_mm/unuse_mm API contract
Switch the function documentation to kerneldoc comments, and add
WARN_ON_ONCE asserts that the calling thread is a kernel thread and
does not have ->mm set (or has ->mm set in the case of unuse_mm).
Also give the functions a kthread_ prefix to better document the
use case.
Signed-off-by: Christoph Hellwig <hch at lst.de>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h | 4 +--
drivers/gpu/drm/i915/gvt/kvmgt.c | 4 +--
drivers/usb/gadget/function/f_fs.c | 4 +--
d...
2009 Aug 11
1
[PATCHv2 1/2] mm: export use_mm/unuse_mm to modules
vhost net module wants to do copy to/from user from a kernel thread,
which needs use_mm (like what fs/aio has). Move that into mm/ and
export to modules.
Signed-off-by: Michael S. Tsirkin <mst at redhat.com>
---
fs/aio.c | 47 +----------------------------------
include/linux/mmu_context.h | 9 ++++++
mm/Makefile | 2 +-
mm/mmu_conte...
2009 Aug 11
1
[PATCHv2 1/2] mm: export use_mm/unuse_mm to modules
vhost net module wants to do copy to/from user from a kernel thread,
which needs use_mm (like what fs/aio has). Move that into mm/ and
export to modules.
Signed-off-by: Michael S. Tsirkin <mst at redhat.com>
---
fs/aio.c | 47 +----------------------------------
include/linux/mmu_context.h | 9 ++++++
mm/Makefile | 2 +-
mm/mmu_conte...
2009 Aug 13
0
[PATCHv3 1/2] mm: export use_mm/unuse_mm to modules
vhost net module wants to do copy to/from user from a kernel thread,
which needs use_mm (like what fs/aio has). Move that into mm/ and
export to modules.
Acked-by: Andrew Morton <akpm at linux-foundation.org>
Signed-off-by: Michael S. Tsirkin <mst at redhat.com>
---
fs/aio.c | 47 +----------------------------------
include/linux/mmu_context.h |...
2009 Aug 13
0
[PATCHv3 1/2] mm: export use_mm/unuse_mm to modules
vhost net module wants to do copy to/from user from a kernel thread,
which needs use_mm (like what fs/aio has). Move that into mm/ and
export to modules.
Acked-by: Andrew Morton <akpm at linux-foundation.org>
Signed-off-by: Michael S. Tsirkin <mst at redhat.com>
---
fs/aio.c | 47 +----------------------------------
include/linux/mmu_context.h |...
2009 Aug 19
0
[PATCHv4 1/2] mm: export use_mm/unuse_mm to modules
vhost net module wants to do copy to/from user from a kernel thread,
which needs use_mm (like what fs/aio has). Move that into mm/ and
export to modules.
Acked-by: Andrew Morton <akpm at linux-foundation.org>
Acked-by: Andrea Arcangeli <aarcange at redhat.com>
Signed-off-by: Michael S. Tsirkin <mst at redhat.com>
---
fs/aio.c | 47 +----------...
2009 Aug 19
0
[PATCHv4 1/2] mm: export use_mm/unuse_mm to modules
vhost net module wants to do copy to/from user from a kernel thread,
which needs use_mm (like what fs/aio has). Move that into mm/ and
export to modules.
Acked-by: Andrew Morton <akpm at linux-foundation.org>
Acked-by: Andrea Arcangeli <aarcange at redhat.com>
Signed-off-by: Michael S. Tsirkin <mst at redhat.com>
---
fs/aio.c | 47 +----------...
2009 Sep 17
0
[PATCHv3 1/2] mm: move use_mm/unuse_mm from aio.c to mm/
Anyone who wants to do copy to/from user from a kernel thread, needs
use_mm (like what fs/aio has). Move that into mm/, to make reusing and
exporting easier down the line, and make aio use it. Next intended
user, besides aio, will be vhost-net.
Acked-by: Andrea Arcangeli <aarcange at redhat.com>
Signed-off-by: Michael S. Tsirkin <mst at redhat.com>
---
fs/a...
2009 Sep 17
0
[PATCHv3 1/2] mm: move use_mm/unuse_mm from aio.c to mm/
Anyone who wants to do copy to/from user from a kernel thread, needs
use_mm (like what fs/aio has). Move that into mm/, to make reusing and
exporting easier down the line, and make aio use it. Next intended
user, besides aio, will be vhost-net.
Acked-by: Andrea Arcangeli <aarcange at redhat.com>
Signed-off-by: Michael S. Tsirkin <mst at redhat.com>
---
fs/a...
2020 Apr 16
8
improve use_mm / unuse_mm v2
Hi all,
this series improves the use_mm / unuse_mm interface by better
documenting the assumptions, and my taking the set_fs manipulations
spread over the callers into the core API.
Changes since v1:
- drop a few patches
- fix a comment typo
- cover the newly merged use_mm/unuse_mm caller in vfio
2020 Apr 16
8
improve use_mm / unuse_mm v2
Hi all,
this series improves the use_mm / unuse_mm interface by better
documenting the assumptions, and my taking the set_fs manipulations
spread over the callers into the core API.
Changes since v1:
- drop a few patches
- fix a comment typo
- cover the newly merged use_mm/unuse_mm caller in vfio
2020 Apr 04
14
improve use_mm / unuse_mm
Hi all,
this series improves the use_mm / unuse_mm interface by better
documenting the assumptions, and my taking the set_fs manipulations
spread over the callers into the core API.
2020 Apr 04
14
improve use_mm / unuse_mm
Hi all,
this series improves the use_mm / unuse_mm interface by better
documenting the assumptions, and my taking the set_fs manipulations
spread over the callers into the core API.
2018 Nov 02
1
[PULL] vhost: cleanups and fixes
On Fri, Nov 2, 2018 at 10:10 AM Linus Torvalds
<torvalds at linux-foundation.org> wrote:
>
> Don't you take over the VM with "use_mm()" when you do the copies? So
> yes, it's a kernel thread, but it has a user VM, and though that
> should have the user limits.
Oooh. *Just* as I sent this, I realized that "use_mm()" doesn't update
the thread addr_limit.
That actually looks like a bug to me - althoug...
2020 Apr 04
0
[PATCH 4/6] kernel: move use_mm/unuse_mm to kthread.c
...;
+struct mm_struct;
+
__printf(4, 5)
struct task_struct *kthread_create_on_node(int (*threadfn)(void *data),
void *data,
@@ -198,6 +200,9 @@ bool kthread_cancel_delayed_work_sync(struct kthread_delayed_work *work);
void kthread_destroy_worker(struct kthread_worker *worker);
+void use_mm(struct mm_struct *mm);
+void unuse_mm(struct mm_struct *mm);
+
struct cgroup_subsys_state;
#ifdef CONFIG_BLK_CGROUP
diff --git a/include/linux/mmu_context.h b/include/linux/mmu_context.h
index d9a543a9e1cc..c51a84132d7c 100644
--- a/include/linux/mmu_context.h
+++ b/include/linux/mmu_context.h...
2009 Aug 27
0
[PATCHv5 2/3] mm: reduce atomic use on use_mm fast path
...Signed-off-by: Michael S. Tsirkin <mst at redhat.com>
---
mm/mmu_context.c | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/mm/mmu_context.c b/mm/mmu_context.c
index 9989c2f..0777654 100644
--- a/mm/mmu_context.c
+++ b/mm/mmu_context.c
@@ -27,13 +27,16 @@ void use_mm(struct mm_struct *mm)
task_lock(tsk);
active_mm = tsk->active_mm;
- atomic_inc(&mm->mm_count);
+ if (active_mm != mm) {
+ atomic_inc(&mm->mm_count);
+ tsk->active_mm = mm;
+ }
tsk->mm = mm;
- tsk->active_mm = mm;
switch_mm(active_mm, mm, tsk);
task_unlock(tsk...
2009 Dec 20
1
[PATCH 0/3] vhost: fix use_mm usage
This patchset fixes an issue, pointed out by Al Viro, in how vhost net
calls use_mm, Works fine for me, and it's pretty straightforward. If no
one sees any issues with it, this will be a good candidate for 2.6.33
(assuming vhost net itself gets pulled :( ).
Michael S. Tsirkin (3):
vhost: prevent modification of an active ring
vhost: add access_ok checks
vhost: make de...