From: ebiederm@xmission.com (Eric W. Biederman)
To: "Satyam Sharma" <satyam.sharma@gmail.com>
Cc: "Pekka Enberg" <penberg@cs.helsinki.fi>,
"Michael Tokarev" <mjt@tls.msk.ru>,
"Shani Moideen" <shani.moideen@wipro.com>,
ebiederm@xmission.com, linux-kernel@vger.kernel.org,
kernel-janitors@lists.osdl.org
Subject: Re: [KJ PATCH] Replacing memset(<addr>,0,PAGE_SIZE) with clear_page() in kernel/kexec.c
Date: Tue, 08 May 2007 11:40:53 -0600 [thread overview]
Message-ID: <m1odkvi57e.fsf@ebiederm.dsl.xmission.com> (raw)
In-Reply-To: <a781481a0705081013q7b54906dsdf28d922e198a463@mail.gmail.com> (Satyam Sharma's message of "Tue, 8 May 2007 10:13:52 -0700")
"Satyam Sharma" <satyam.sharma@gmail.com> writes:
> On 5/8/07, Pekka Enberg <penberg@cs.helsinki.fi> wrote:
>> Shani Moideen wrote:
>> > > ptr = kmap(page);
>> > > - memset(ptr, 0, PAGE_SIZE);
>> > > + clear_page(ptr);
>>
>> On 5/8/07, Michael Tokarev <mjt@tls.msk.ru> wrote:
>> > I wonder if it's worth to invent kzmap() or something like that... ;)
>>
>> I am counting 59 kmap + memset pairs in the kernel, so perhaps it is
>> worth it to reduce kernel text size.
>
> Stuff of the sort already exists. Look for clear_highpage(),
> clear_user_highpage() and memclear_highpage_flush (recently renamed to
> zero_user_page, see -mm). But they all use kmap_atomic() -- kmap()
> variants would have to be added. Also, they're all inlines, so I'm not
> sure you'd be able to cut down text size, but still getting rid of
> open-coding is always good.
In this instance a clear_page variant should be ok. The combined
variants are likely not because I use the mapping after it is cleared.
Eric
prev parent reply other threads:[~2007-05-08 17:42 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-08 10:50 [KJ PATCH] Replacing memset(<addr>,0,PAGE_SIZE) with clear_page() in kernel/kexec.c Shani Moideen
2007-05-08 11:10 ` Michael Tokarev
2007-05-08 12:21 ` Pekka Enberg
2007-05-08 17:13 ` Satyam Sharma
2007-05-08 17:40 ` Eric W. Biederman [this message]
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=m1odkvi57e.fsf@ebiederm.dsl.xmission.com \
--to=ebiederm@xmission.com \
--cc=kernel-janitors@lists.osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mjt@tls.msk.ru \
--cc=penberg@cs.helsinki.fi \
--cc=satyam.sharma@gmail.com \
--cc=shani.moideen@wipro.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