linux-riscv.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Alexandre Ghiti <aghiti@upmem.com>
Cc: aou@eecs.berkeley.edu, catalin.marinas@arm.com,
	palmer@sifive.com, ndesaulniers@google.com, mingo@kernel.org,
	atish.patra@wdc.com, linux-riscv@lists.infradead.org,
	akpm@linux-foundation.org, mike.kravetz@oracle.com
Subject: Re: [PATCH 1/3] riscv: Introduce huge page support for 32/64bit kernel
Date: Tue, 15 Jan 2019 08:11:01 -0800	[thread overview]
Message-ID: <20190115161101.GA12222@infradead.org> (raw)
In-Reply-To: <20181210062146.24951-2-aghiti@upmem.com>

> +#ifdef CONFIG_ARCH_HAS_GIGANTIC_PAGE
> +static inline bool gigantic_page_supported(void) { return true; }

Can you move each brace and the return statement to an line of its
own?  Just to keep the code a little easier to read.

> +int pud_huge(pud_t pud)
> +{
> +	return pud_present(pud)
> +		&& (pud_val(pud) & (_PAGE_READ | _PAGE_WRITE | _PAGE_EXEC));
> +}
> +
> +int pmd_huge(pmd_t pmd)
> +{
> +	return pmd_present(pmd)
> +		&& (pmd_val(pmd) & (_PAGE_READ | _PAGE_WRITE | _PAGE_EXEC));
> +}

Kinda sad that we can't easily have these as inline functions, but not
really your fault.  Note that the && should move to the first line
of the multi-line statement.

> +#if defined(CONFIG_64BIT)
> +	} else if (ps == PUD_SIZE) {
> +		hugetlb_add_hstate(PUD_SHIFT - PAGE_SHIFT);
> +#endif

I think this could be:

	} else if (IS_ENABLED(CONFIG_64BIT) && ps == PUD_SIZE) {
		hugetlb_add_hstate(PUD_SHIFT - PAGE_SHIFT);



_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

  parent reply	other threads:[~2019-01-15 16:11 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-10  6:21 [PATCH 0/3] Hugetlbfs support for riscv Alexandre Ghiti
2018-12-10  6:21 ` [PATCH 1/3] riscv: Introduce huge page support for 32/64bit kernel Alexandre Ghiti
2019-01-11  6:18   ` Paul Walmsley
2019-01-11 13:58     ` Alexandre Ghiti
2019-01-15 16:11   ` Christoph Hellwig [this message]
2019-01-15 18:52     ` Alex Ghiti
2018-12-10  6:21 ` [PATCH 2/3] riscv: Fix wrong comment about task size for riscv64 Alexandre Ghiti
2019-01-15 15:58   ` Christoph Hellwig
2019-01-15 18:53     ` Alex Ghiti
2019-02-07 12:52       ` Alexandre Ghiti
2018-12-10  6:21 ` [PATCH 3/3] riscv: Adjust mmap base address at a third of task size Alexandre Ghiti
2019-01-15 16:02   ` Christoph Hellwig
2019-01-15 18:54     ` Alex Ghiti
2019-01-25 19:02       ` Palmer Dabbelt
2019-01-26  9:23         ` Alex Ghiti
2019-01-27 16:57           ` Alex Ghiti
2019-01-28 11:17             ` Alexandre Ghiti
2019-01-07 17:57 ` [PATCH 0/3] Hugetlbfs support for riscv Alex Ghiti
2019-01-07 21:52   ` Paul Walmsley
2019-01-08  9:26     ` Alexandre Ghiti
2019-01-09 18:26   ` Palmer Dabbelt
2019-01-09 19:23 ` Mike Kravetz
2019-01-09 22:15   ` Palmer Dabbelt
2019-01-10  7:33     ` Alex Ghiti
2019-01-10  8:09   ` Alex Ghiti
2019-01-10 18:28     ` Mike Kravetz
2019-01-12  1:09       ` Alex Ghiti
2019-01-15 16:04   ` Christoph Hellwig
2019-01-15 18:56     ` Alex Ghiti
2019-01-15 19:25     ` Mike Kravetz
2019-01-15 20:52       ` Christoph Hellwig
2019-01-16 13:18         ` Alexandre Ghiti

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=20190115161101.GA12222@infradead.org \
    --to=hch@infradead.org \
    --cc=aghiti@upmem.com \
    --cc=akpm@linux-foundation.org \
    --cc=aou@eecs.berkeley.edu \
    --cc=atish.patra@wdc.com \
    --cc=catalin.marinas@arm.com \
    --cc=linux-riscv@lists.infradead.org \
    --cc=mike.kravetz@oracle.com \
    --cc=mingo@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=palmer@sifive.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;
as well as URLs for NNTP newsgroup(s).