[PATCH] x86/mm/pat: Do a small optimization when dump PAT memtype list

2015-07-23 Thread Pan Xinhui
From: Pan Xinhui There are many nodes in the PAT memtype rb-tree. When we dump this tree we call kzalloc every time to copy nodes. Actually these kzalloc are not necessary. Lets do a optimization now. Let seq_file core create an *entry* when open and free it when release. *entry* is stored as

Re: [PATCH] x86/mm/pat: Do a small optimization when dump PAT memtype list

2015-07-23 Thread Pan Xinhui
y, July 23, 2015 4:54 AM >> To: linux-kernel@vger.kernel.org >> Subject: [PATCH] x86/mm/pat: Do a small optimization when dump PAT memtype >> list > ... >> diff --git a/arch/x86/mm/pat.c b/arch/x86/mm/pat.c >> index 268b2c8..6302119 100644 >> --- a/arch/

RE: [PATCH] x86/mm/pat: Do a small optimization when dump PAT memtype list

2015-07-23 Thread Elliott, Robert (Server Storage)
> -Original Message- > From: linux-kernel-ow...@vger.kernel.org [mailto:linux-kernel- > ow...@vger.kernel.org] On Behalf Of Pan Xinhui > Sent: Thursday, July 23, 2015 4:54 AM > To: linux-kernel@vger.kernel.org > Subject: [PATCH] x86/mm/pat: Do a small optimization whe

[PATCH] x86/mm/pat: Do a small optimization when dump PAT memtype list

2015-07-23 Thread Pan Xinhui
From: Pan Xinhui There are many nodes in the PAT memtype rb-tree. When we dump this tree we call kzalloc every time to copy nodes. Actually these kzalloc are not necessary. Lets do a optimization now. Create an *entry* in memtype_seq_start(), and free it in memtype_seq_stop(). These two

Re: [PATCH] x86/mm/pat: Do a small optimization when dump PAT memtype list

2015-07-23 Thread Pan Xinhui
-kernel@vger.kernel.org Subject: [PATCH] x86/mm/pat: Do a small optimization when dump PAT memtype list ... diff --git a/arch/x86/mm/pat.c b/arch/x86/mm/pat.c index 268b2c8..6302119 100644 --- a/arch/x86/mm/pat.c +++ b/arch/x86/mm/pat.c @@ -1001,45 +1001,42 @@ EXPORT_SYMBOL_GPL

[PATCH] x86/mm/pat: Do a small optimization when dump PAT memtype list

2015-07-23 Thread Pan Xinhui
From: Pan Xinhui xinhuix@intel.com There are many nodes in the PAT memtype rb-tree. When we dump this tree we call kzalloc every time to copy nodes. Actually these kzalloc are not necessary. Lets do a optimization now. Let seq_file core create an *entry* when open and free it when release.

RE: [PATCH] x86/mm/pat: Do a small optimization when dump PAT memtype list

2015-07-23 Thread Elliott, Robert (Server Storage)
-Original Message- From: linux-kernel-ow...@vger.kernel.org [mailto:linux-kernel- ow...@vger.kernel.org] On Behalf Of Pan Xinhui Sent: Thursday, July 23, 2015 4:54 AM To: linux-kernel@vger.kernel.org Subject: [PATCH] x86/mm/pat: Do a small optimization when dump PAT memtype list

[PATCH] x86/mm/pat: Do a small optimization when dump PAT memtype list

2015-07-23 Thread Pan Xinhui
From: Pan Xinhui xinhuix@intel.com There are many nodes in the PAT memtype rb-tree. When we dump this tree we call kzalloc every time to copy nodes. Actually these kzalloc are not necessary. Lets do a optimization now. Create an *entry* in memtype_seq_start(), and free it in