mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrea Arcangeli <aarcange@redhat.com>
To: Matthew Wilcox <willy@linux.intel.com>
Cc: Ingo Molnar <mingo@kernel.org>,
	akpm@linux-foundation.org, hpa@zytor.com, mingo@elte.hu,
	tglx@linutronix.de, linux-kernel@vger.kernel.org,
	Jeremy Fitzhardinge <jeremy@goop.org>
Subject: Re: + x86-add-support-for-pud-sized-transparent-hugepages-checkpatch-fixes.patch added to -mm tree
Date: Wed, 9 Mar 2016 18:40:09 +0100	[thread overview]
Message-ID: <20160309174009.GR14882@redhat.com> (raw)
In-Reply-To: <20160304203018.GC5530@linux.intel.com>

Hello everyone,

On Fri, Mar 04, 2016 at 03:30:18PM -0500, Matthew Wilcox wrote:
> On Wed, Feb 03, 2016 at 08:48:35AM +0100, Ingo Molnar wrote:
> > > @@ -111,8 +111,10 @@ static inline pud_t native_pudp_get_and_
> > >  #ifdef CONFIG_SMP
> > >  	return native_make_pud(xchg(&pudp->pud, 0));
> > >  #else
> > > -	/* native_local_pudp_get_and_clear,
> > > -	   but duplicated because of cyclic dependency */
> > > +	/*
> > > +	 * native_local_pudp_get_and_clear, but duplicated because of cyclic
> > > +	 * dependency
> > > +	 */
> > >  	pud_t ret = *pudp;
> > >  	native_pud_clear(pudp);
> > >  	return ret;
> > 
> > When referring to functions in comments (or changelogs) please use () to make it 
> > clear on sight what is being referred to.
> > 
> > Also, please try to construct proper English sentences with verbs and such!
> > 
> > I.e. something like this would work for me:
> > 
> > > +	/*
> > > +	 * This is a duplicate of native_local_pudp_get_and_clear(),
> > > +	 * because we cannot use the original due to a cyclic header
> > > +	 * file dependency:
> > > +	 */
> > 
> > (Assuming I managed to decode the shorthand form properly.)
> 
> I have no idea what it means.  This is copy-and-change of the pmd version,
> which was originally commit db3eb96f4e6281b84dd33c8980dacc27f2efe177 by
> Andrea.

which I also copied from native_ptep_get_and_clear:

tatic inline pte_t native_ptep_get_and_clear(pte_t *xp)
{
#ifdef CONFIG_SMP
       return native_make_pte(xchg(&xp->pte, 0));
#else
	/* native_local_ptep_get_and_clear,
	   but duplicated because of cyclic dependency */
	   pte_t ret = *xp;
	   native_pte_clear(NULL, 0, xp);
	   return ret;
#endif
}

static inline pmd_t native_pmdp_get_and_clear(pmd_t *xp)
{
#ifdef CONFIG_SMP
       return native_make_pmd(xchg(&xp->pmd, 0));
#else
	/* native_local_pmdp_get_and_clear,
	   but duplicated because of cyclic dependency */
	   pmd_t ret = *xp;
	   native_pmd_clear(xp);
	   return ret;
#endif
}

So if you intend to expand the comment in native_pmdp_get_and_clear
that I added with my commit (from v2.6.38), I would suggest to also
improve the comment in native_ptep_get_and_clear.

I did only s/ptep/pmdp, the comment originated in commit
4891645e764d2e181b834509a689fcd12e890c10 (from v2.6.25).

The comment means native_local_pmdp_get_and_clear() couldn't be
called, or the build would break because of preprocessor include order
dependencies. I CC'ed Jeremy just in case, but I've no doubts about
the comment myself.

See also what native_local_pmdp_get_and_clear does..

static inline pmd_t native_local_pmdp_get_and_clear(pmd_t *pmdp)
{
	pmd_t res = *pmdp;

	native_pmd_clear(pmdp);
	return res;
}

It'd be sure fine to improve the comment, but a comment, even a short
one, was in order. If a solution is found for the include ordering,
one could call native_local_pmdp_get_and_clear there, so it was good
to keep that in mind. Nothing special about the pmd-THP part, this
build issue originated in the pte.

In fact even before starting to fix the comment, I would recommend to
try again to call native_local_pmdp_get_and_clear and
native_local_ptep_get_and_clear to verify if it still breaks, just in
case the include ordering got fixed by accident in the meanwhile (that
was a comment in 2.6.25 when arch/x86/include/asm didn't even exist
yet, it was still in include/asm-x86). If it would manage to build
without the manual expansion, the comment could go and the duplication
as well.

Thanks,
Andrea

  parent reply	other threads:[~2016-03-09 17:40 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <56b13381.v0wS03ZQEKxwivVW%akpm@linux-foundation.org>
2016-02-03  7:48 ` Ingo Molnar
2016-03-04 20:30   ` Matthew Wilcox
2016-03-09 12:08     ` Ingo Molnar
2016-03-09 16:55       ` Matthew Wilcox
2016-03-10  9:37         ` Ingo Molnar
2016-03-10 14:39           ` Matthew Wilcox
2016-03-09 17:40     ` Andrea Arcangeli [this message]
2016-03-09 18:45       ` Matthew Wilcox
2016-03-09 20:03         ` Matthew Wilcox
2016-03-09 23:08           ` Andrea Arcangeli

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=20160309174009.GR14882@redhat.com \
    --to=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=hpa@zytor.com \
    --cc=jeremy@goop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mingo@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=willy@linux.intel.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

Powered by JetHome