History log of /netbsd-src/sys/compat/linux/common/linux_sched.c (Results 1 – 25 of 82)
Revision Date Author Comments
# adc48a85 03-Oct-2024 hannken <hannken@NetBSD.org>

Fix fallout from DPRINTF conversion.

Kernels ALL/i386 and ALL/amd64 compile again.


# eab38032 01-Oct-2024 riastradh <riastradh@NetBSD.org>

sys/compat/linux/common: Nix trailing whitespace, and one blank line.

No functional change intended.


# bd676060 30-Sep-2024 kre <kre@NetBSD.org>

Supply a missing cast, which fixes the i386 (other 32 bit too probably)
builds.

Note I used uintptr_t rather than intptr_t which other similar
lines nearby use - the int being converted to a ptr is

Supply a missing cast, which fixes the i386 (other 32 bit too probably)
builds.

Note I used uintptr_t rather than intptr_t which other similar
lines nearby use - the int being converted to a ptr is uint64_t
so using unsigned seemed safer to me. Feel free to change it.

Not sure if the code will work though - linux's clone3() is
being emulated via its clone() sys call - I know nothing about
linux sys calls, but my impression of these two is that in
clone() the "stack" arg points at the logical stack start
(usually the highest addr in the stack segment - though there
are some systems with upward growing stacks) whereas for
clone3() it looks to me as if the stack arg is always intended
to be the lowest addr in the stack segment (with a new size
field added to compute the top). Simply copying that arg to the
clone() arg of the same name might not work. (I am surmising).
I'd expect the code to need to vary based upon in which direction
the architecture's stack grows. Maybe.

show more ...


# f18a1cc9 29-Sep-2024 christos <christos@NetBSD.org>

move clone3 to linux_sched.c and make it compile (need to fix XXX comments)


# 41aa5859 07-Sep-2021 riastradh <riastradh@NetBSD.org>

sys/compat: Memset zero before copyout.

Just in case of uninitialized padding which would lead to kernel
stack disclosure. If the compiler can prove the memset redundant
then it can optimize it awa

sys/compat: Memset zero before copyout.

Just in case of uninitialized padding which would lead to kernel
stack disclosure. If the compiler can prove the memset redundant
then it can optimize it away; otherwise better safe than sorry.

show more ...


# 0eaaa024 23-May-2020 ad <ad@NetBSD.org>

Move proc_lock into the data segment. It was dynamically allocated because
at the time we had mutex_obj_alloc() but not __cacheline_aligned.


# 41277071 14-May-2020 rin <rin@NetBSD.org>

Fix previous; specify lwpid for curlpw in the case of pid == 0.

For linux_sys_sched_setaffinity, pid == 0 means the current thread.
On the other hand, for our native sys_sched_setaffinity, lid == 0

Fix previous; specify lwpid for curlpw in the case of pid == 0.

For linux_sys_sched_setaffinity, pid == 0 means the current thread.
On the other hand, for our native sys_sched_setaffinity, lid == 0
means all lwp's that belong to the process.

show more ...


# 5aee0edc 29-Apr-2020 thorpej <thorpej@NetBSD.org>

Fix proc / lwp lookup processing in linux_sys_sched_getaffinity()
and linux_sys_sched_setaffinity(). They were incorrect even before
the LWP ID changes, but those changes exposed the latent bugs.


# 15689570 24-Apr-2020 thorpej <thorpej@NetBSD.org>

Overhaul the way LWP IDs are allocated. Instead of each LWP having it's
own LWP ID space, LWP IDs came from the same number space as PIDs. The
lead LWP of a process gets the PID as its LID. If a m

Overhaul the way LWP IDs are allocated. Instead of each LWP having it's
own LWP ID space, LWP IDs came from the same number space as PIDs. The
lead LWP of a process gets the PID as its LID. If a multi-LWP process's
lead LWP exits, the PID persists for the process.

In addition to providing system-wide unique thread IDs, this also lets us
eliminate the per-process LWP radix tree, and some associated locks.

Remove the separate "global thread ID" map added previously; it is no longer
needed to provide this functionality.

Nudged in this direction by ad@ and chs@.

show more ...


# a29147fa 19-Apr-2020 thorpej <thorpej@NetBSD.org>

- Only increment nprocs when we're creating a new process, not just
when allocating a PID.
- Per above, proc_free_pid() no longer decrements nprocs. It's now done
in proc_free() right after proc

- Only increment nprocs when we're creating a new process, not just
when allocating a PID.
- Per above, proc_free_pid() no longer decrements nprocs. It's now done
in proc_free() right after proc_free_pid().
- Ensure nprocs is accessed using atomics everywhere.

show more ...


# 11ba4e18 23-Nov-2019 ad <ad@NetBSD.org>

Minor scheduler cleanup:

- Adapt to cpu_need_resched() changes. Avoid lost & duplicate IPIs and ASTs.
sched_resched_cpu() and sched_resched_lwp() contain the logic for this.
- Changes for LSIDL to

Minor scheduler cleanup:

- Adapt to cpu_need_resched() changes. Avoid lost & duplicate IPIs and ASTs.
sched_resched_cpu() and sched_resched_lwp() contain the logic for this.
- Changes for LSIDL to make the locking scheme match the intended design.
- Reduce lock contention and false sharing further.
- Numerous small bugfixes, including some corrections for SCHED_FIFO/RT.
- Use setrunnable() in more places, and merge cut & pasted code.

