All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Yan Zhao <yan.y.zhao@intel.com>
Cc: Jens Axboe <axboe@kernel.dk>, Felipe Balbi <balbi@kernel.org>,
	Alex Deucher <alexander.deucher@amd.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Jason Wang <jasowang@redhat.com>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	amd-gfx@lists.freedesktop.org, io-uring@vger.kernel.org,
	linux-mm@kvack.org, Zhenyu Wang <zhenyuw@linux.intel.com>,
	intel-gfx@lists.freedesktop.org, linux-fsdevel@vger.kernel.org,
	Felix Kuehling <Felix.Kuehling@amd.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	virtualization@lists.linux-foundation.org,
	intel-gvt-dev@lists.freedesktop.org,
	Christoph Hellwig <hch@lst.de>, Zhi Wang <zhi.a.wang@intel.com>,
	Al Viro <viro@zeniv.linux.org.uk>
Subject: Re: [PATCH 2/6] i915/gvt/kvm: a NULL ->mm does not mean a thread is a kthread
Date: Tue, 14 Apr 2020 09:00:13 +0200	[thread overview]
Message-ID: <20200414070013.GA23680@lst.de> (raw)
In-Reply-To: <20200414000410.GE10586@joy-OptiPlex-7040>

On Mon, Apr 13, 2020 at 08:04:10PM -0400, Yan Zhao wrote:
> > I can't think of another way for a kernel thread to have a mm indeed.
> for example, before calling to vfio_dma_rw(), a kernel thread has already
> called use_mm(), then its current->mm is not null, and it has flag
> PF_KTHREAD.
> in this case, we just want to allow the copy_to_user() directly if
> current->mm == mm, rather than call another use_mm() again.
> 
> do you think it makes sense?

I mean no other way than using use_mm.  That being said nesting
potentional use_mm callers sounds like a rather bad idea, and we
should avoid that.
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

WARNING: multiple messages have this Message-ID (diff)
From: Christoph Hellwig <hch@lst.de>
To: Yan Zhao <yan.y.zhao@intel.com>
Cc: Christoph Hellwig <hch@lst.de>, Jens Axboe <axboe@kernel.dk>,
	Felipe Balbi <balbi@kernel.org>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	Jason Wang <jasowang@redhat.com>,
	intel-gvt-dev@lists.freedesktop.org,
	Felix Kuehling <Felix.Kuehling@amd.com>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	amd-gfx@lists.freedesktop.org, io-uring@vger.kernel.org,
	linux-mm@kvack.org, Zhenyu Wang <zhenyuw@linux.intel.com>,
	intel-gfx@lists.freedesktop.org, linux-fsdevel@vger.kernel.org,
	Alex Deucher <alexander.deucher@amd.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	virtualization@lists.linux-foundation.org,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Zhi Wang <zhi.a.wang@intel.com>,
	Al Viro <viro@zeniv.linux.org.uk>
Subject: Re: [PATCH 2/6] i915/gvt/kvm: a NULL ->mm does not mean a thread is a kthread
Date: Tue, 14 Apr 2020 09:00:13 +0200	[thread overview]
Message-ID: <20200414070013.GA23680@lst.de> (raw)
In-Reply-To: <20200414000410.GE10586@joy-OptiPlex-7040>

On Mon, Apr 13, 2020 at 08:04:10PM -0400, Yan Zhao wrote:
> > I can't think of another way for a kernel thread to have a mm indeed.
> for example, before calling to vfio_dma_rw(), a kernel thread has already
> called use_mm(), then its current->mm is not null, and it has flag
> PF_KTHREAD.
> in this case, we just want to allow the copy_to_user() directly if
> current->mm == mm, rather than call another use_mm() again.
> 
> do you think it makes sense?

I mean no other way than using use_mm.  That being said nesting
potentional use_mm callers sounds like a rather bad idea, and we
should avoid that.

WARNING: multiple messages have this Message-ID (diff)
From: Christoph Hellwig <hch@lst.de>
To: Yan Zhao <yan.y.zhao@intel.com>
Cc: Jens Axboe <axboe@kernel.dk>, Felipe Balbi <balbi@kernel.org>,
	Alex Deucher <alexander.deucher@amd.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Jason Wang <jasowang@redhat.com>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	amd-gfx@lists.freedesktop.org, io-uring@vger.kernel.org,
	linux-mm@kvack.org, intel-gfx@lists.freedesktop.org,
	linux-fsdevel@vger.kernel.org,
	Felix Kuehling <Felix.Kuehling@amd.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	virtualization@lists.linux-foundation.org,
	intel-gvt-dev@lists.freedesktop.org,
	Christoph Hellwig <hch@lst.de>, Al Viro <viro@zeniv.linux.org.uk>
