Re: [PATCH v4 2/3] mm: Add support for kmem caches in DMA32 zone

2018-12-05 Thread Wei Yang
On Thu, Dec 06, 2018 at 11:55:02AM +0800, Nicolas Boichat wrote: >On Thu, Dec 6, 2018 at 11:32 AM Wei Yang wrote: >> >> On Thu, Dec 06, 2018 at 08:41:36AM +0800, Nicolas Boichat wrote: >> >On Wed, Dec 5, 2018 at 8:18 PM Wei Yang wrote: >> >> >> &

Re: [PATCH v4 2/3] mm: Add support for kmem caches in DMA32 zone

2018-12-05 Thread Wei Yang
On Thu, Dec 06, 2018 at 08:41:36AM +0800, Nicolas Boichat wrote: >On Wed, Dec 5, 2018 at 8:18 PM Wei Yang wrote: >> >> On Wed, Dec 05, 2018 at 03:39:51PM +0800, Nicolas Boichat wrote: >> >On Wed, Dec 5, 2018 at 3:25 PM Wei Yang wrote: >> >> >> >> O

Re: [PATCH v4 2/3] mm: Add support for kmem caches in DMA32 zone

2018-12-05 Thread Wei Yang
On Wed, Dec 05, 2018 at 03:39:51PM +0800, Nicolas Boichat wrote: >On Wed, Dec 5, 2018 at 3:25 PM Wei Yang wrote: >> >> On Wed, Dec 05, 2018 at 01:48:27PM +0800, Nicolas Boichat wrote: >> >In some cases (e.g. IOMMU ARMv7s page allocator), we need to allocate >> >da

Re: [PATCH v4 2/3] mm: Add support for kmem caches in DMA32 zone

2018-12-05 Thread Wei Yang
On Wed, Dec 05, 2018 at 03:39:51PM +0800, Nicolas Boichat wrote: >On Wed, Dec 5, 2018 at 3:25 PM Wei Yang wrote: >> >> On Wed, Dec 05, 2018 at 01:48:27PM +0800, Nicolas Boichat wrote: >> >In some cases (e.g. IOMMU ARMv7s page allocator), we need to allocate >> >da

Re: [PATCH v4 2/3] mm: Add support for kmem caches in DMA32 zone

2018-12-04 Thread Wei Yang
; { > return sprintf(buf, "%u\n", s->usersize); >@@ -5435,6 +5446,9 @@ static struct attribute *slab_attrs[] = { > #ifdef CONFIG_ZONE_DMA > _dma_attr.attr, > #endif >+#ifdef CONFIG_ZONE_DMA32 >+ _dma32_attr.attr, >+#endif > #ifdef CONFIG_NU

Re: [PATCH] iommu: narrow the search range by iterating on current bus

2016-09-28 Thread Wei Yang
Ping~ Hope you like it :-) On Thu, Aug 18, 2016 at 11:00:26PM +, Wei Yang wrote: >Hi, Alex & Bjorn, > >I tried to measure the effect of the improvement and looks good. > >+---+---+---+---+ >|Platform Info |Before(ns) |A

Re: [PATCH] iommu: narrow the search range by iterating on current bus

2016-08-18 Thread Wei Yang
__func__, ts2.tv_sec - ts1.tv_sec, ts2.tv_nsec - ts1.tv_nsec); if (group) return group; On Fri, Aug 05, 2016 at 02:03:17PM +, Wei Yang wrote: >On Thu, Jul 28, 2016 at 09:01:32AM -0600, Alex Williamson wrote: >>On Thu, 28 Jul 2016 14:52:59 + >>Wei Ya

Re: [PATCH] iommu: narrow the search range by iterating on current bus

2016-08-05 Thread Wei Yang
On Thu, Jul 28, 2016 at 09:01:32AM -0600, Alex Williamson wrote: >On Thu, 28 Jul 2016 14:52:59 +0000 >Wei Yang <richard.weiy...@gmail.com> wrote: > >> According to the comments and code, get_pci_function_alias_group() and >> get_pci_alias_group() do the search on the

[PATCH 1/2] PCI: add a function to walk on local bus

