Re: [PATCH v9 4/8] block: Fix bio_flagged() so that gcc can better optimise it

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



John Hubbard <jhubbard@xxxxxxxxxx> wrote:

> I don't know how you noticed that this was even a problem! Neatly
> fixed.

I wanted BIO_PAGE_REFFED/PINNED to translate to FOLL_GET/PIN with no more than
a single AND instruction, assuming they were assigned to the same values (1 &
2), so I checked to see what assembly was produced by:

	gup_flags |= bio_flagged(bio, BIO_PAGE_REFFED) ? FOLL_GET : 0;
	gup_flags |= bio_flagged(bio, BIO_PAGE_PINNED) ? FOLL_PIN : 0;

Complicated though it looks, it should optimise down to something like:

	and $3,%eax

assuming something like REFFED/GET == 0x1 and PINNED/PIN == 0x2.

David




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux