From: Matthew Wilcox <email@example.com> To: Waiman Long <firstname.lastname@example.org> Cc: Alexander Viro <email@example.com>, Jonathan Corbet <firstname.lastname@example.org>, email@example.com, firstname.lastname@example.org, email@example.com, firstname.lastname@example.org, "Luis R. Rodriguez" <email@example.com>, Kees Cook <firstname.lastname@example.org>, Linus Torvalds <email@example.com>, Jan Kara <firstname.lastname@example.org>, "Paul E. McKenney" <email@example.com>, Andrew Morton <firstname.lastname@example.org>, Ingo Molnar <email@example.com>, Miklos Szeredi <firstname.lastname@example.org>, Larry Woodman <email@example.com>, James Bottomley <James.Bottomley@HansenPartnership.com>, "Wangkai (Kevin C)" <firstname.lastname@example.org>, Michal Hocko <email@example.com> Subject: Re: [PATCH v3 4/4] fs/dcache: Eliminate branches in nr_dentry_negative accounting Date: Wed, 12 Sep 2018 08:55:57 -0700 [thread overview] Message-ID: <20180912155557.GA18304@bombadil.infradead.org> (raw) In-Reply-To: <firstname.lastname@example.org> On Wed, Sep 12, 2018 at 11:49:22AM -0400, Waiman Long wrote: > > unless our macrology has got too clever for the compilre to see through > > it. In which case, the right answer is to simplify the percpu code, > > not to force the compiler to optimise the code in the way that makes > > sense for your current microarchitecture. > > > I had actually looked at the x86 object file generated to verify that it > did use cmove with the patch and use branch without. It is possible that > there are other twists to make that happen with the above expression. I > will need to run some experiments to figure it out. In the mean time, I > am fine with dropping this patch as it is a micro-optimization that > doesn't change the behavior at all. I don't understand why you included it, to be honest. But it did get me looking at the percpu code to see if it was too clever. And that led to the resubmission of rth's patch from two years ago that I cc'd you on earlier. With that patch applied, gcc should be able to choose to use the cmov if it feels that would be a better optimisation. It already makes one different decision in dcache.o, namely that it uses addq $0x1,%gs:0x0(%rip) instead of incq %gs:0x0(%rip). Apparently this performs better on some CPUs. So I wouldn't spend any more time on this patch.
next prev parent reply other threads:[~2018-09-12 15:55 UTC|newest] Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top 2018-09-11 19:18 [PATCH v3 0/4] fs/dcache: Track # of negative dentries Waiman Long 2018-09-11 19:18 ` [PATCH v3 1/4] fs/dcache: Fix incorrect nr_dentry_unused accounting in shrink_dcache_sb() Waiman Long 2018-09-11 22:02 ` Dave Chinner 2018-09-12 15:41 ` Waiman Long 2018-09-11 19:18 ` [PATCH v3 2/4] fs: Don't need to put list_lru into its own cacheline Waiman Long 2018-09-11 22:02 ` Dave Chinner 2018-09-11 19:18 ` [PATCH v3 3/4] fs/dcache: Track & report number of negative dentries Waiman Long 2018-09-11 22:08 ` Dave Chinner 2018-09-12 15:40 ` Waiman Long 2018-09-11 19:18 ` [PATCH v3 4/4] fs/dcache: Eliminate branches in nr_dentry_negative accounting Waiman Long 2018-09-11 22:13 ` Dave Chinner 2018-09-12 15:44 ` Waiman Long 2018-09-12 2:36 ` Matthew Wilcox 2018-09-12 15:49 ` Waiman Long 2018-09-12 15:55 ` Matthew Wilcox [this message] 2018-09-12 16:11 ` Waiman Long
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=20180912155557.GA18304@bombadil.infradead.org \ --email@example.com \ --cc=James.Bottomley@HansenPartnership.com \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --subject='Re: [PATCH v3 4/4] fs/dcache: Eliminate branches in nr_dentry_negative accounting' \ /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
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).