Subject: Re: [PATCH 2/6] i915/gvt/kvm: a NULL ->mm does not mean a thread is a kthread
Date: Tue, 14 Apr 2020 09:00:13 +0200	[thread overview]
Message-ID: <20200414070013.GA23680@lst.de> (raw)
In-Reply-To: <20200414000410.GE10586@joy-OptiPlex-7040>

On Mon, Apr 13, 2020 at 08:04:10PM -0400, Yan Zhao wrote:
> > I can't think of another way for a kernel thread to have a mm indeed.
> for example, before calling to vfio_dma_rw(), a kernel thread has already
> called use_mm(), then its current->mm is not null, and it has flag
> PF_KTHREAD.
> in this case, we just want to allow the copy_to_user() directly if
> current->mm == mm, rather than call another use_mm() again.
> 
> do you think it makes sense?

I mean no other way than using use_mm.  That being said nesting
potentional use_mm callers sounds like a rather bad idea, and we
should avoid that.

WARNING: multiple messages have this Message-ID (diff)
From: Christoph Hellwig <hch@lst.de>
To: Yan Zhao <yan.y.zhao@intel.com>
Cc: Jens Axboe <axboe@kernel.dk>, Felipe Balbi <balbi@kernel.org>,
	Alex Deucher <alexander.deucher@amd.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Jason Wang <jasowang@redhat.com>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	amd-gfx@lists.freedesktop.org, io-uring@vger.kernel.org,
	linux-mm@kvack.org, intel-gfx@lists.freedesktop.org,
	linux-fsdevel@vger.kernel.org,
	Felix Kuehling <Felix.Kuehling@amd.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	virtualization@lists.linux-foundation.org,
	intel-gvt-dev@lists.freedesktop.org,
	Christoph Hellwig <hch@lst.de>, Al Viro <viro@zeniv.linux.org.uk>
Subject: Re: [Intel-gfx] [PATCH 2/6] i915/gvt/kvm: a NULL ->mm does not mean a thread is a kthread
Date: Tue, 14 Apr 2020 09:00:13 +0200	[thread overview]
Message-ID: <20200414070013.GA23680@lst.de> (raw)
In-Reply-To: <20200414000410.GE10586@joy-OptiPlex-7040>

On Mon, Apr 13, 2020 at 08:04:10PM -0400, Yan Zhao wrote:
> > I can't think of another way for a kernel thread to have a mm indeed.
> for example, before calling to vfio_dma_rw(), a kernel thread has already
> called use_mm(), then its current->mm is not null, and it has flag
> PF_KTHREAD.
> in this case, we just want to allow the copy_to_user() directly if
> current->mm == mm, rather than call another use_mm() again.
> 
> do you think it makes sense?

I mean no other way than using use_mm.  That being said nesting
potentional use_mm callers sounds like a rather bad idea, and we
should avoid that.
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2020-04-14  7:06 UTC|newest]

