public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Emese Revfy <re.emese@gmail.com>
To: Arjan van de Ven <arjan@infradead.org>
Cc: Paul Mundt <lethal@linux-sh.org>, Matthew Wilcox <matthew@wil.cx>,
	linux-kernel@vger.kernel.org, torvalds@linux-foundation.org,
	viro@zeniv.linux.org.uk, akpm@linux-foundation.org,
	Pavel Machek <pavel@ucw.cz>
Subject: Re: [PATCH 0/1] Constify struct address_space_operations for 2.6.32-git-053fe57ac v2
Date: Wed, 16 Dec 2009 00:53:45 +0100	[thread overview]
Message-ID: <4B282189.70202@gmail.com> (raw)
In-Reply-To: <20091214160153.2edfd026@infradead.org>

Arjan van de Ven wrote:
> On Mon, 14 Dec 2009 23:20:58 +0100
> Emese Revfy <re.emese@gmail.com> wrote:
> 
>> Paul Mundt wrote:
>>> I don't see anything relating to sparse in that mail. You've
>>> effectively lumped sparse and constification together in the same
>>> camp, but it's unclear why this makes constification a better
>>> option other than that it's simply the option you opted for. All of
>>> your arguments "against" sparse in that context are equally
>>> applicable to constification, so I'll reiterate that you haven't
>>> sufficiently addressed the sparse angle.
>>>
>>> At present you seem to be the only one convinced that
>>> constification is the way to go, despite it being highly intrusive
>>> and ignoring the potential for more favourable and less intrusive
>>> options. You've also failed to adequately address the issues and
>>> suggestsions pointed out by others, and until this happens there is
>>> little point in posting any follow-up patches.
>>>
>>>>> Until such a consensus is reached one way or the other, please
>>>>> refrain from sending hundreds of patches -- one or two are
>>>>> sufficient for showing what you want to do until folks are on
>>>>> board with it, as is the typical nature of mechanical changes.
>>>> I think there is consensus to constify ops variables as much as
>>>> possible (e.g., Alexey's similar patches).
>>>>
>>>> The discussions in these threads were about constifying the ops
>>>> structure fields themselves and I already explained why they are
>>>> useful, see the above link and this one:
>>>> http://lkml.org/lkml/2009/12/8/492
>>> And in here as well in the reply to that mail the same criticism
>>> exists as does the suggestion to look at doing it cleanly in
>>> sparse, which brings us back to what was already mentioned earlier.
>> Let me summarise the discussion so far:
>>
>> As per Al Viro, Arjan and other developers the goal is to force
>> static allocations and prevent runtime modification of ops structures
>> (where it is possible, there are always exceptions like
>> ata_port_operations).
>>
>> The current strategy of constifying variables achieves the second
>> goal only, it still requires human review to catch violations of the
>> first goal.
> 
> this is not correct.
> 
> When the ops variable is const... the compiler will also warn if you
> change it. Make some core APIs use const in their parameter that gets
> a pointer to the ops structure, so that the compiler can optimize.
> That is all goodness.
> 
> But if someone somewhere makes one that is not const.. that's what
> checkpatch.pl is for .. make it warn!
> But don't crap all over structures... I agree with Pavel/Al/etc.. 
> that's bad code without gains.
 
I still think it is a good idea for several reasons (see my last
response to Pavel, http://lkml.org/lkml/2009/12/15/559), but I will
remove the field constifications from the next patch series.

As for splitting up the patches, do you all agree that it should
be one series per structure type at a time (as suggested by Pavel),
with each patch mailed to the respective maintainers? If so, 
how can I reliably determine the maintainers of a given file
without spamming too many people?
--
Emese


  reply	other threads:[~2009-12-15 23:52 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-13 23:58 [PATCH 00/22] Constify struct backlight_ops for 2.6.32-git-053fe57ac v2 re.emese
2009-12-13 23:58 ` [PATCH 01/22] " re.emese
2009-12-13 23:58 ` [PATCH 02/22] " re.emese
2009-12-13 23:58 ` [PATCH 03/22] " re.emese
2009-12-13 23:58 ` [PATCH 04/22] " re.emese
2009-12-13 23:58 ` [PATCH 05/22] " re.emese
2009-12-15 22:47   ` Richard Purdie
2009-12-16 22:39     ` Emese Revfy
2009-12-13 23:58 ` [PATCH 06/22] " re.emese
2009-12-13 23:58 ` [PATCH 1/3] Constify struct acpi_dock_ops " re.emese
2009-12-13 23:58 ` [PATCH 07/22] Constify struct backlight_ops " re.emese
2009-12-13 23:59 ` [PATCH 2/3] Constify struct acpi_dock_ops " re.emese
2009-12-13 23:59 ` [PATCH 08/22] Constify struct backlight_ops " re.emese
2009-12-13 23:59 ` [PATCH 3/3] Constify struct acpi_dock_ops " re.emese
2009-12-13 23:59 ` [PATCH 09/22] Constify struct backlight_ops " re.emese
2009-12-13 23:59 ` [PATCH 10/22] " re.emese
2009-12-14  0:27   ` Jonathan Woithe
2009-12-13 23:59 ` [PATCH 11/22] " re.emese
2009-12-13 23:59 ` [PATCH 12/22] " re.emese
2009-12-13 23:59 ` [PATCH 13/22] " re.emese
2009-12-13 23:59 ` [PATCH 14/22] " re.emese
2009-12-13 23:59 ` [PATCH 15/22] " re.emese
2009-12-13 23:59 ` [PATCH 16/22] " re.emese
2009-12-13 23:59 ` [PATCH 17/22] " re.emese
2009-12-13 23:59 ` [PATCH 1/1] Constify struct address_space_operations " re.emese
2009-12-13 23:59 ` [PATCH 18/22] Constify struct backlight_ops " re.emese
2009-12-13 23:59 ` [PATCH 19/22] " re.emese
2009-12-13 23:59 ` [PATCH 20/22] " re.emese
2009-12-13 23:59 ` [PATCH 21/22] " re.emese
2009-12-13 23:59 ` [PATCH 22/22] " re.emese
2009-12-14  0:38 ` [PATCH 0/1] Constify struct address_space_operations " Matthew Wilcox
2009-12-14  1:33   ` Emese Revfy
2009-12-14  2:19     ` Paul Mundt
2009-12-14  7:08       ` Emese Revfy
2009-12-14 11:26         ` Pavel Machek
2009-12-14 16:00           ` Arjan van de Ven
2009-12-14 16:30             ` Matthew Wilcox
2009-12-14 21:25             ` Pavel Machek
2009-12-14 22:17               ` Arjan van de Ven
2009-12-14 22:21                 ` Pavel Machek
2009-12-14 22:41                 ` Emese Revfy
2009-12-15 18:14                   ` Pavel Machek
2009-12-15 23:28                     ` Emese Revfy
2009-12-16  0:04                       ` Al Viro
2009-12-16  8:06                       ` Pavel Machek
2009-12-16 22:24                         ` Emese Revfy
2009-12-14 23:13             ` Emese Revfy
2009-12-15 10:47               ` Pavel Machek
2009-12-15 19:12             ` Al Viro
2009-12-14 12:36         ` Paul Mundt
2009-12-14 22:20           ` Emese Revfy
2009-12-15  0:01             ` Arjan van de Ven
2009-12-15 23:53               ` Emese Revfy [this message]
2009-12-14 11:18     ` Pavel Machek

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=4B282189.70202@gmail.com \
    --to=re.emese@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=arjan@infradead.org \
    --cc=lethal@linux-sh.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matthew@wil.cx \
    --cc=pavel@ucw.cz \
    --cc=torvalds@linux-foundation.org \
    --cc=viro@zeniv.linux.org.uk \
    /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