public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Masami Hiramatsu <mhiramat@redhat.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Nick Piggin <npiggin@suse.de>,
	Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>,
	akpm <akpm@linux-foundation.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Ingo Molnar <mingo@elte.hu>,
	Ananth N Mavinakayanahalli <ananth@in.ibm.com>,
	Jim Keniston <jkenisto@us.ibm.com>
Subject: Re: irq-disabled vs vmap vs text_poke
Date: Tue, 17 Feb 2009 12:13:47 -0500	[thread overview]
Message-ID: <499AF04B.9040803@redhat.com> (raw)
In-Reply-To: <1234859516.4744.12.camel@laptop>

Peter Zijlstra wrote:
> On Tue, 2009-02-17 at 04:03 +0100, Nick Piggin wrote:
> 
>> It is not a bad idea, but I don't think it quite goes far enough.
>> IMO we should reserve 2 pages of virtual memory for each CPU, and
>> then do the mapping/unmapping without locking, and with another
>> variant of unmap_kernel_range that does not do the global TLB
>> flush.
> 
> A bit like kmap_atomic() except for 2 pages and !highmem. Should work.

Hmm, I checked up the kmap_atomic(), but all kernel text
is not on the highmem.

So, what about changing kmap_atomic_prot() implementation as below?

- If the page is !highmem *and the page's prot is same as caller specified prot*,
  just returns page_address(page).
- Add 2 continuous km_types for text_poke().

Then, text_poke() can use it.
---
vaddr = kmap_atomic_prot(page[0], KM_TEXT_POKE0, PAGE_KERNEL);
if(nr_pages > 1)
	vaddr1 = kmap_atomic_prot(page[1], KM_TEXT_POKE1, PAGE_KERNEL);
< change text >
if(nr_pages > 1)
	kunmap_atomic(vaddr1, KM_TEXT_POKE1);
kunmap_atomic(vaddr, KM_TEXT_POKE0);
---

Thank you,

-- 
Masami Hiramatsu

Software Engineer
Hitachi Computer Products (America) Inc.
Software Solutions Division

e-mail: mhiramat@redhat.com


  reply	other threads:[~2009-02-17 17:14 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-13 12:50 irq-disabled vs vmap vs text_poke Peter Zijlstra
2009-02-13 12:55 ` Nick Piggin
2009-02-13 13:02   ` Peter Zijlstra
2009-02-13 13:04     ` Ingo Molnar
2009-02-13 14:25       ` Mathieu Desnoyers
2009-02-13 14:33         ` Peter Zijlstra
2009-02-13 14:43           ` Mathieu Desnoyers
2009-02-13 18:05             ` Ingo Molnar
2009-02-13 13:05     ` Peter Zijlstra
2009-02-13 13:09       ` Nick Piggin
2009-02-13 14:18 ` Mathieu Desnoyers
2009-02-13 14:28   ` Peter Zijlstra
2009-02-13 16:32   ` Masami Hiramatsu
2009-02-13 16:38     ` Peter Zijlstra
2009-02-13 16:55     ` Mathieu Desnoyers
2009-02-13 18:14       ` Masami Hiramatsu
2009-02-13 18:57         ` Mathieu Desnoyers
2009-02-13 21:41           ` Masami Hiramatsu
2009-02-16 15:04             ` Masami Hiramatsu
2009-02-16 15:31               ` Nick Piggin
2009-02-16 17:24                 ` Mathieu Desnoyers
2009-02-17  2:00                   ` Masami Hiramatsu
2009-02-17  3:03                     ` Nick Piggin
2009-02-17  8:31                       ` Peter Zijlstra
2009-02-17 17:13                         ` Masami Hiramatsu [this message]
2009-02-17 16:48                       ` Masami Hiramatsu
2009-02-17 17:02                         ` Steven Rostedt
2009-02-17 17:18                           ` Mathieu Desnoyers
2009-02-17 17:24                             ` Steven Rostedt
2009-02-17 17:28                               ` Mathieu Desnoyers
2009-02-17 17:48                                 ` Steven Rostedt
2009-02-13 14:27 ` [PATCH] x86: text_poke might sleep Mathieu Desnoyers

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=499AF04B.9040803@redhat.com \
    --to=mhiramat@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=ananth@in.ibm.com \
    --cc=jkenisto@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@polymtl.ca \
    --cc=mingo@elte.hu \
    --cc=npiggin@suse.de \
    --cc=peterz@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