Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1558042

Re: blk_queue_bounce_limit() broken for mask=0xffffffff on 64bit archs

Path csiph.com!1.us.feeder.erje.net!feeder.erje.net!2.eu.feeder.erje.net!news.roellig-ltd.de!open-news-network.org!news.albasani.net!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod
From Ming Lei <tom.leiming@gmail.com>
Newsgroups linux.kernel
Subject Re: blk_queue_bounce_limit() broken for mask=0xffffffff on 64bit archs
Date Fri, 13 Jan 2017 07:10:02 +0100
Message-ID <sZ3dM-5M4-3@gated-at.bofh.it> (permalink)
References <sXP3b-qJ-27@gated-at.bofh.it>
X-Original-To Nikita Yushchenko <nikita.yoush@cogentembedded.com>
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=DY2RnGDqTOKi28tqkbOCT5XY8eQh4R693Bk/bmDKl8U=; b=Nykb+9bWpOT8eUHaFtmQJLbryHcJJio4+PPMM3V36j6ftPwwJ7e2M62VtB0oKqwE81 TrlWVo4zOMN69HRd8yCGfS7zGZb//m9gPz4ABUmA2RL9x1MPoJ4y/ulCnBqkdw/7Wxe8 SgMnr+askE2WbsC/xUGyhmtcAFySL48dvrUF48mgqo3ILJTvlP6sLhgtL+6uPDAvCcXl zugAsPGp9M9oRFpDgSlgJKXQVGfQxN2dzaGWF7O8NIuDuQehtD80NKigwBPCtCfKZDwm YqyQaSvc/b6HyCU15SglSa1sj0qUzBfVrdxZY0KIi0fE8BYTyPKOgyEKNFX2q20PugD9 JoNg==
X-Google-Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=DY2RnGDqTOKi28tqkbOCT5XY8eQh4R693Bk/bmDKl8U=; b=B6nHJ9xHUEsIwmsq1UGoSY1ToOpQZClTIuBUVpoOlNP4yrus8zaT81iYN9aPlwzXYB 1dQh+/zava2E2lpZI+T/+ZeycrsUVBdiB+YsawvgL8CndVs55myzrCZDCNa3/mLzXsXA MLoQ3WUvopWNqiF6EJb9IGCwfr5PAvlxBNZtFV6udRCuzVjQ5QZVoevBRj3/hdhAnU8y 2X/9xakhhFHTe5G+xywzld8DUVFzs2hIuJ7LjWLKluN+3Isex5DiP0Bk9LoWajgR7f5Y DsTnllp9ml+eoIaGalRuOJLO2kAzYs8ujTUA1rqo15r4IkH0pnLAq2z1N1HXjKKMZIvl itAA==
X-Gm-Message-State AIkVDXJcbfTADAJ1QZ2a4n9fYMic4045EtQVZ03RKMmYDNjCT+6FM+qqp/c+ZY849aB/e6KBskWDpO5W8eIxkQ==
X-Received by 10.46.22.87 with SMTP id 23mr6406793ljw.50.1484287677868; Thu, 12 Jan 2017 22:07:57 -0800 (PST)
MIME-Version 1.0
Content-Type text/plain; charset=UTF-8
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 49
Organization linux.* mail to news gateway
X-Original-Cc Jens Axboe <axboe@kernel.dk>, linux-block <linux-block@vger.kernel.org>, "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>, Artemi Ivanov <artemi.ivanov@cogentembedded.com>
X-Original-Date Fri, 13 Jan 2017 14:07:57 +0800
X-Original-Message-ID <CACVXFVPgmaBh5OqjfTfqdQ9k78PWsmozuRZpSG5gMg84m4sDwQ@mail.gmail.com>
X-Original-References <632ad7f3-e837-a17c-5ba7-ed9800ba3ec0@cogentembedded.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1558042

Show key headers only | View raw


Hi,

On Tue, Jan 10, 2017 at 4:48 AM, Nikita Yushchenko
<nikita.yoush@cogentembedded.com> wrote:
> Hi
>
> There is a use cases when architecture is 64-bit but hardware supports
> only DMA to lower 4G of address space. E.g. NVMe device on RCar PCIe host.
>
> For such cases, it looks proper to call blk_queue_bounce_limit() with
> mask set to 0xffffffff - thus making block layer to use bounce buffers
> for any addresses beyond 4G.  To support that, architecture provides
> GFP_DMA zone that covers exactly low 4G on arm64.
>
> However setting this limit does not work:
>
>   if (b_pfn < (min_t(u64, 0xffffffffUL, BLK_BOUNCE_HIGH) >> PAGE_SHIFT))
>       dma = 1;
>
> When mask is 0xffffffff that condition is false

That should have been true in your case, since the b_pfn is smaller than
0xffffffff.

>
>   q->limits.bounce_pfn = max(max_low_pfn, b_pfn);
>
> this line is executed and replaces any limit with end of memory (on
> 64bit arch all memory is low).

I don't understand why max() is used? And why not min()?

Looks the above line just disables bounce for 64bit arch, doesn't it?

Thanks,
Ming

>
>
> Not sure how to fix this properly. Any hints?
> --
> To unsubscribe from this list: send the line "unsubscribe linux-block" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



-- 
Ming Lei

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

blk_queue_bounce_limit() broken for mask=0xffffffff on 64bit archs Nikita Yushchenko <nikita.yoush@cogentembedded.com> - 2017-01-09 21:50 +0100
  Re: blk_queue_bounce_limit() broken for mask=0xffffffff on 64bit  archs Christoph Hellwig <hch@infradead.org> - 2017-01-09 22:10 +0100
  Re: blk_queue_bounce_limit() broken for mask=0xffffffff on 64bit archs Ming Lei <tom.leiming@gmail.com> - 2017-01-13 07:10 +0100
    Re: blk_queue_bounce_limit() broken for mask=0xffffffff on 64bit  archs Nikita Yushchenko <nikita.yoush@cogentembedded.com> - 2017-01-13 07:20 +0100

csiph-web