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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75VePDyPevCAOntFpTajf5zd9ocwjeWRz80WmCNtiDicpLg@mail.gmail.com>
Date:   Mon, 22 Jun 2020 17:56:01 +0300
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     "Rafael J. Wysocki" <rjw@...ysocki.net>
Cc:     Dan Williams <dan.j.williams@...el.com>,
        Erik Kaneda <erik.kaneda@...el.com>,
        "Rafael J. Wysocki" <rafael.j.wysocki@...el.com>,
        Len Brown <lenb@...nel.org>, Borislav Petkov <bp@...en8.de>,
        Ira Weiny <ira.weiny@...el.com>,
        James Morse <james.morse@....com>,
        Myron Stowe <myron.stowe@...hat.com>,
        Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        ACPI Devel Maling List <linux-acpi@...r.kernel.org>,
        linux-nvdimm@...ts.01.org, Bob Moore <robert.moore@...el.com>
Subject: Re: [RFT][PATCH v2 2/4] ACPI: OSL: Add support for deferred unmapping
 of ACPI memory

On Mon, Jun 22, 2020 at 5:06 PM Rafael J. Wysocki <rjw@...ysocki.net> wrote:
>
> From: "Rafael J. Wysocki" <rafael.j.wysocki@...el.com>
>
> Implement acpi_os_unmap_deferred() and
> acpi_os_release_unused_mappings() and set ACPI_USE_DEFERRED_UNMAPPING
> to allow ACPICA to use deferred unmapping of memory in
> acpi_ex_system_memory_space_handler() so as to avoid RCU-related
> performance issues with memory opregions.

...

> +static bool acpi_os_drop_map_ref(struct acpi_ioremap *map, bool defer)
>  {
> -       unsigned long refcount = --map->refcount;
> +       if (--map->track.refcount)
> +               return true;
>
> -       if (!refcount)
> -               list_del_rcu(&map->list);
> -       return refcount;
> +       list_del_rcu(&map->list);
> +

> +       if (defer) {
> +               INIT_LIST_HEAD(&map->track.gc);
> +               list_add_tail(&map->track.gc, &unused_mappings);

> +               return true;
> +       }
> +
> +       return false;

A nit:

Effectively it returns a value of defer.

  return defer;

>  }

...

> @@ -416,26 +421,102 @@ void __ref acpi_os_unmap_iomem(void __iomem *virt, acpi_size size)
>         }
>
>         mutex_lock(&acpi_ioremap_lock);
> +
>         map = acpi_map_lookup_virt(virt, size);

A nit: should it be somewhere else (I mean in another patch)?

>         if (!map) {

...

> +       /* Release the unused mappings in the list. */
> +       while (!list_empty(&list)) {
> +               struct acpi_ioremap *map;
> +
> +               map = list_entry(list.next, struct acpi_ioremap, track.gc);

A nt: if __acpi_os_map_cleanup() (actually acpi_unmap() according to
the code) has no side effects, can we use list_for_each_entry_safe()
here?

> +               list_del(&map->track.gc);
> +               __acpi_os_map_cleanup(map);
> +       }
> +}

...

> @@ -472,16 +552,18 @@ void acpi_os_unmap_generic_address(struct acpi_generic_address *gas)
>                 return;
>
>         mutex_lock(&acpi_ioremap_lock);
> +
>         map = acpi_map_lookup(addr, gas->bit_width / 8);

A nit: should it be somewhere else (I mean in another patch)?

-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