Re: [PATCH v3 00/25] fs/dax: Fix ZONE_DEVICE page reference counts

2024-12-13 Thread Dan Williams
[ add akpm and sfr for next steps ] Alistair Popple wrote: > Main updates since v2: > > - Rename the DAX specific dax_insert_XXX functions to vmf_insert_XXX >and have them pass the vmf struct. > > - Seperate out the device DAX changes. > > - Restore the page share mapping counting and as

[PATCH v7 10/30] ntsync: Introduce NTSYNC_IOC_EVENT_RESET.

2024-12-13 Thread Elizabeth Figura
This corresponds to the NT syscall NtResetEvent(). This sets the event to the unsignaled state, and returns its previous state. Signed-off-by: Elizabeth Figura --- drivers/misc/ntsync.c | 24 include/uapi/linux/ntsync.h | 1 + 2 files changed, 25 insertions(+) d

[PATCH v7 00/30] NT synchronization primitive driver

2024-12-13 Thread Elizabeth Figura
This patch series implements a new char misc driver, /dev/ntsync, which is used to implement Windows NT synchronization primitives. NT synchronization primitives are unique in that the wait functions both are vectored, operate on multiple types of object with different behaviour (mutex, semaphore,

[PATCH v7 08/30] ntsync: Introduce NTSYNC_IOC_CREATE_EVENT.

2024-12-13 Thread Elizabeth Figura
This correspond to the NT syscall NtCreateEvent(). An NT event holds a single bit of state denoting whether it is signaled or unsignaled. There are two types of events: manual-reset and automatic-reset. When an automatic-reset event is acquired via a wait function, its state is reset to unsignale

[PATCH v7 09/30] ntsync: Introduce NTSYNC_IOC_EVENT_SET.

2024-12-13 Thread Elizabeth Figura
This corresponds to the NT syscall NtSetEvent(). This sets the event to the signaled state, and returns its previous state. Signed-off-by: Elizabeth Figura --- drivers/misc/ntsync.c | 27 +++ include/uapi/linux/ntsync.h | 1 + 2 files changed, 28 insertions(+) di

[PATCH v7 01/30] ntsync: Return the fd from NTSYNC_IOC_CREATE_SEM.

2024-12-13 Thread Elizabeth Figura
Simplify the user API a bit by returning the fd as return value from the ioctl instead of through the argument pointer. Signed-off-by: Elizabeth Figura --- drivers/misc/ntsync.c | 7 ++- include/uapi/linux/ntsync.h | 3 +-- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a

[PATCH v7 02/30] ntsync: Rename NTSYNC_IOC_SEM_POST to NTSYNC_IOC_SEM_RELEASE.

2024-12-13 Thread Elizabeth Figura
Use the more common "release" terminology, which is also the term used by NT, instead of "post" (which is used by POSIX). Signed-off-by: Elizabeth Figura --- drivers/misc/ntsync.c | 10 +- include/uapi/linux/ntsync.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff -

[PATCH v7 05/30] ntsync: Introduce NTSYNC_IOC_CREATE_MUTEX.

2024-12-13 Thread Elizabeth Figura
This corresponds to the NT syscall NtCreateMutant(). An NT mutex is recursive, with a 32-bit recursion counter. When acquired via NtWaitForMultipleObjects(), the recursion counter is incremented by one. The OS records the thread which acquired it. The OS records the thread which acquired it. Howe

[PATCH v7 06/30] ntsync: Introduce NTSYNC_IOC_MUTEX_UNLOCK.

2024-12-13 Thread Elizabeth Figura
This corresponds to the NT syscall NtReleaseMutant(). This syscall decrements the mutex's recursion count by one, and returns the previous value. If the mutex is not owned by the current task, the function instead fails and returns -EPERM. Signed-off-by: Elizabeth Figura --- drivers/misc/ntsync

[PATCH v7 03/30] ntsync: Introduce NTSYNC_IOC_WAIT_ANY.

2024-12-13 Thread Elizabeth Figura
This corresponds to part of the functionality of the NT syscall NtWaitForMultipleObjects(). Specifically, it implements the behaviour where the third argument (wait_any) is TRUE, and it does not handle alertable waits. Those features have been split out into separate patches to ease review. This p

[PATCH v7 04/30] ntsync: Introduce NTSYNC_IOC_WAIT_ALL.

2024-12-13 Thread Elizabeth Figura
This is similar to NTSYNC_IOC_WAIT_ANY, but waits until all of the objects are simultaneously signaled, and then acquires all of them as a single atomic operation. Because acquisition of multiple objects is atomic, some complex locking is required. We cannot simply spin-lock multiple objects simul

[PATCH v7 13/30] ntsync: Introduce NTSYNC_IOC_MUTEX_READ.

2024-12-13 Thread Elizabeth Figura
This corresponds to the NT syscall NtQueryMutant(). This returns the recursion count, owner, and abandoned state of the mutex. Signed-off-by: Elizabeth Figura --- drivers/misc/ntsync.c | 26 ++ include/uapi/linux/ntsync.h | 1 + 2 files changed, 27 insertions(+)

[PATCH v7 11/30] ntsync: Introduce NTSYNC_IOC_EVENT_PULSE.

2024-12-13 Thread Elizabeth Figura
This corresponds to the NT syscall NtPulseEvent(). This wakes up any waiters as if the event had been set, but does not set the event, instead resetting it if it had been signalled. Thus, for a manual-reset event, all waiters are woken, whereas for an auto-reset event, at most one waiter is woken.

[PATCH v7 12/30] ntsync: Introduce NTSYNC_IOC_SEM_READ.

2024-12-13 Thread Elizabeth Figura
This corresponds to the NT syscall NtQuerySemaphore(). This returns the current count and maximum count of the semaphore. Signed-off-by: Elizabeth Figura --- drivers/misc/ntsync.c | 24 include/uapi/linux/ntsync.h | 1 + 2 files changed, 25 insertions(+) diff --

[PATCH v7 15/30] ntsync: Introduce alertable waits.

2024-12-13 Thread Elizabeth Figura
NT waits can optionally be made "alertable". This is a special channel for thread wakeup that is mildly similar to SIGIO. A thread has an internal single bit of "alerted" state, and if a thread is alerted while an alertable wait, the wait will return a special value, consume the "alerted" state, an

[PATCH v7 14/30] ntsync: Introduce NTSYNC_IOC_EVENT_READ.

2024-12-13 Thread Elizabeth Figura
This corresponds to the NT syscall NtQueryEvent(). This returns the signaled state of the event and whether it is manual-reset. Signed-off-by: Elizabeth Figura --- drivers/misc/ntsync.c | 24 include/uapi/linux/ntsync.h | 1 + 2 files changed, 25 insertions(+) d

[PATCH v7 17/30] selftests: ntsync: Add some tests for mutex state.

2024-12-13 Thread Elizabeth Figura
Test mutex-specific ioctls NTSYNC_IOC_MUTEX_UNLOCK and NTSYNC_IOC_MUTEX_READ, and waiting on mutexes. Signed-off-by: Elizabeth Figura --- .../testing/selftests/drivers/ntsync/ntsync.c | 187 ++ 1 file changed, 187 insertions(+) diff --git a/tools/testing/selftests/drivers/ntsync

[PATCH v7 16/30] selftests: ntsync: Add some tests for semaphore state.

2024-12-13 Thread Elizabeth Figura
Wine has tests for its synchronization primitives, but these are more accessible to kernel developers, and also allow us to test some edge cases that Wine does not care about. This patch adds tests for semaphore-specific ioctls NTSYNC_IOC_SEM_POST and NTSYNC_IOC_SEM_READ, and waiting on semaphores

[PATCH v7 07/30] ntsync: Introduce NTSYNC_IOC_MUTEX_KILL.

2024-12-13 Thread Elizabeth Figura
This does not correspond to any NT syscall. Rather, when a thread dies, it should be called by the NT emulator for each mutex, with the TID of the dying thread. NT mutexes are robust (in the pthread sense). When an NT thread dies, any mutexes it owned are immediately released. Acquisition of those

[PATCH v7 19/30] selftests: ntsync: Add some tests for NTSYNC_IOC_WAIT_ALL.

2024-12-13 Thread Elizabeth Figura
Test basic synchronous functionality of NTSYNC_IOC_WAIT_ALL, and when objects are considered simultaneously signaled. Signed-off-by: Elizabeth Figura --- .../testing/selftests/drivers/ntsync/ntsync.c | 93 ++- 1 file changed, 91 insertions(+), 2 deletions(-) diff --git a/tools/t

[PATCH v7 18/30] selftests: ntsync: Add some tests for NTSYNC_IOC_WAIT_ANY.

2024-12-13 Thread Elizabeth Figura
Test basic synchronous functionality of NTSYNC_IOC_WAIT_ANY, when objects are considered signaled or not signaled, and how they are affected by a successful wait. Signed-off-by: Elizabeth Figura --- .../testing/selftests/drivers/ntsync/ntsync.c | 114 ++ 1 file changed, 114 inser

Re: [PATCH 1/1] Documentation: hyperv: Add overview of guest VM hibernation

2024-12-13 Thread Roman Kisel
On 12/12/2024 3:17 PM, mhkelle...@gmail.com wrote: From: Michael Kelley Add documentation on how hibernation works in a guest VM on Hyper-V. Describe how VMBus devices and the VMBus itself are hibernated and resumed, along with various limitations. Signed-off-by: Michael Kelley --- Document

RE: [PATCH 1/1] Documentation: hyperv: Add overview of guest VM hibernation

2024-12-13 Thread Michael Kelley
From: Roman Kisel Sent: Friday, December 13, 2024 10:44 AM > > On 12/12/2024 3:17 PM, mhkelle...@gmail.com wrote: > > From: Michael Kelley > > > > Add documentation on how hibernation works in a guest VM on Hyper-V. > > Describe how VMBus devices and the VMBus itself are hibernated and > > resu

[PATCH v7 21/30] selftests: ntsync: Add some tests for wakeup signaling with WINESYNC_IOC_WAIT_ALL.

2024-12-13 Thread Elizabeth Figura
Test contended "wait-for-all" waits, to make sure that scheduling and wakeup logic works correctly, and that the wait only exits once objects are all simultaneously signaled. Signed-off-by: Elizabeth Figura --- .../testing/selftests/drivers/ntsync/ntsync.c | 91 +++ 1 file change

[PATCH v7 20/30] selftests: ntsync: Add some tests for wakeup signaling with WINESYNC_IOC_WAIT_ANY.

2024-12-13 Thread Elizabeth Figura
Test contended "wait-for-any" waits, to make sure that scheduling and wakeup logic works correctly. Signed-off-by: Elizabeth Figura --- .../testing/selftests/drivers/ntsync/ntsync.c | 143 ++ 1 file changed, 143 insertions(+) diff --git a/tools/testing/selftests/drivers/ntsync/n

[PATCH v7 22/30] selftests: ntsync: Add some tests for manual-reset event state.

2024-12-13 Thread Elizabeth Figura
Test event-specific ioctls NTSYNC_IOC_EVENT_SET, NTSYNC_IOC_EVENT_RESET, NTSYNC_IOC_EVENT_PULSE, NTSYNC_IOC_EVENT_READ for manual-reset events, and waiting on manual-reset events. Signed-off-by: Elizabeth Figura --- .../testing/selftests/drivers/ntsync/ntsync.c | 86 +++ 1 file c

[PATCH v7 23/30] selftests: ntsync: Add some tests for auto-reset event state.

2024-12-13 Thread Elizabeth Figura
Test event-specific ioctls NTSYNC_IOC_EVENT_SET, NTSYNC_IOC_EVENT_RESET, NTSYNC_IOC_EVENT_PULSE, NTSYNC_IOC_EVENT_READ for auto-reset events, and waiting on auto-reset events. Signed-off-by: Elizabeth Figura --- .../testing/selftests/drivers/ntsync/ntsync.c | 56 +++ 1 file chang

[PATCH v7 24/30] selftests: ntsync: Add some tests for wakeup signaling with events.

2024-12-13 Thread Elizabeth Figura
Expand the contended wait tests, which previously only covered events and semaphores, to cover events as well. Signed-off-by: Elizabeth Figura --- .../testing/selftests/drivers/ntsync/ntsync.c | 145 +- 1 file changed, 141 insertions(+), 4 deletions(-) diff --git a/tools/testing

[PATCH v7 25/30] selftests: ntsync: Add tests for alertable waits.

2024-12-13 Thread Elizabeth Figura
Test the "alert" functionality of NTSYNC_IOC_WAIT_ALL and NTSYNC_IOC_WAIT_ANY, when a wait is woken with an alert and when it is woken by an object. Signed-off-by: Elizabeth Figura --- .../testing/selftests/drivers/ntsync/ntsync.c | 167 +- 1 file changed, 164 insertions(+), 3 de

[PATCH v7 26/30] selftests: ntsync: Add some tests for wakeup signaling via alerts.

2024-12-13 Thread Elizabeth Figura
Expand the alert tests to cover alerting a thread mid-wait, to test that the relevant scheduling logic works correctly. Signed-off-by: Elizabeth Figura --- .../testing/selftests/drivers/ntsync/ntsync.c | 62 +++ 1 file changed, 62 insertions(+) diff --git a/tools/testing/selftes

[PATCH v7 28/30] maintainers: Add an entry for ntsync.

2024-12-13 Thread Elizabeth Figura
Add myself as maintainer, supported by CodeWeavers. Signed-off-by: Elizabeth Figura --- MAINTAINERS | 9 + 1 file changed, 9 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 1e930c7a58b1..8c3dd9077fc2 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -16708,6 +16708,15 @@ T: g

[PATCH v7 27/30] selftests: ntsync: Add a stress test for contended waits.

2024-12-13 Thread Elizabeth Figura
Test a more realistic usage pattern, and one with heavy contention, in order to actually exercise ntsync's internal synchronization. This test has several threads in a tight loop acquiring a mutex, modifying some shared data, and then releasing the mutex. At the end we check if the data is consist

[PATCH v7 29/30] docs: ntsync: Add documentation for the ntsync uAPI.

2024-12-13 Thread Elizabeth Figura
Add an overall explanation of the driver architecture, and complete and precise specification for its intended behaviour. Signed-off-by: Elizabeth Figura --- Documentation/userspace-api/index.rst | 1 + Documentation/userspace-api/ntsync.rst | 385 + 2 files changed, 3

Re: [PATCH v2 2/2] Increase minimum git commit ID abbreviation to 16 characters

2024-12-13 Thread Geert Uytterhoeven
Hi Linus, On Thu, Dec 5, 2024 at 8:19 PM Linus Torvalds wrote: > On Thu, 5 Dec 2024 at 10:16, Geert Uytterhoeven > wrote: > > Hence according to the Birthday Paradox, collisions of 12-chararacter > > git commit IDs are imminent, or already happening. > > Note that ambiguous commit IDs are not e

[PATCH v7 30/30] ntsync: No longer depend on BROKEN.

2024-12-13 Thread Elizabeth Figura
f5b335dc025cfee90957efa90dc72fada0d5abb4 ("misc: ntsync: mark driver as "broken" to prevent from building") was committed to avoid the driver being used while only part of its functionality was released. Since the rest of the functionality has now been committed, revert this. Signed-off-by: Elizab

Re: [PATCH v1 1/6] docs: more detailed instructions on handling regressions

2024-12-13 Thread Jonathan Corbet
Thorsten Leemhuis writes: > Add a few more specific guidelines on handling regressions to the > kernel's two most prominent guides about contributing to Linux, as > developers apparently work with quite different interpretations of what > Linus expects. > > Changes like this were asked for during

Re: [PATCH v1 2/6] docs: 6.Followthrough.rst: when to involved Linus in regressions

2024-12-13 Thread Jonathan Corbet
Thorsten Leemhuis writes: > Add a few notes on when to involve Linus in regressions. Part of this > spells out slightly obvious things infrequent developers might not be > aware of, while others are based on a recent statement from Linus[1]. > > This removes equivalent paragraphs from a section i

Re: [PATCH v1 3/6] docs: 6.Followthrough.rst: interaction with stable wrt to regressions

2024-12-13 Thread Jonathan Corbet
Thorsten Leemhuis writes: > Add a few notes on how the interaction with the stable team works when > it comes to mainline regressions that also affect stable series. > > This removes equivalent paragraphs from a section in > Documentation/process/handling-regressions.rst, which will become mostly

Re: [PATCH v1 4/6] docs: 6.Followthrough.rst: tags to use in regressions fixes

2024-12-13 Thread Jonathan Corbet
Thorsten Leemhuis writes: > Add a few notes on the appropriate tags to be used in changes that fix > regressions. > > This removes equivalent paragraphs from a section in > Documentation/process/handling-regressions.rst, which will become mostly > obsolete through this and follow-up changes. > >

Re: [PATCH v1 5/6] docs: 6.Followthrough.rst: more specific advice on fixing regressions

2024-12-13 Thread Jonathan Corbet
Thorsten Leemhuis writes: > Provide something more concrete about fixing regressions in a few > places, as telling people to "expedite" fixing those that reached a > release deemed for end users is pretty vague. But every situation is > different, so use the soft phrases like "aim for" and leave

Re: [PATCH v1 6/6] docs: 6.Followthrough.rst: advice on handling regressions fixes

2024-12-13 Thread Jonathan Corbet
Thorsten Leemhuis writes: > Add some advice on how to handle regressions as developer, reviewer, and > maintainer, as resolving regression without unnecessary delays requires > multiple people working hand in hand. > > This removes equivalent paragraphs from a section in > Documentation/process/h