mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Arvind Yadav <arvind.yadav.cs@gmail.com>
To: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
Cc: minchan@kernel.org, ngupta@vflare.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] zram: constify attribute_group structures.
Date: Mon, 3 Jul 2017 16:00:24 +0530	[thread overview]
Message-ID: <11272aaf-edac-4463-c0a9-de509d8901d6@gmail.com> (raw)
In-Reply-To: <20170703090047.GB517@jagdpanzerIV.localdomain>

Hi,


On Monday 03 July 2017 02:30 PM, Sergey Senozhatsky wrote:
> On (07/03/17 11:43), Arvind Yadav wrote:
>> attribute_groups are not supposed to change at runtime. All functions
>> working with attribute_groups provided by <linux/sysfs.h> work with const
>> attribute_group. So mark the non-const structs as const.
>>
>> File size before:
>>     text	   data	    bss	    dec	    hex	filename
>>     8293	    841	      4	   9138	   23b2	drivers/block/zram/zram_drv.o
>>
>> File size After adding 'const':
>>     text	   data	    bss	    dec	    hex	filename
>>     8357	    777	      4	   9138	   23b2	drivers/block/zram/zram_drv.o
> sorry, what exactly is the improvement here?
> we grew .text bigger, why should we be happy about it?
Yes, .text size is increased but .data size got decreased.
Overall size will be same. the text segment is often read-only,
to prevent a program from accidentally modifying its instructions.
Here, attribute_group should be const.
> 	-ss
Thanks,
~arvind

  reply	other threads:[~2017-07-03 10:30 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-03  6:13 Arvind Yadav
2017-07-03  6:27 ` Minchan Kim
2017-07-03  7:18   ` Arvind Yadav
2017-07-03  9:00 ` Sergey Senozhatsky
2017-07-03 10:30   ` Arvind Yadav [this message]
2017-07-03 12:04     ` Sergey Senozhatsky

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=11272aaf-edac-4463-c0a9-de509d8901d6@gmail.com \
    --to=arvind.yadav.cs@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=minchan@kernel.org \
    --cc=ngupta@vflare.org \
    --cc=sergey.senozhatsky.work@gmail.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

all inboxes | Powered by JetHome®