[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <diqzqzv2762z.fsf@google.com>
Date: Thu, 16 Oct 2025 16:57:40 -0700
From: Ackerley Tng <ackerleytng@...gle.com>
To: Miguel Ojeda <miguel.ojeda.sandonis@...il.com>,
Sean Christopherson <seanjc@...gle.com>
Cc: Miguel Ojeda <ojeda@...nel.org>, Marc Zyngier <maz@...nel.org>,
Oliver Upton <oliver.upton@...ux.dev>, Paolo Bonzini <pbonzini@...hat.com>,
linux-arm-kernel@...ts.infradead.org, kvmarm@...ts.linux.dev,
kvm@...r.kernel.org, linux-kernel@...r.kernel.org,
Shivank Garg <shivankg@....com>, David Hildenbrand <david@...hat.com>, Fuad Tabba <tabba@...gle.com>,
Ashish Kalra <ashish.kalra@....com>, Vlastimil Babka <vbabka@...e.cz>
Subject: Re: [PATCH v13 00/12] KVM: guest_memfd: Add NUMA mempolicy support
Miguel Ojeda <miguel.ojeda.sandonis@...il.com> writes:
> On Thu, Oct 16, 2025 at 10:28 PM Sean Christopherson <seanjc@...gle.com> wrote:
>>
>> Oh, I take it .clang-format is auto-generated? Is it a "formal" script, or do
>> you literally just run the grep command in the comment?
>
> I just run it and copy-paste the results there from time to time.
> Yeah, a very low-tech solution :)
>
I assumed someone was doing this from time to time, and I ran the grep
command in .clang-format but IIUC it only reads tools/ and include/
(which doesn't cover this new macro) and so I thought the "automation"
would miss this new macro, hence I suggested to manually add the macro.
Using the command on virt/ would pick it up. Would it be better to add
"virt/" to the "automation" + update .clang-format while we're at it?
$ git grep -h '^#define [^[:space:]]*for_each[^[:space:]]*(' virt/ | sed "s,^#define \([^[:space:]]*for_each[^[:space:]]*\)(.*$, - '\1'," | LC_ALL=C sort -u
- 'kvm_for_each_memslot_in_hva_range'
- 'kvm_gmem_for_each_file'
>> I don't think I care if it's in the list? I honestly don't know for sure, because
>> it's entirely possible I'm consuming .clang-format without knowing it. I added
>> the entry based on someone else's request.
>>
>> Ackerley?
>
> If you are not relying on it, then please just skip it, yeah.
>
I'm using it, I believe clangd (my lsp server) uses it to reflow correctly.
>> Is it possible, and sensible, to have per-subsystem .clang-format files? KVM
>> (virt/kvm) and KVM x86 (arch/x86/kvm) both have has several for_each macros,
>> pretty much all of which are more interesting than kvm_gmem_for_each_file().
>
> There is `InheritParentConfig` nowadays, but from a quick look I don't
> see it supports merging lists.
>
> So to do something fancier, we would do need something like we did for
> rust-analyzer, i.e. a `make` target or similar that would generate it.
>
> Otherwise, we can just add extra macros at the top meanwhile.
>
> What we did last time is just to add `tools/` to that command --
> increasing coverage is not an issue (I just started with `include/`
> originally to be a bit conservative and avoid a huge list until we
> knew the tool would be used).
>
> Cheers,
> Miguel
Powered by blists - more mailing lists