linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mmc: card: don't use PF_MEMALLOC
@ 2016-03-16 11:43 Martin Kepplinger
  2016-03-16 14:41 ` Jens Axboe
  0 siblings, 1 reply; 4+ messages in thread
From: Martin Kepplinger @ 2016-03-16 11:43 UTC (permalink / raw)
  To: ulf.hansson, axboe, chuanxiao.dong, fabf
  Cc: linux-mmc, linux-kernel, Martin Kepplinger

PF_MEMALLOC is assigned to processes by mm. If drivers prevent memory
reclaim and mm is not in control, strange hang-up or OOM Killer invocation
could happen.

Signed-off-by: Martin Kepplinger <martink@posteo.de>
---
I use MMC cards with this change perfectly fine. As I understand it,
even *if* PF_MEMALLOC has a real reason to be here, I think it should
be very well documented.


 drivers/mmc/card/queue.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/mmc/card/queue.c b/drivers/mmc/card/queue.c
index 6f4323c..be71249 100644
--- a/drivers/mmc/card/queue.c
+++ b/drivers/mmc/card/queue.c
@@ -51,8 +51,6 @@ static int mmc_queue_thread(void *d)
 	struct mmc_queue *mq = d;
 	struct request_queue *q = mq->queue;
 
-	current->flags |= PF_MEMALLOC;
-
 	down(&mq->thread_sem);
 	do {
 		struct request *req = NULL;
-- 
2.1.4

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

* Re: [PATCH] mmc: card: don't use PF_MEMALLOC
  2016-03-16 11:43 [PATCH] mmc: card: don't use PF_MEMALLOC Martin Kepplinger
@ 2016-03-16 14:41 ` Jens Axboe
  2016-03-16 15:07   ` Martin Kepplinger
  0 siblings, 1 reply; 4+ messages in thread
From: Jens Axboe @ 2016-03-16 14:41 UTC (permalink / raw)
  To: Martin Kepplinger, ulf.hansson, chuanxiao.dong, fabf
  Cc: linux-mmc, linux-kernel

On 03/16/2016 04:43 AM, Martin Kepplinger wrote:
> PF_MEMALLOC is assigned to processes by mm. If drivers prevent memory
> reclaim and mm is not in control, strange hang-up or OOM Killer invocation
> could happen.
>
> Signed-off-by: Martin Kepplinger <martink@posteo.de>
> ---
> I use MMC cards with this change perfectly fine. As I understand it,
> even *if* PF_MEMALLOC has a real reason to be here, I think it should
> be very well documented.

Did you try swap on mmcblk?

-- 
Jens Axboe

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

* Re: [PATCH] mmc: card: don't use PF_MEMALLOC
  2016-03-16 14:41 ` Jens Axboe
@ 2016-03-16 15:07   ` Martin Kepplinger
  2016-03-16 15:12     ` Jens Axboe
  0 siblings, 1 reply; 4+ messages in thread
From: Martin Kepplinger @ 2016-03-16 15:07 UTC (permalink / raw)
  To: Jens Axboe, ulf.hansson, chuanxiao.dong, fabf; +Cc: linux-mmc, linux-kernel

Am 2016-03-16 um 15:41 schrieb Jens Axboe:
> On 03/16/2016 04:43 AM, Martin Kepplinger wrote:
>> PF_MEMALLOC is assigned to processes by mm. If drivers prevent memory
>> reclaim and mm is not in control, strange hang-up or OOM Killer
>> invocation
>> could happen.
>>
>> Signed-off-by: Martin Kepplinger <martink@posteo.de>
>> ---
>> I use MMC cards with this change perfectly fine. As I understand it,
>> even *if* PF_MEMALLOC has a real reason to be here, I think it should
>> be very well documented.
> 
> Did you try swap on mmcblk?
> 

No I haven't even thought about that :) If you know it can be necessary
in that case, it's obviously fine. A comment would still be good though.

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

* Re: [PATCH] mmc: card: don't use PF_MEMALLOC
  2016-03-16 15:07   ` Martin Kepplinger
@ 2016-03-16 15:12     ` Jens Axboe
  0 siblings, 0 replies; 4+ messages in thread
From: Jens Axboe @ 2016-03-16 15:12 UTC (permalink / raw)
  To: Martin Kepplinger, ulf.hansson, chuanxiao.dong, fabf
  Cc: linux-mmc, linux-kernel

On 03/16/2016 08:07 AM, Martin Kepplinger wrote:
> Am 2016-03-16 um 15:41 schrieb Jens Axboe:
>> On 03/16/2016 04:43 AM, Martin Kepplinger wrote:
>>> PF_MEMALLOC is assigned to processes by mm. If drivers prevent memory
>>> reclaim and mm is not in control, strange hang-up or OOM Killer
>>> invocation
>>> could happen.
>>>
>>> Signed-off-by: Martin Kepplinger <martink@posteo.de>
>>> ---
>>> I use MMC cards with this change perfectly fine. As I understand it,
>>> even *if* PF_MEMALLOC has a real reason to be here, I think it should
>>> be very well documented.
>>
>> Did you try swap on mmcblk?
>>
>
> No I haven't even thought about that :) If you know it can be necessary
> in that case, it's obviously fine. A comment would still be good though.

That's why it is there! So yes, adding a comment to that effect would be 
a better path forward.

-- 
Jens Axboe

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

end of thread, other threads:[~2016-03-16 15:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-16 11:43 [PATCH] mmc: card: don't use PF_MEMALLOC Martin Kepplinger
2016-03-16 14:41 ` Jens Axboe
2016-03-16 15:07   ` Martin Kepplinger
2016-03-16 15:12     ` 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).