2016-08-05 Thread Wei Yang
Add a function to just walk on the local bus. Signed-off-by: Wei Yang <richard.weiy...@gmail.com> --- drivers/pci/bus.c | 26 +- include/linux/pci.h | 2 ++ 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/drivers/pci/bus.c b/drivers/pci/bus.c

[PATCH 2/2] iommu: narrow the search range by iterating on current bus

2016-08-05 Thread Wei Yang
in comment. Signed-off-by: Wei Yang <richard.weiy...@gmail.com> --- drivers/iommu/iommu.c | 100 +++--- 1 file changed, 63 insertions(+), 37 deletions(-) diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c index 351..2fae2c6 100644 --- a/drivers

[PATCH] iommu: narrow the search range by iterating on current bus

2016-07-28 Thread Wei Yang
in comment. Signed-off-by: Wei Yang <richard.weiy...@gmail.com> --- drivers/iommu/iommu.c | 22 -- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c index 351..0338a81 100644 --- a/drivers/iommu/iommu.c +++ b/drivers

[PATCH] iommu/vt-d: return error code in domain_context_mapping_one()

2016-07-13 Thread Wei Yang
In 'commit <55d940430ab9> ("iommu/vt-d: Get rid of domain->iommu_lock")', the error handling path is changed a little, which makes the function always return 0. This path fixes this. Signed-off-by: Wei Yang <richard.weiy...@gmail.com> --- drivers/iommu/intel-iommu.c |

Re: [PATCH] iommu/vt-d: reduce extra first level entry in iommu->domains

2016-06-16 Thread Wei Yang
On Wed, Jun 15, 2016 at 01:39:21PM +0200, Joerg Roedel wrote: >On Tue, May 24, 2016 at 11:06:55PM +0000, Wei Yang wrote: >> Hi, Joerg >> >> Not sure whether you think this calculation is correct. >> >> If I missed something for this " + 1" in your for

[PATCH v2 2/2] iommu/vt-d: use marco for dmar_domain's second level size and shift

2016-05-27 Thread Wei Yang
In the origin commit, the size of the second level is hard coded to an integer, 256. This patch defines two marco for the second level size and shift. Signed-off-by: Wei Yang <richard.weiy...@gmail.com> --- drivers/iommu/intel-iommu.c | 12 ++-- include/linux/intel-iommu.h | 2

[PATCH v2 0/2] fix and cleanup for iommu/vt-d

2016-05-27 Thread Wei Yang
<robin.mur...@arm.com> * adds patch 2 for comment Wei Yang (2): iommu/vt-d: reduce extra first level entry in iommu->domains iommu/vt-d: use marco for dmar_domain's second level size and shift drivers/iommu/intel-iommu.c | 12 ++-- include/linux/intel-iommu.h | 2 ++ 2 file

[PATCH v2 1/2] iommu/vt-d: reduce extra first level entry in iommu->domains

2016-05-27 Thread Wei Yang
current implementation. This patch refines this calculation to reduce the extra first level entry when ndomains is exact a multiple of 256. Signed-off-by: Wei Yang <richard.weiy...@gmail.com> --- drivers/iommu/intel-iommu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff

Re: [PATCH] iommu/vt-d: reduce extra first level entry in iommu->domains

2016-05-26 Thread Wei Yang
On Thu, May 26, 2016 at 11:11:51AM +0100, Robin Murphy wrote: >On 25/05/16 22:43, Wei Yang wrote: >>On Wed, May 25, 2016 at 11:17:49AM +0100, Robin Murphy wrote: >>>On 25/05/16 00:06, Wei Yang wrote: >>>>Hi, Joerg >>>> >>>>Not sure whethe

Re: [PATCH] iommu/vt-d: reduce extra first level entry in iommu->domains

2016-05-25 Thread Wei Yang
On Wed, May 25, 2016 at 11:17:49AM +0100, Robin Murphy wrote: >On 25/05/16 00:06, Wei Yang wrote: >>Hi, Joerg >> >>Not sure whether you think this calculation is correct. >> >>If I missed something for this " + 1" in your formula, I am glad to hea

Re: [PATCH] iommu/vt-d: reduce extra first level entry in iommu->domains

