From: "Kirill A. Shutemov" <kirill@shutemov.name>
To: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Cc: Mike Christie <mchristi@redhat.com>,
axboe@kernel.dk, James.Bottomley@HansenPartnership.com,
martin.petersen@oracle.com, linux-kernel@vger.kernel.org,
linux-scsi@vger.kernel.org, linux-block@vger.kernel.org,
Linux-MM <linux-mm@kvack.org>
Subject: Re: [RFC PATCH] Add proc interface to set PF_MEMALLOC flags
Date: Wed, 11 Sep 2019 02:28:08 +0300 [thread overview]
Message-ID: <20190910232808.zqlvgnuym6emvdyf@box.shutemov.name> (raw)
In-Reply-To: <ee39d997-ee07-22c7-3e59-a436cef4d587@I-love.SAKURA.ne.jp>
On Wed, Sep 11, 2019 at 07:12:06AM +0900, Tetsuo Handa wrote:
> >> +static ssize_t memalloc_write(struct file *file, const char __user *buf,
> >> + size_t count, loff_t *ppos)
> >> +{
> >> + struct task_struct *task;
> >> + char buffer[5];
> >> + int rc = count;
> >> +
> >> + memset(buffer, 0, sizeof(buffer));
> >> + if (count != sizeof(buffer) - 1)
> >> + return -EINVAL;
> >> +
> >> + if (copy_from_user(buffer, buf, count))
>
> copy_from_user() / copy_to_user() might involve memory allocation
> via page fault which has to be done under the mask? Moreover, since
> just open()ing this file can involve memory allocation, do we forbid
> open("/proc/thread-self/memalloc") ?
Not saying that I'm okay with the approach in general, but I don't think
this a problem. The application has to set allocation policy before
inserting itself into IO or FS path.
--
Kirill A. Shutemov
next prev parent reply other threads:[~2019-09-10 23:28 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20190909162804.5694-1-mchristi@redhat.com>
2019-09-09 18:26 ` [RFC PATCH] Add proc interface to set PF_MEMALLOC flags Mike Christie
2019-09-10 8:35 ` Damien Le Moal
2019-09-11 8:40 ` Martin Raiber
2019-09-11 16:56 ` Mike Christie
2019-09-11 19:21 ` Martin Raiber
2019-09-12 16:22 ` Mike Christie
2019-09-12 16:27 ` Mike Christie
2019-09-11 8:43 ` Martin Raiber
[not found] ` <ee39d997-ee07-22c7-3e59-a436cef4d587@I-love.SAKURA.ne.jp>
2019-09-10 23:28 ` Kirill A. Shutemov [this message]
2019-09-11 15:23 ` Mike Christie
[not found] ` <20190910100000.mcik63ot6o3dyzjv@box.shutemov.name>
2019-09-10 16:06 ` Mike Christie
2019-09-11 3:13 ` Hillf Danton
2019-09-11 13:52 ` Hillf Danton
[not found] ` <c48cd3d8-699d-a614-b12d-1ddef71691f3@I-love.SAKURA.ne.jp>
2019-09-11 15:44 ` Mike Christie
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=20190910232808.zqlvgnuym6emvdyf@box.shutemov.name \
--to=kirill@shutemov.name \
--cc=James.Bottomley@HansenPartnership.com \
--cc=axboe@kernel.dk \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=mchristi@redhat.com \
--cc=penguin-kernel@I-love.SAKURA.ne.jp \
/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 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).