lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAD=FV=W8h45qnhH-a8--fUS=ObJhBu77ZCJn2QOB5NsMoFesnA@mail.gmail.com>
Date:	Fri, 8 Jan 2016 15:31:29 -0800
From:	Doug Anderson <dianders@...omium.org>
To:	Russell King - ARM Linux <linux@....linux.org.uk>
Cc:	Robin Murphy <robin.murphy@....com>,
	Tomasz Figa <tfiga@...omium.org>,
	Marek Szyprowski <m.szyprowski@...sung.com>,
	Pawel Osciak <pawel@...iak.com>,
	Dmitry Torokhov <dmitry.torokhov@...il.com>,
	Jonathan Corbet <corbet@....net>,
	Andrew Morton <akpm@...ux-foundation.org>,
	"linux-doc@...r.kernel.org" <linux-doc@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v4 2/3] common: DMA-mapping: add DMA_ATTR_NOHUGEPAGE attribute

Russell,

On Fri, Jan 8, 2016 at 3:18 PM, Russell King - ARM Linux
<linux@....linux.org.uk> wrote:
> On Fri, Jan 08, 2016 at 03:05:13PM -0800, Doug Anderson wrote:
>> 1. I have to go and touch all existing DMA-mapping code to set
>> DMA_ATTR_HUGE_PAGE.  That will be a big patchset and touch more code,
>> making it more likely to break something.
> ...
>
> Indeed, I was actually thinking of a positive "prefer/only use/force
> smaller pages" thing rather than "allow huge pages" as a way to get
> rid of the "no huge pages" negative as a way to get around that.
> It has the same meaning when set as DMA_ATTR_NO_HUGE_PAGE but
> avoids the problem of wondering what
>
>         !dma_get_attr(DMA_ATTR_NO_HUGE_PAGE, attrs)
>
> means.
>
> I wasn't thinking of DMA_ATTR_HUGE_PAGE as that would certainly be
> wrong when CONFIG_HAVE_DMA_ATTRS is disabled (when dma_get_attr()
> always returns 0.)

Ah, that makes so much more sense now!  :)  So you were suggesting
something like DMA_ATTR_SMALL_PAGES_OK.  Then you if we wanted all
possible states you'd have 0 vs. DMA_ATTR_SMALL_PAGES_OK vs.
DMA_ATTR_HUGE_PAGE?  That would avoid the double-negative but does
have the downside that it's less obvious that DMA_ATTR_SMALL_PAGES_OK
is the opposite of DMA_ATTR_HUGE_PAGE.


I think I still have a bit of a bias towards matching the MADV API,
but I also am happy to change things if that's what people want.  How
about if I see other people chiming in saying that they'd prefer
something like "DMA_ATTR_SMALL_PAGES_OK" then I'll change it,
otherwise I'll leave it as-is (since you said you didn't have a strong
opinion on it).


-Doug

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