mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Arnd Bergmann <arnd@arndb.de>,
	Michael Thayer <michael.thayer@oracle.com>,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH 2/3] virt: vbox: Use __get_free_pages instead of kmalloc for DMA32 memory
Date: Tue, 3 Apr 2018 15:20:55 +0200	[thread overview]
Message-ID: <a40fa6a3-f137-2adb-b432-8d60cbf3f525@redhat.com> (raw)
In-Reply-To: <20180329163936.GA4579@kroah.com>

Hi,

On 29-03-18 18:39, Greg Kroah-Hartman wrote:
> On Thu, Mar 29, 2018 at 03:42:59PM +0200, Hans de Goede wrote:
>> Hi,
>>
>> On 29-03-18 13:58, Greg Kroah-Hartman wrote:
>>> On Thu, Mar 29, 2018 at 01:21:15PM +0200, Hans de Goede wrote:
>>>> It is not possible to get DMA32 zone memory through kmalloc,
>>>
>>> Why can't we just fix that issue here instead?
>>
>> AFAIK that would go against the design of the whole slab
>> allocator, it creates buckets (kmem_cache objects) for
>> differently sized allocs out of the normal memzone,
>> you cannot select what memzone you want with kmalloc,
>> if you need to specify a memzone you need to use either
>> dma specific malloc functions such as the dmapool.h
>> functions, or directly call alloc_pages / get_free_pages.
>>
>> A quick grep on the drivers dir shows 50 files using
>> GFP_DMA32 and almost all are passing it to alloc_page
>> or __get_page.
> 
> If there are 50 users of such an api, why is the mm core not handling
> this for drivers automatically?  It seems harsh that they all have to do
> this type of allocation on their own.

True, but fixing that falls outside the scope of this patch-set,
which is purely a small bug-fix patchset fixing a bug which
is being hit be users in the field atm.

So it would be nice if we can get (version 2) of this patch-set
merged.

>> I do actually see 2 drivers which are passing it to
>> kmalloc, which as said will not work I will mail the
>> maintainers of those about this.
> 
> If they haven't noticed that their hardware isn't working, perhaps they
> don't need to set that flag?  :)

Or they have never tested with more then 4G of RAM, which is what
caused me to not find this problem in my own testing of the
vboxguest driver.

Regards,

Hans

  reply	other threads:[~2018-04-03 13:20 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-29 11:21 [PATCH 1/3] virt: vbox: Add vbg_req_free() helper function Hans de Goede
2018-03-29 11:21 ` [PATCH 2/3] virt: vbox: Use __get_free_pages instead of kmalloc for DMA32 memory Hans de Goede
2018-03-29 11:57   ` Greg Kroah-Hartman
2018-03-29 11:58   ` Greg Kroah-Hartman
2018-03-29 13:42     ` Hans de Goede
2018-03-29 16:39       ` Greg Kroah-Hartman
2018-04-03 13:20         ` Hans de Goede [this message]
2018-03-29 11:21 ` [PATCH 3/3] virt: vbox: Log an error whenwe fail to get the host version Hans de Goede
2018-03-29 11:55 ` [PATCH 1/3] virt: vbox: Add vbg_req_free() helper function Greg Kroah-Hartman
2018-03-29 13:12   ` Hans de Goede
2018-03-29 11:56 ` Greg Kroah-Hartman
2018-03-29 13:16   ` Hans de Goede

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=a40fa6a3-f137-2adb-b432-8d60cbf3f525@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=arnd@arndb.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michael.thayer@oracle.com \
    --cc=stable@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®