From: Mike Christie <mchristi@redhat.com>
To: Bart Van Assche <bvanassche@acm.org>,
Damien Le Moal <damien.lemoal@wdc.com>,
linux-scsi@vger.kernel.org,
"Martin K . Petersen" <martin.petersen@oracle.com>,
target-devel@vger.kernel.org
Subject: Re: [PATCH v2] target: core: Prevent memory reclaim recursion
Date: Fri, 8 Nov 2019 10:34:16 -0600 [thread overview]
Message-ID: <5DC59908.5010600@redhat.com> (raw)
In-Reply-To: <cefdcca4-e839-829e-54aa-b95e77825d1d@acm.org>
On 11/08/2019 10:22 AM, Bart Van Assche wrote:
> On 11/8/19 12:29 AM, Damien Le Moal wrote:
>> Prevent recursion into the IO path under low memory conditions by using
>> GFP_NOIO in place of GFP_KERNEL when allocating a new command with
>> tcmu_alloc_cmd() and user ring space with tcmu_get_empty_block().
>>
>> Reported-by: Masato Suzuki <masato.suzuki@wdc.com>
>> Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
>> ---
>>
>> Changes from v1:
>> * Added reported-by tag
>>
>> drivers/target/target_core_user.c | 6 +++---
>> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> The patch subject is weird. Shouldn't the patch subject start with
> "tcmu" instead of "target: core"?
>
> Has the recursion mentioned in the patch description been observed or is
> this a theoretical issue? I'm asking this because GFP_NOIO only prevents
Observed.
> recursion if it is used inside a block driver or filesystem. The tcmu
> driver is neither - it submits block I/O or filesystem I/O instead of
> implementing a block driver or filesystem. Should we really disallow
> tcmu to use the swap subsystem?
A common use is tcm loop on the frontend and tcmu on the backend. You
see this with virt and containers, where some app is used to interacting
SCSI devices, but then the storage is backed by something that people
didn't want to put in the kernel. It's similar to nbd when you use
AF_UNIX sockets with a local running daemon.
WARNING: multiple messages have this Message-ID (diff)
From: Mike Christie <mchristi@redhat.com>
To: Bart Van Assche <bvanassche@acm.org>,
Damien Le Moal <damien.lemoal@wdc.com>,
linux-scsi@vger.kernel.org,
"Martin K . Petersen" <martin.petersen@oracle.com>,
target-devel@vger.kernel.org
Subject: Re: [PATCH v2] target: core: Prevent memory reclaim recursion
Date: Fri, 08 Nov 2019 16:34:16 +0000 [thread overview]
Message-ID: <5DC59908.5010600@redhat.com> (raw)
In-Reply-To: <cefdcca4-e839-829e-54aa-b95e77825d1d@acm.org>
On 11/08/2019 10:22 AM, Bart Van Assche wrote:
> On 11/8/19 12:29 AM, Damien Le Moal wrote:
>> Prevent recursion into the IO path under low memory conditions by using
>> GFP_NOIO in place of GFP_KERNEL when allocating a new command with
>> tcmu_alloc_cmd() and user ring space with tcmu_get_empty_block().
>>
>> Reported-by: Masato Suzuki <masato.suzuki@wdc.com>
>> Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
>> ---
>>
>> Changes from v1:
>> * Added reported-by tag
>>
>> drivers/target/target_core_user.c | 6 +++---
>> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> The patch subject is weird. Shouldn't the patch subject start with
> "tcmu" instead of "target: core"?
>
> Has the recursion mentioned in the patch description been observed or is
> this a theoretical issue? I'm asking this because GFP_NOIO only prevents
Observed.
> recursion if it is used inside a block driver or filesystem. The tcmu
> driver is neither - it submits block I/O or filesystem I/O instead of
> implementing a block driver or filesystem. Should we really disallow
> tcmu to use the swap subsystem?
A common use is tcm loop on the frontend and tcmu on the backend. You
see this with virt and containers, where some app is used to interacting
SCSI devices, but then the storage is backed by something that people
didn't want to put in the kernel. It's similar to nbd when you use
AF_UNIX sockets with a local running daemon.
next prev parent reply other threads:[~2019-11-08 16:34 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-08 8:29 [PATCH v2] target: core: Prevent memory reclaim recursion Damien Le Moal
2019-11-08 8:29 ` Damien Le Moal
2019-11-08 15:19 ` Mike Christie
2019-11-08 15:19 ` Mike Christie
2019-11-08 16:22 ` Bart Van Assche
2019-11-08 16:22 ` Bart Van Assche
2019-11-08 16:34 ` Mike Christie [this message]
2019-11-08 16:34 ` Mike Christie
2019-11-09 2:18 ` Damien Le Moal
2019-11-09 2:18 ` Damien Le Moal
2019-11-09 2:38 ` Martin K. Petersen
2019-11-09 2:38 ` Martin K. Petersen
2019-11-08 17:02 ` Bart Van Assche
2019-11-08 17:02 ` Bart Van Assche
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=5DC59908.5010600@redhat.com \
--to=mchristi@redhat.com \
--cc=bvanassche@acm.org \
--cc=damien.lemoal@wdc.com \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=target-devel@vger.kernel.org \
/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.