show more ...


# 9425a929 03-Oct-2019 kamil <kamil@NetBSD.org>

Switch kevent udata from intptr_t void*

Synchromize the struct field format with other BSDs and Darwin.

No ABI change between older and newer struct form on the ports.

The change will require no c

Switch kevent udata from intptr_t void*

Synchromize the struct field format with other BSDs and Darwin.

No ABI change between older and newer struct form on the ports.

The change will require no changes to most C users during the transition
period as the header keeps a caller cast.

Discussed with core@ and there were no objections for this move.

show more ...


# d20c39ee 16-Apr-2018 kamil <kamil@NetBSD.org>

Remove the rnewprocp argument from fork1(9)

It's now unused and it can cause use-after-free scenarios as noted by
<Mateusz Guzik>.

Reference: http://mail-index.netbsd.org/tech-kern/2017/09/08/msg02

Remove the rnewprocp argument from fork1(9)

It's now unused and it can cause use-after-free scenarios as noted by
<Mateusz Guzik>.

Reference: http://mail-index.netbsd.org/tech-kern/2017/09/08/msg022267.html

Sponsored by <The NetBSD Foundation>

show more ...


# dfb49eea 15-Apr-2018 kamil <kamil@NetBSD.org>

Remove unused variable p from linux_sys_clone()

After refactoring by <chs> in 2010 (r. 1.63) the p variable is no longer
used.

As noted by <Mateusz Guzik> its usage is also unsafe and might cause
u

Remove unused variable p from linux_sys_clone()

After refactoring by <chs> in 2010 (r. 1.63) the p variable is no longer
used.

As noted by <Mateusz Guzik> its usage is also unsafe and might cause
use-after-free scenarios.

No functional change intended.

Reference: http://mail-index.netbsd.org/tech-kern/2017/09/08/msg022267.html

Sponsored by <The NetBSD Foundation>

show more ...


# d7746f2e 21-Apr-2017 christos <christos@NetBSD.org>

- Propagate the signal mask from the ucontext_t to the newly created thread
as specified by _lwp_create(2)
- Reset the signal stack for threads created with _lwp_create(2)


# 1ae34620 03-Jul-2015 christos <christos@NetBSD.org>

PR/50021: Rin Okuyama: Fix linux affinity syscalls
XXX: pullup-7


# eda7c7bb 09-Nov-2014 maxv <maxv@NetBSD.org>

Do not uselessly include <sys/malloc.h>.


# bd88ba8b 23-Jan-2014 njoly <njoly@NetBSD.org>

Fix inverted pid/lid arguments in do_sched_{get,set}param calls.


# c4392205 18-Aug-2011 christos <christos@NetBSD.org>

Better debugging.


# 57cfea60 05-Jun-2011 dsl <dsl@NetBSD.org>

Delete some splurious commas and very unexpected trailing space


# 33fa5ccb 07-Jul-2010 chs <chs@NetBSD.org>

many changes for COMPAT_LINUX:
- update the linux syscall table for each platform.
- support new-style (NPTL) linux pthreads on all platforms.
clone() with CLONE_THREAD uses 1 process with many

many changes for COMPAT_LINUX:
- update the linux syscall table for each platform.
- support new-style (NPTL) linux pthreads on all platforms.
clone() with CLONE_THREAD uses 1 process with many LWPs
instead of separate processes.
- move the contents of sys__lwp_setprivate() into a new
lwp_setprivate() and use that everywhere.
- update linux_release[] and linux32_release[] to "2.6.18".
- adjust placement of emul fork/exec/exit hooks as needed
and adjust other emul code to match.
- convert all struct emul definitions to use named initializers.
- change the pid allocator to allow multiple pids to refer to the same proc.
- remove a few fields from struct proc that are no longer needed.
- disable the non-functional "vdso" code in linux32/amd64,
glibc works fine without it.
- fix a race in the futex code where we could miss a wakeup after
a requeue operation.
- redo futex locking to be a little more efficient.

show more ...


# 3c507045 01-Jul-2010 rmind <rmind@NetBSD.org>

Remove pfind() and pgfind(), fix locking in various broken uses of these.
Rename real routines to proc_find() and pgrp_find(), remove PFIND_* flags
and have consistent behaviour. Provide proc_find_r

Remove pfind() and pgfind(), fix locking in various broken uses of these.
Rename real routines to proc_find() and pgrp_find(), remove PFIND_* flags
and have consistent behaviour. Provide proc_find_raw() for special cases.
Fix memory leak in sysctl_proc_corename().

COMPAT_LINUX: rework ptrace() locking, minimise differences between
different versions per-arch.

Note: while this change adds some formal cosmetics for COMPAT_DARWIN and
COMPAT_IRIX - locking there is utterly broken (for ages).

Fixes PR/43176.

show more ...


# 1e036632 03-Sep-2009 njoly <njoly@NetBSD.org>

Use correct sched_setscheduler syscall 3rd argument type.


# de2e7a9c 23-Jun-2009 njoly <njoly@NetBSD.org>

sched_getaffinity(2) update:
- dynamically calculate the cpu mask size,
- return it upon success,
- fix generated cpu mask.


# 9edecd8c 18-Jun-2009 njoly <njoly@NetBSD.org>

In linux_sys_sched_getaffinity(), do not leak memory on error.


1234