From: Will Deacon <will.deacon@arm.com>
To: Michal Hocko <mhocko@kernel.org>
Cc: virtualization@lists.linux-foundation.org,
Michal Hocko <mhocko@suse.com>,
LKML <linux-kernel@vger.kernel.org>,
"Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [PATCH] virtio: Do not drop __GFP_HIGH in alloc_indirect
Date: Tue, 1 Dec 2015 16:17:05 +0000 [thread overview]
Message-ID: <20151201161704.GC27751@arm.com> (raw)
In-Reply-To: <1448980369-27130-1-git-send-email-mhocko@kernel.org>
On Tue, Dec 01, 2015 at 03:32:49PM +0100, Michal Hocko wrote:
> From: Michal Hocko <mhocko@suse.com>
>
> b92b1b89a33c ("virtio: force vring descriptors to be allocated from
> lowmem") tried to exclude highmem pages for descriptors so it cleared
> __GFP_HIGHMEM from a given gfp mask. The patch also cleared __GFP_HIGH
> which doesn't make much sense for this fix because __GFP_HIGH only
> controls access to memory reserves and it doesn't have any influence
> on the zone selection. Some of the call paths use GFP_ATOMIC and
> dropping __GFP_HIGH will reduce their changes for success because the
> lack of access to memory reserves.
>
> Signed-off-by: Michal Hocko <mhocko@suse.com>
> ---
> Hi,
> I have stumbled over this code while looking at other issue [1]. I think
> that using __GFP_HIGH simply got there because of its confusing name. It
> doesn't have anything to do with the highmem zone.
>
> The patch is based on the current linux-next.
>
> I think that clearing __GFP_HIGHMEM is bogus in the current code because
> all code paths either use GFP_KERNEL or GFP_ATOMIC and those do not fall
> back to the highmem zone but I have kept it because clearing the flag
> cannot be harmful.
>
> [1] http://lkml.kernel.org/r/87h9k4kzcv.fsf%40yhuang-dev.intel.com
>
> drivers/virtio/virtio_ring.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Thanks for cleaning this up:
Acked-by: Will Deacon <will.deacon@arm.com>
Will
> diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c
> index 14e7ce9b3e96..734de927c89d 100644
> --- a/drivers/virtio/virtio_ring.c
> +++ b/drivers/virtio/virtio_ring.c
> @@ -110,7 +110,7 @@ static struct vring_desc *alloc_indirect(struct virtqueue *_vq,
> * otherwise virt_to_phys will give us bogus addresses in the
> * virtqueue.
> */
> - gfp &= ~(__GFP_HIGHMEM | __GFP_HIGH);
> + gfp &= ~__GFP_HIGHMEM;
>
> desc = kmalloc(total_sg * sizeof(struct vring_desc), gfp);
> if (!desc)
> --
> 2.6.2
>
next parent reply other threads:[~2015-12-01 16:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1448980369-27130-1-git-send-email-mhocko@kernel.org>
2015-12-01 16:17 ` Will Deacon [this message]
2015-12-07 11:29 ` [PATCH] virtio: Do not drop __GFP_HIGH in alloc_indirect Mel Gorman
2015-12-01 14:32 Michal Hocko
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=20151201161704.GC27751@arm.com \
--to=will.deacon@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mhocko@kernel.org \
--cc=mhocko@suse.com \
--cc=mst@redhat.com \
--cc=virtualization@lists.linux-foundation.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 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).