[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZV94VsUOE34B1H-i@x1n>
Date: Thu, 23 Nov 2023 11:05:42 -0500
From: Peter Xu <peterx@...hat.com>
To: Christoph Hellwig <hch@...radead.org>
Cc: linux-kernel@...r.kernel.org, linux-mm@...ck.org,
Mike Kravetz <mike.kravetz@...cle.com>,
"Kirill A . Shutemov" <kirill@...temov.name>,
Lorenzo Stoakes <lstoakes@...il.com>,
Axel Rasmussen <axelrasmussen@...gle.com>,
Matthew Wilcox <willy@...radead.org>,
John Hubbard <jhubbard@...dia.com>,
Mike Rapoport <rppt@...nel.org>,
Hugh Dickins <hughd@...gle.com>,
David Hildenbrand <david@...hat.com>,
Andrea Arcangeli <aarcange@...hat.com>,
Rik van Riel <riel@...riel.com>,
James Houghton <jthoughton@...gle.com>,
Yang Shi <shy828301@...il.com>,
Jason Gunthorpe <jgg@...dia.com>,
Vlastimil Babka <vbabka@...e.cz>,
Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH RFC 01/12] mm/hugetlb: Export
hugetlbfs_pagecache_present()
On Wed, Nov 22, 2023 at 11:23:07PM -0800, Christoph Hellwig wrote:
> You're (thankfully) not actually exporting anything, so please
> don't claim that in the subject.
Ah, I'll rename the subject to "mm/hugetlb: Declare
hugetlbfs_pagecache_present() non-static".
>
> > pte_t *huge_pmd_share(struct mm_struct *mm, struct vm_area_struct *vma,
> > unsigned long addr, pud_t *pud);
> > +bool hugetlbfs_pagecache_present(struct hstate *h,
> > + struct vm_area_struct *vma,
> > + unsigned long address);
>
> Can you just follow the much more readable two tab indent of the
> function above?
>
> > -static bool hugetlbfs_pagecache_present(struct hstate *h,
> > - struct vm_area_struct *vma, unsigned long address)
> > +bool hugetlbfs_pagecache_present(struct hstate *h,
> > + struct vm_area_struct *vma, unsigned long address)
>
> Same here. The new indentation not only is less readable but also
> creates a pointlessly overlong line.
I can easily follow what you suggest for this single patch, but afaict the
kernel doesn't document that in the style guide.
https://www.kernel.org/doc/html/v4.10/process/coding-style.html#functions
And the reality is at least across mm codes it's used in a mixture of ways,
even more than these two major forms of indentations.
To be explicit, I think 2-tab is Vim's default, while this patch follows
Emacs's c-mode default. It means if this patch indents wrongly, probably
99% of Emacs users are doomed. :(
Before we have a clear and thorough rule over this, shall we just allow
either sane indent to still be accepted? Or maybe there's some rule that I
have missed? Personally I actually prefer Emacs's indentations to align
with left bracket, but that's just subjective so doesn't count.
Thanks,
--
Peter Xu
Powered by blists - more mailing lists