From: John Hubbard <jhubbard@nvidia.com>
To: Dmitry Osipenko <digetx@gmail.com>,
Minchan Kim <minchan@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>
Cc: linux-mm <linux-mm@kvack.org>,
LKML <linux-kernel@vger.kernel.org>, <gregkh@linuxfoundation.org>,
<surenb@google.com>, <joaodias@google.com>, <willy@infradead.org>,
Colin Ian King <colin.king@canonical.com>
Subject: Re: [PATCH v7] mm: cma: support sysfs
Date: Wed, 24 Mar 2021 15:23:09 -0700 [thread overview]
Message-ID: <b5607405-d794-0035-e8db-5525aee29e28@nvidia.com> (raw)
In-Reply-To: <0396987d-1331-51a0-83f4-0c49dd3e150c@gmail.com>
On 3/24/21 3:11 PM, Dmitry Osipenko wrote:
> 25.03.2021 01:01, John Hubbard пишет:
>> On 3/24/21 2:31 PM, Dmitry Osipenko wrote:
>>> ...
>>>> +#include <linux/kobject.h>
>>>> +
>>>> +struct cma_kobject {
>>>> + struct cma *cma;
>>>> + struct kobject kobj;
>>>
>>> If you'll place the kobj as the first member of the struct, then
>>> container_of will be a no-op.
>>>
>>
>> However, *this does not matter*. Let's not get carried away. If
>> container_of() ends up as a compile-time addition of +8, instead
>> of +0, there is not going to be a visible effect in the world.
>> Or do you have some perf data to the contrary?
>>
>> Sometimes these kinds of things matter. But other times, they are
>> just pointless to fret about, and this is once such case.
>
> Performance is out of question here, my main point is about maintaining
In that case, there is even less reason to harass people about the order
of members of a struct.
> a good coding style. Otherwise there is no point in not embedding kobj
> into cma struct as well, IMO.
We really don't need to worry about the order of members in a struct,
from a "coding style" point of view. It is a solid step too far.
Sorry if that sounds a little too direct. But this review has tended to
go quite too far into nitpicks that are normally left as-is, and I've
merely picked one that is particularly questionable. I realize that other
coding communities have their own standards. Here, I'm explaining what
I have observed about linux-mm and linux-kernel, which needs to be respected.
thanks,
--
John Hubbard
NVIDIA
next prev parent reply other threads:[~2021-03-24 22:23 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-24 20:55 Minchan Kim
2021-03-24 21:31 ` Dmitry Osipenko
2021-03-24 21:35 ` Dmitry Osipenko
2021-03-24 21:55 ` Minchan Kim
2021-03-24 22:10 ` Dmitry Osipenko
2021-03-24 22:12 ` Dmitry Osipenko
2021-03-24 22:16 ` Dmitry Osipenko
2021-03-24 22:21 ` Dmitry Osipenko
2021-03-24 22:01 ` John Hubbard
2021-03-24 22:11 ` Dmitry Osipenko
2021-03-24 22:23 ` John Hubbard [this message]
2021-03-24 22:42 ` Dmitry Osipenko
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=b5607405-d794-0035-e8db-5525aee29e28@nvidia.com \
--to=jhubbard@nvidia.com \
--cc=akpm@linux-foundation.org \
--cc=colin.king@canonical.com \
--cc=digetx@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=joaodias@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=minchan@kernel.org \
--cc=surenb@google.com \
--cc=willy@infradead.org \
/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