public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: LKML <linux-kernel@vger.kernel.org>, Andi Kleen <ak@suse.de>,
	Jan Beulich <jbeulich@novell.com>,
	Eduardo Pereira Habkost <ehabkost@redhat.com>,
	Ian Campbell <ijc@hellion.org.uk>, H Peter Anvin <hpa@zytor.com>,
	Zach Amsden <zach@vmware.com>
Subject: Re: [PATCH 3 of 5] x86/pgtable.h: demacro ptep_set_access_flags
Date: Sat, 2 Feb 2008 10:31:49 +0100	[thread overview]
Message-ID: <20080202093149.GD12044@elte.hu> (raw)
In-Reply-To: <cfac9c32b71b989fe256.1201908326@localhost>


* Jeremy Fitzhardinge <jeremy@goop.org> wrote:

> +static inline int ptep_set_access_flags(struct vm_area_struct *vma,
> +					unsigned long address, pte_t *ptep,
> +					pte_t entry, int dirty)
> +{
> +	int changed = !pte_same(*ptep, entry);
> +	if (changed && dirty) {
> +		*ptep = entry;
> +		pte_update_defer(vma->vm_mm, address, ptep);
> +		flush_tlb_page(vma, address);
> +	}
> +	return changed;
> +}

another thing: these inlines are a bit fat and they are used in more 
than one place. Please move them into pgtable.c. The rule of thumb is: 
if an inline is more than 2 lines big, it is a likely candidate for 
uninlining. (and even many 2-liners, and even some 1-liners are 
candidates) Especially under paravirt the MMU inlines grow these update 
notifiers so they become even fatter.

having functions instead of inlines also simplifies the type 
dependencies by quite a degree.

	Ingo

  parent reply	other threads:[~2008-02-02  9:32 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-01 23:25 [PATCH 0 of 5] x86: add alloc/release_pud; more demacroing Jeremy Fitzhardinge
2008-02-01 23:25 ` [PATCH 1 of 5] x86: rename paravirt_alloc_pt etc after the pagetable structure Jeremy Fitzhardinge
2008-02-01 23:25 ` [PATCH 2 of 5] x86: add pud_alloc for 4-level pagetables Jeremy Fitzhardinge
2008-02-01 23:25 ` [PATCH 3 of 5] x86/pgtable.h: demacro ptep_set_access_flags Jeremy Fitzhardinge
2008-02-02  9:27   ` Ingo Molnar
2008-02-02  9:31   ` Ingo Molnar [this message]
2008-02-02 10:20     ` Jeremy Fitzhardinge
2008-02-01 23:25 ` [PATCH 4 of 5] x86/pgtable.h: demacro ptep_test_and_clear_young Jeremy Fitzhardinge
2008-02-01 23:25 ` [PATCH 5 of 5] x86/pgtable.h: demacro ptep_clear_flush_young Jeremy Fitzhardinge

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=20080202093149.GD12044@elte.hu \
    --to=mingo@elte.hu \
    --cc=ak@suse.de \
    --cc=ehabkost@redhat.com \
    --cc=hpa@zytor.com \
    --cc=ijc@hellion.org.uk \
    --cc=jbeulich@novell.com \
    --cc=jeremy@goop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=zach@vmware.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