From: Baoquan He <bhe@redhat.com>
To: Christoph Hellwig <hch@lst.de>
Cc: martin.petersen@oracle.com, linux-scsi@vger.kernel.org
Subject: Re: [PATCH v2] sr: don't use GFP_DMA
Date: Wed, 22 Dec 2021 18:40:46 +0800 [thread overview]
Message-ID: <20211222104046.GB23698@MiWiFi-R3L-srv> (raw)
In-Reply-To: <20211222094216.GA28018@lst.de>
On 12/22/21 at 10:42am, Christoph Hellwig wrote:
> On Wed, Dec 22, 2021 at 05:37:07PM +0800, Baoquan He wrote:
> > > /* allocate transfer buffer */
> > > - buffer = kmalloc(512, GFP_KERNEL | GFP_DMA);
> > > + buffer = kmalloc(512, GFP_KERNEL);
> >
> > Thanks a lot for doing this. When I browsed the code path, I come to
> > blk_rq_map_kern() but I am not sure if blk_queue_may_bounce() is true in
> > the sr_probe() case, then it may enter into bio_map_kern().
>
> blk_queue_may_bounce will be entered for the few drives that set
> BLK_BOUNCE_HIGH because they can't handle highmem (which is a subset
> of the non-ZONE_DMA memory). The only driver that actually requires
> ZONE_DMA based bouncing is ps3rom, and that driver does a manual
> and ubconditional bounce buffering.
Got it now, thx.
>
> > Next I will post my original patchset to mute the allocation failure if
> > it's requesting page from DMA zone and DMA zone has no managed page. And
> > meanwhile, I will try to collect those places of kmalloc(GFP_DMA) into a
> > RFC mail, see if we can change them one by one. Anyone can pick one
> > place to fix if interested or knowing it well.
>
> I've already sent out patches for all of drivers/scsi/ today, except
> for the ps3rom bounce buffer alllocation which is fine but should
> probably be changed to use the page allocator directly.
Sounds really great.
Any thought or plan for those callsites in other places? Possibly we can
skip those s390 related drivers since s390 only has DMA zone, no DMA32,
it should be OK.
And could you please also add me to CC when send out these patches? We
have this problem in our RHEL8 which is based on kernel4.18, if finally
removing dma-kmalloc(), we need back port these driver fixes too. If
not paying attention, these patches may scatter in different
sub-components and unnoticable.
>
> > Finally, we can remove the
> > need of dma-kmalloc() as people suggested. Any comment?
>
> Yes.
>
next prev parent reply other threads:[~2021-12-22 10:40 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-22 9:08 [PATCH v2] sr: don't use GFP_DMA Christoph Hellwig
2021-12-22 9:37 ` Baoquan He
2021-12-22 9:42 ` Christoph Hellwig
2021-12-22 10:40 ` Baoquan He [this message]
2021-12-23 9:01 ` Christoph Hellwig
2021-12-23 9:16 ` Baoquan He
2021-12-23 4:45 ` Martin K. Petersen
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=20211222104046.GB23698@MiWiFi-R3L-srv \
--to=bhe@redhat.com \
--cc=hch@lst.de \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
/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