2016-05-24 Thread Wei Yang
Hi, Joerg Not sure whether you think this calculation is correct. If I missed something for this " + 1" in your formula, I am glad to hear your explanation. So that I could learn something from you :-) Have a good day~ On Sat, May 21, 2016 at 02:41:51AM +, Wei Yang wrote:

[PATCH] iommu/vt-d: reduce extra first level entry in iommu->domains

2016-05-20 Thread Wei Yang
current implementation. This patch refines this calculation to reduce the extra first level entry. Signed-off-by: Wei Yang <richard.weiy...@gmail.com> --- drivers/iommu/intel-iommu.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iommu/intel-iommu.c b/drive

Re: [PATCH V4 0/4] Code refine for Intel IOMMU

2016-05-09 Thread Wei Yang
On Mon, May 09, 2016 at 01:24:02PM +0200, Joerg Roedel wrote: >On Sun, May 08, 2016 at 01:22:53PM +0000, Wei Yang wrote: >> >Wei Yang (4): >> > iommu/vt-d: replace *hdr with {drhd/atsr}[0] in struct >> >dmar_{drhd/atsr}_unit >> > iommu/vt-d: us

Re: [PATCH V4 0/4] Code refine for Intel IOMMU

2016-05-08 Thread Wei Yang
Ping~ On Thu, Apr 14, 2016 at 02:55:06PM +, Wei Yang wrote: >These four patches try to refine the Intel IO

[PATCH V4 4/4] iommu/vt-d: refine dmar_acpi_dev_scope_init() with dmar_walk_dmar_table()

2016-04-14 Thread Wei Yang
dmar_acpi_dev_scope_init() iterates on the remapping structure and just do proper job for ANDD structure. This is the what dmar_walk_dmar_table() does. This patch improves the code with dmar_walk_dmar_table(). Signed-off-by: Wei Yang <richard.weiy...@gmail.com> --- drivers/iommu/dmar.c

[PATCH V4 3/4] iommu/vt-d: check Register Base Address at the beginning of dmar_parse_one_drhd()

2016-04-14 Thread Wei Yang
(), so that it notices this is an invalid dmar and avoids related setup jobs. Signed-off-by: Wei Yang <richard.weiy...@gmail.com> --- drivers/iommu/dmar.c | 34 +- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/drivers/iommu/dmar.c b/drivers

[PATCH V4 2/4] iommu/vt-d: use zero-sized array in DMAR related ACPI structures

2016-04-14 Thread Wei Yang
audience friendly. Signed-off-by: Wei Yang <richard.weiy...@gmail.com> --- drivers/iommu/dmar.c| 22 ++ drivers/iommu/intel-iommu.c |8 include/acpi/actbl2.h | 33 +++-- 3 files changed, 33 insertions(+), 30 del

[PATCH V4 1/4] iommu/vt-d: replace *hdr with {drhd/atsr}[0] in struct dmar_{drhd/atsr}_unit

2016-04-14 Thread Wei Yang
n dmar_table_detect() Signed-off-by: Wei Yang <richard.weiy...@gmail.com> --- drivers/iommu/dmar.c| 17 + drivers/iommu/intel-iommu.c | 18 +- drivers/iommu/intel_irq_remapping.c | 10 -- include/linux/dmar.h

[PATCH V4 0/4] Code refine for Intel IOMMU

2016-04-14 Thread Wei Yang
: * add similar change for struct dmar_atsr_unit in patch 1 * add similar change for rmrr and atsr in patch 2 V3: * change hdr to drhd from type acpi_dmar_header to acpi_dmar_hardware_unit * add reason in changelog for the change in Patch 1 V2: * add patch 3 and 4 Wei Yang (4): iommu/vt

Re: [Patch V2 2/2] iommu: remove sysfs_link to device in iommu_group/devices when failed

2016-03-24 Thread Wei Yang
On Wed, Mar 23, 2016 at 05:04:15PM -0600, Alex Williamson wrote: >On Wed, 23 Mar 2016 22:25:11 +0000 >Wei Yang <richard.weiy...@gmail.com> wrote: > >> The original code forgets to remove the sysfs_link to a device in >> iommu_group/devices directory, when the

Re: [PATCH] iommu: remove the iommu_callback_data

