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: <60367660-f4a3-06dc-4d17-4dbdc733ef74@oracle.com>
Date:   Fri, 26 May 2023 09:44:34 -0600
From:   Khalid Aziz <khalid.aziz@...cle.com>
To:     Matthew Wilcox <willy@...radead.org>,
        Steven Sistare <steven.sistare@...cle.com>
Cc:     akpm@...ux-foundation.org, david@...hat.com, ying.huang@...el.com,
        mgorman@...hsingularity.net, baolin.wang@...ux.alibaba.com,
        linux-mm@...ck.org, linux-kernel@...r.kernel.org,
        Khalid Aziz <khalid@...nel.org>
Subject: Re: [PATCH v4] mm, compaction: Skip all non-migratable pages during
 scan

On 5/25/23 15:31, Matthew Wilcox wrote:
> On Thu, May 25, 2023 at 09:45:34PM +0100, Matthew Wilcox wrote:
>>>> Isn't "long term pinning" the wrong description of the problem?  Long term
>>>> pins suggest to me FOLL_LONGTERM.  I think this is simple short term
>>>> pins that we care about here.
>>>
>>> vfio pins are held for a long time - Steve
>>
>> So this is a third sense of "pinned pages" that is neither what
>> filesystems nor the mm means by pinned pages, but whatever it is that
>> vfio means by pinned pages?  If only "pin" weren't such a desirable
>> word.  Can somebody explain to me in small words what a vfio pin looks
>> like because I've tried reading vfio_iommu_type1_pin_pages() and I
>> don't recognise anything there that looks like pinning in either of
>> the other two senses.
> 
> Oh, I think I found it!  pin_user_pages_remote() is called by
> vaddr_get_pfns().  If these are the pages you're concerned about,
> then the efficient way to do what you want is simply to call
> folio_maybe_dma_pinned().  Far more efficient than the current mess
> of total_mapcount().

vfio pinned pages triggered this change. Wouldn't checking refcounts against mapcount provide a more generalized way of 
detecting non-migratable pages?

Thanks,
Khalid

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