From: Thomas Schlichter <thomas.schlichter@web.de>
To: Suresh Siddha <suresh.b.siddha@intel.com>
Cc: Jan Beulich <JBeulich@novell.com>,
Arjan van de Ven <arjan@linux.intel.com>,
"dri-devel@lists.sourceforge.net"
<dri-devel@lists.sourceforge.net>,
Robert Hancock <hancockrwd@gmail.com>,
Henrique de Moraes Holschuh <hmh@hmh.eng.br>,
"H. Peter Anvin" <hpa@zytor.com>,
"jbarnes@virtuousgeek.org" <jbarnes@virtuousgeek.org>,
Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Ingo Molnar <mingo@elte.hu>, Ingo Molnar <mingo@redhat.com>,
Thomas Gleixner <tglx@linutronix.de>,
Thomas Hellstrom <thellstrom@vmware.com>,
Tejun Heo <tj@kernel.org>,
"Pallipadi, Venkatesh" <venkatesh.pallipadi@intel.com>,
"x86@kernel.org" <x86@kernel.org>,
Yinghai Lu <yinghai@kernel.org>
Subject: Re: [RFC Patch] use MTRR for write combining if PAT is not available
Date: Thu, 22 Oct 2009 14:08:31 +0200 [thread overview]
Message-ID: <1395763521@web.de> (raw)
Suresh Siddha wrote:
> On Wed, 2009-10-21 at 13:01 -0700, Thomas Schlichter wrote:
> > OK, so I think the attached patches should do it. Hopefully I have addressed
> > all your comments.
>
> Thomas,
>
> I have couple of issues with this patchset still. pci_mmap_page_range()
> doesn't get called for each fork(). So, we won't be ref counting the
> mtrr usage properly.
When forking, what happens with the "struct file"? If it is being copied, then the
processes share the same private data which would be freed during the first
release(). I think this would be a problem whereever file-private data are used.
So I think it must be shared between the forked processes and some reference
counting must exist. This reference counting must ensure that release() is only
called when all processes did close() their file.
And in that case (shared "struct file", one single release() call in the end) this
implementation should be completely safe...
> I need to think a bit more carefully on this. Can I get back to you
> early next week on this, as I am traveling and need to think through
> this?
Of course you can. But as I do this just in my spare time, I can only work on this
in the evenings...
> We already keep track of some of the PAT ref counting using
> track_pfn_vma_copy(). And we need to extend/use something similar here.
>
> Even if we need to extend sysfs or pci vma ops, we need to increment and
> decrement the ref count of the mtrr register that gets used.
The MTRR register ref count is already incremented with each mtrr_add() or
mtrr_add_page() that has the "increment" parameter set to true. Which is the
case in my implementation.
> There is no need to go through num_var_ranges etc.
Well I have to remember wich file added which MTRR entries. Because I have
to remove them if the file is being closed. Therefore I need an array of size
"num_var_ranges" (or MTRR_MAX_VAR_RANGES which is the uper bound).
Btw. if there really is a problem in my reference counting code, it also exists in
the current code in:
arch/x86/kernel/cpu/mtrr/if.c
My patch borrows its ref-counting parts from there...
Kind regards,
Thomas
next reply other threads:[~2009-10-22 12:08 UTC|newest]
Thread overview: 60+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-22 12:08 Thomas Schlichter [this message]
2009-10-22 12:14 ` [RFC Patch] use MTRR for write combining if PAT is not available H. Peter Anvin
2009-10-22 13:26 ` Suresh Siddha
2009-10-22 13:35 ` Suresh Siddha
-- strict thread matches above, loose matches on Subject: below --
2009-10-22 14:41 Thomas Schlichter
2009-10-22 14:27 Thomas Schlichter
2009-10-21 14:38 Thomas Schlichter
2009-10-21 15:14 ` Jan Beulich
2009-10-21 13:45 Thomas Schlichter
2009-10-21 14:11 ` Jan Beulich
2009-10-21 17:35 ` Ingo Molnar
2009-10-21 20:01 ` Thomas Schlichter
2009-10-22 9:53 ` Suresh Siddha
2009-10-22 15:34 ` Eric Anholt
2009-10-22 21:47 ` Suresh Siddha
2009-10-22 23:10 ` Jesse Barnes
2009-10-23 0:11 ` Suresh Siddha
2009-10-23 1:53 ` Eric Anholt
2009-10-23 4:31 ` Jesse Barnes
2009-10-23 4:58 ` Suresh Siddha
2009-10-23 7:24 ` Thomas Schlichter
2009-10-23 14:24 ` Suresh Siddha
2009-10-23 14:37 ` Ingo Molnar
2009-10-23 4:33 ` Suresh Siddha
2009-10-19 15:10 Thomas Schlichter
2009-10-19 15:28 ` Ingo Molnar
2009-10-19 15:07 Thomas Schlichter
2009-10-19 14:59 Thomas Schlichter
2009-10-19 15:31 ` Ingo Molnar
2009-10-19 21:49 ` Suresh Siddha
2009-10-20 20:35 ` Thomas Schlichter
2009-10-20 21:59 ` Suresh Siddha
2009-10-21 11:52 ` Ingo Molnar
2009-10-19 14:47 Thomas Schlichter
2009-10-20 19:54 ` Thomas Schlichter
2009-10-21 11:57 ` Ingo Molnar
2009-10-13 7:34 Jan Beulich
2009-10-13 21:29 ` Thomas Schlichter
2009-10-14 8:13 ` Jan Beulich
2009-10-14 19:14 ` Thomas Schlichter
2009-10-15 7:48 ` Jan Beulich
2009-10-17 19:48 ` Thomas Schlichter
2009-10-19 9:16 ` Jan Beulich
2009-10-19 13:44 ` Suresh Siddha
2009-10-19 13:54 ` Ingo Molnar
2009-10-19 13:36 ` Konrad Rzeszutek Wilk
[not found] <200910122032.52168.thomas.schlichter@web.de>
2009-10-12 19:16 ` Thomas Hellstrom
2009-10-12 19:45 ` Thomas Schlichter
[not found] ` <1255378684.2063.5.camel@gaiman.anholt.net>
2009-10-13 21:05 ` Thomas Schlichter
2009-10-10 1:22 Thomas Schlichter
2009-10-10 4:24 ` Arjan van de Ven
2009-10-10 8:31 ` Thomas Schlichter
2009-10-10 15:45 ` Arjan van de Ven
2009-10-10 17:50 ` Roland Dreier
2009-10-11 7:40 ` Ingo Molnar
2009-10-11 9:56 ` Thomas Schlichter
2009-10-11 18:51 ` Henrique de Moraes Holschuh
2009-10-11 18:54 ` Arjan van de Ven
2009-10-11 20:19 ` Henrique de Moraes Holschuh
2009-10-12 18:09 ` Robert Hancock
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=1395763521@web.de \
--to=thomas.schlichter@web.de \
--cc=JBeulich@novell.com \
--cc=arjan@linux.intel.com \
--cc=dri-devel@lists.sourceforge.net \
--cc=hancockrwd@gmail.com \
--cc=hmh@hmh.eng.br \
--cc=hpa@zytor.com \
--cc=jbarnes@virtuousgeek.org \
--cc=jeremy.fitzhardinge@citrix.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=mingo@redhat.com \
--cc=suresh.b.siddha@intel.com \
--cc=tglx@linutronix.de \
--cc=thellstrom@vmware.com \
--cc=tj@kernel.org \
--cc=venkatesh.pallipadi@intel.com \
--cc=x86@kernel.org \
--cc=yinghai@kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.