2016-03-23 Thread Wei Yang
Obsolete this one, V2 is sent. On Sun, Mar 20, 2016 at 01:57:52AM +, Wei Yang wrote: >According to the code path, iommu_callback_data is passed in >iommu_bus_init() and just used in {add/remove}_iommu_group, by when the >bus->iommu_ops is already set up properly. > >

[Patch V2 0/2] Cleanup on IOMMU

2016-03-23 Thread Wei Yang
This two patches tries to do some cleanup in iommu. V2: * add patch 2 Wei Yang (2): iommu: remove the iommu_callback_data iommu: remove sysfs_link to device in iommu_group/devices when failed drivers/iommu/iommu.c | 22 +++--- 1 file changed, 7 insertions(+), 15

[Patch V2 2/2] iommu: remove sysfs_link to device in iommu_group/devices when failed

2016-03-23 Thread Wei Yang
The original code forgets to remove the sysfs_link to a device in iommu_group/devices directory, when the creation fails or conflicts on the name. This patch tries to remove the sysfs_link on the failure. Signed-off-by: Wei Yang <richard.weiy...@gmail.com> --- drivers/iommu/iommu.c |

[Patch V2 1/2] iommu: remove the iommu_callback_data

2016-03-23 Thread Wei Yang
According to the code path, iommu_callback_data is passed in iommu_bus_init() and just used in {add/remove}_iommu_group, by when the bus->iommu_ops is already set up properly. This patch removes the iommu_callback_data by retrieving iommu_ops from bus->iommu_ops directly. Signed-off-b

[Patch V3 3/4] iommu/vt-d: check Register Base Address at the beginning of dmar_parse_one_drhd()

2016-03-23 Thread Wei Yang
(), so that it notices this is an invalid dmar and avoids related setup jobs. Signed-off-by: Wei Yang <richard.weiy...@gmail.com> --- drivers/iommu/dmar.c | 34 +- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/drivers/iommu/dmar.c b/drivers

[Patch V3 4/4] iommu/vt-d: refine dmar_acpi_dev_scope_init() with dmar_walk_dmar_table()

2016-03-23 Thread Wei Yang
dmar_acpi_dev_scope_init() iterates on the remapping structure and just do proper job for ANDD structure. This is the what dmar_walk_dmar_table() does. This patch improves the code with dmar_walk_dmar_table(). Signed-off-by: Wei Yang <richard.weiy...@gmail.com> --- drivers/iommu/dmar.c

[Patch V3 0/4] Code refine for Intel IOMMU

2016-03-23 Thread Wei Yang
: * change hdr to drhd from type acpi_dmar_header to acpi_dmar_hardware_unit * add reason in changelog for the change in Patch 1 V2: * add patch 3 and 4 Wei Yang (4): iommu/vt-d: replace *hdr with drhd[0] in struct dmar_drhd_unit iommu/vt-d: use zero-sized array in DMAR related ACPI

[Patch V3 2/4] iommu/vt-d: use zero-sized array in DMAR related ACPI structures

2016-03-23 Thread Wei Yang
-sized array is usually used for this purpose. This patch adds zero-sized array for variable elements in DMAR ACPI structures, which tries to make the code more audience friendly. Signed-off-by: Wei Yang <richard.weiy...@gmail.com> --- drivers/iommu/dmar.c | 22 ++ i

[Patch V3 1/4] iommu/vt-d: replace *hdr with drhd[0] in struct dmar_drhd_unit

2016-03-23 Thread Wei Yang
t reflects the real data type contained in dmar_drhd_unit and avoid some type cast between them. Besides this, this patch includes another change: * remove redundant type cast to the same type in dmar_table_detect() Signed-off-by: Wei Yang <richard.weiy...@gmail.com> --- drivers/iommu/dma

Re: [Patch V2 1/4] iommu/vt-d: replace *hdr with hdr[0] in struct dmar_drhd_unit

2016-03-21 Thread Wei Yang
On Mon, Mar 21, 2016 at 05:53:15PM +0100, Thomas Gleixner wrote: >On Mon, 21 Mar 2016, Wei Yang wrote: >> On Sun, Mar 20, 2016 at 04:42:29PM +0100, Thomas Gleixner wrote: >> >On Sun, 20 Mar 2016, Wei Yang wrote: >> > >> >> hdr in struct dmar_drhd_unit

