lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date: Mon, 3 Jun 2024 10:28:27 +0300 (EEST)
From: Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
To: Chia-I Wu <olvaffe@...il.com>
cc: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>, 
    amd-gfx@...ts.freedesktop.org, dri-devel@...ts.freedesktop.org, 
    christian.koenig@....com, alexander.deucher@....com, 
    Greg Kroah-Hartman <gregkh@...uxfoundation.org>, 
    Alison Schofield <alison.schofield@...el.com>, 
    Dave Jiang <dave.jiang@...el.com>, Baoquan He <bhe@...hat.com>, 
    LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] kernel/resource: optimize find_next_iomem_res

On Fri, 31 May 2024, Chia-I Wu wrote:
> On Fri, May 31, 2024 at 1:57 AM Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
> wrote:
>       On Thu, May 30, 2024 at 10:36:57PM -0700, Chia-I Wu wrote:
>       > We can skip children resources when the parent resource does not cover
>       > the range.
>       >
>       > This should help vmf_insert_* users on x86, such as several DRM
>       drivers.
>       > On my AMD Ryzen 5 7520C, when streaming data from cpu memory into
>       amdgpu
>       > bo, the throughput goes from 5.1GB/s to 6.6GB/s.  perf report says
>       >
>       >   34.69%--__do_fault
>       >   34.60%--amdgpu_gem_fault
>       >   34.00%--ttm_bo_vm_fault_reserved
>       >   32.95%--vmf_insert_pfn_prot
>       >   25.89%--track_pfn_insert
>       >   24.35%--lookup_memtype
>       >   21.77%--pat_pagerange_is_ram
>       >   20.80%--walk_system_ram_range
>       >   17.42%--find_next_iomem_res
>       >
>       > before this change, and
>       >
>       >   26.67%--__do_fault
>       >   26.57%--amdgpu_gem_fault
>       >   25.83%--ttm_bo_vm_fault_reserved
>       >   24.40%--vmf_insert_pfn_prot
>       >   14.30%--track_pfn_insert
>       >   12.20%--lookup_memtype
>       >   9.34%--pat_pagerange_is_ram
>       >   8.22%--walk_system_ram_range
>       >   5.09%--find_next_iomem_res
>       >
>       > after.
> 
>       Is there any documentation that explicitly says that the children
>       resources
>       must not overlap parent's one? Do we have some test cases? (Either way
>       they
>       needs to be added / expanded).
> 
> I think it's the opposite.  The assumption here is that a child is always a subset of
> its parent.  Thus, if the range to be checked is not covered by a parent, we can skip
> the children.
>
> That's guaranteed by __request_resource.  I am less sure about __insert_resource but
> it appears to be the case too.  FWIW, resource_is_exclusive has the same assumption
> already.

Yes, the children resources are contained within the parent resource (at 
least in PCI but given the code, I'd expect that to be general state of 
affairs).

> It looks like I need to do some refactoring to add tests.
> 
> 
>       P.S> I'm not so sure about this change. It needs a thoroughly testing,
>       esp.
>       in PCI case. Cc'ing to Ilpo.
> 
> What's special about PCI?

-- 
 i.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