Thread overview: 75+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-04  9:40 improve use_mm / unuse_mm Christoph Hellwig
2020-04-04  9:40 ` [Intel-gfx] " Christoph Hellwig
2020-04-04  9:40 ` Christoph Hellwig
2020-04-04  9:40 ` [PATCH 1/6] amdgpu: a NULL ->mm does not mean a thread is a kthread Christoph Hellwig
2020-04-04  9:40   ` [Intel-gfx] " Christoph Hellwig
2020-04-04  9:40   ` Christoph Hellwig
2020-04-04  9:40   ` Christoph Hellwig
2020-04-06 16:07   ` Felix Kuehling
2020-04-06 16:07     ` [Intel-gfx] " Felix Kuehling
2020-04-06 16:07     ` Felix Kuehling
2020-04-06 16:07     ` Felix Kuehling
2020-04-04  9:40 ` [PATCH 2/6] i915/gvt/kvm: " Christoph Hellwig
2020-04-04  9:40   ` [Intel-gfx] " Christoph Hellwig
2020-04-04  9:40   ` Christoph Hellwig
2020-04-04 10:05   ` Sergei Shtylyov
2020-04-04 10:05     ` [Intel-gfx] " Sergei Shtylyov
2020-04-04 10:05     ` Sergei Shtylyov
2020-04-07  3:08   ` Yan Zhao
2020-04-07  3:08     ` [Intel-gfx] " Yan Zhao
2020-04-07  3:08     ` Yan Zhao
2020-04-13 13:27     ` Christoph Hellwig
2020-04-13 13:27       ` [Intel-gfx] " Christoph Hellwig
2020-04-13 13:27       ` Christoph Hellwig
2020-04-14  0:04       ` Yan Zhao
2020-04-14  0:04         ` [Intel-gfx] " Yan Zhao
2020-04-14  0:04         ` Yan Zhao
2020-04-14  7:00         ` Christoph Hellwig [this message]
2020-04-14  7:00           ` [Intel-gfx] " Christoph Hellwig
2020-04-14  7:00           ` Christoph Hellwig
2020-04-14  7:00           ` Christoph Hellwig
2020-04-14  7:03           ` Yan Zhao
2020-04-14  7:03             ` [Intel-gfx] " Yan Zhao
2020-04-14  7:03             ` Yan Zhao
2020-04-04  9:40 ` [PATCH 3/6] i915/gvt: remove unused xen bits Christoph Hellwig
2020-04-04  9:40   ` [Intel-gfx] " Christoph Hellwig
2020-04-04  9:40   ` Christoph Hellwig
2020-04-04  9:40   ` Christoph Hellwig
2020-04-08  1:44   ` Zhenyu Wang
2020-04-08  1:44     ` [Intel-gfx] " Zhenyu Wang
2020-04-08  1:44     ` Zhenyu Wang
2020-04-08  1:44     ` Zhenyu Wang
2020-04-13 13:08     ` Christoph Hellwig
2020-04-13 13:08       ` [Intel-gfx] " Christoph Hellwig
2020-04-13 13:08       ` Christoph Hellwig
2020-04-14  3:04       ` Zhenyu Wang
2020-04-14  3:04         ` [Intel-gfx] " Zhenyu Wang
2020-04-14  3:04         ` Zhenyu Wang
2020-04-14  3:04         ` Zhenyu Wang
2020-04-04  9:40 ` [PATCH 4/6] kernel: move use_mm/unuse_mm to kthread.c Christoph Hellwig
2020-04-04  9:40   ` [Intel-gfx] " Christoph Hellwig
2020-04-04  9:40   ` Christoph Hellwig
2020-04-04  9:40   ` Christoph Hellwig
2020-04-06 16:09   ` Felix Kuehling
2020-04-06 16:09     ` [Intel-gfx] " Felix Kuehling
2020-04-06 16:09     ` Felix Kuehling
2020-04-06 16:09     ` Felix Kuehling
2020-04-04  9:41 ` [PATCH 5/6] kernel: better document the use_mm/unuse_mm API contract Christoph Hellwig
2020-04-04  9:41   ` [Intel-gfx] " Christoph Hellwig
2020-04-04  9:41   ` Christoph Hellwig
2020-04-04 13:07   ` [Intel-gfx] " Pavel Begunkov
2020-04-04 13:07     ` Pavel Begunkov
2020-04-04 13:07     ` Pavel Begunkov
2020-04-04 13:07     ` [Intel-gfx] " Pavel Begunkov
2020-04-06 16:10   ` Felix Kuehling
2020-04-06 16:10     ` [Intel-gfx] " Felix Kuehling
2020-04-06 16:10     ` Felix Kuehling
2020-04-06 16:10     ` Felix Kuehling
2020-04-04  9:41 ` [PATCH 6/6] kernel: set USER_DS in kthread_use_mm Christoph Hellwig
2020-04-04  9:41   ` [Intel-gfx] " Christoph Hellwig
2020-04-04  9:41   ` Christoph Hellwig
2020-04-04  9:41   ` Christoph Hellwig
2020-04-06 21:49   ` Michael S. Tsirkin
2020-04-06 21:49     ` [Intel-gfx] " Michael S. Tsirkin
2020-04-06 21:49     ` Michael S. Tsirkin
2020-04-04  9:52 ` [Intel-gfx] ✗ Fi.CI.BUILD: failure for series starting with [1/6] amdgpu: a NULL ->mm does not mean a thread is a kthread Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200414070013.GA23680@lst.de \
    --to=hch@lst.de \
    --cc=Felix.Kuehling@amd.com \
    --cc=akpm@linux-foundation.org \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=axboe@kernel.dk \
    --cc=balbi@kernel.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-gvt-dev@lists.freedesktop.org \
    --cc=io-uring@vger.kernel.org \
    --cc=jasowang@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=torvalds@linux-foundation.org \
    --cc=viro@zeniv.linux.org.uk \
    --cc=virtualization@lists.linux-foundation.org \
    --cc=yan.y.zhao@intel.com \
    --cc=zhenyuw@linux.intel.com \
    --cc=zhi.a.wang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.