Re: [Patch V2 1/4] iommu/vt-d: replace *hdr with hdr[0] in struct dmar_drhd_unit

2016-03-21 Thread Wei Yang
Hi, Thomas Glad to receive your comment. Please see my reply below. On Sun, Mar 20, 2016 at 04:42:29PM +0100, Thomas Gleixner wrote: >On Sun, 20 Mar 2016, Wei Yang wrote: > >> hdr in struct dmar_drhd_unit is used to point the DMAR hardware unit copied >> at the end of struct d

Re: [PATCH 1/2] iommu/vt-d: replace *hdr with hdr[0] in struct dmar_drhd_unit

2016-03-20 Thread Wei Yang
Obsolete this one. V2 is sent. On Sat, Mar 12, 2016 at 09:57:38PM +, Wei Yang wrote: >hdr in struct dmar_drhd_unit is used to point the DMAR hardware unit copied >at the end of struct dmar_drhd_unit. One zero-sized array may be more >elegant for this purpose. > >This pat

[Patch V2 2/4] iommu/vt-d: use zero-sized array in DMAR related ACPI structures

2016-03-20 Thread Wei Yang
-sized array is usually used for this purpose. This patch adds zero-sized array for variable elements in DMAR ACPI structures, which tries to make the code more audience friendly. Signed-off-by: Wei Yang <richard.weiy...@gmail.com> --- drivers/iommu/dmar.c | 22 ++ i

[Patch V2 4/4] iommu/vt-d: refine dmar_acpi_dev_scope_init() with dmar_walk_dmar_table()

2016-03-20 Thread Wei Yang
dmar_acpi_dev_scope_init() iterates on the remapping structure and just do proper job for ANDD structure. This is the what dmar_walk_dmar_table() does. This patch improves the code with dmar_walk_dmar_table(). Signed-off-by: Wei Yang <richard.weiy...@gmail.com> --- drivers/iommu/dmar.c

[Patch V2 1/4] iommu/vt-d: replace *hdr with hdr[0] in struct dmar_drhd_unit

2016-03-20 Thread Wei Yang
unnecessary type cast in dmar_table_detect() 2. type cast from acpi_dmar_header to acpi_dmar_hardware_unit directly Signed-off-by: Wei Yang <richard.weiy...@gmail.com> --- drivers/iommu/dmar.c | 15 --- include/linux/dmar.h |2 +- 2 files changed, 5 insertions(+), 12 del

[Patch V2 0/4] Code refine for Intel IOMMU

2016-03-20 Thread Wei Yang
easy to understand. V2: * add patch 3 and 4 Wei Yang (4): iommu/vt-d: replace *hdr with hdr[0] in struct dmar_drhd_unit iommu/vt-d: use zero-sized array in DMAR related ACPI structures iommu/vt-d: check Register Base Address at the beginning of dmar_parse_one_drhd() iommu/vt-d: refine

[PATCH] iommu: remove the iommu_callback_data

2016-03-19 Thread Wei Yang
According to the code path, iommu_callback_data is passed in iommu_bus_init() and just used in {add/remove}_iommu_group, by when the bus->iommu_ops is already set up properly. This patch removes the iommu_callback_data by retrieving iommu_ops from bus->iommu_ops directly. Signed-off-b

[PATCH 1/2] iommu/vt-d: replace *hdr with hdr[0] in struct dmar_drhd_unit

2016-03-19 Thread Wei Yang
unnecessary type cast in dmar_table_detect() 2. type cast from acpi_dmar_header to acpi_dmar_hardware_unit directly Signed-off-by: Wei Yang <richard.weiy...@gmail.com> --- drivers/iommu/dmar.c | 15 --- include/linux/dmar.h | 2 +- 2 files changed, 5 insertions(+), 12 del

[PATCH 2/2] iommu/vt-d: use zero-sized array in DMAR related ACPI structures

2016-03-18 Thread Wei Yang
-sized array is usually used for this purpose. This patch adds zero-sized array for variable elements in DMAR ACPI structures, which tries to make the code more audience friendly. Signed-off-by: Wei Yang <richard.weiy...@gmail.com> --- drivers/iommu/dmar.c | 22 ++ i