instruction
stringlengths
82
202
input
stringclasses
1 value
output
stringlengths
73
23.9M
Linux kernel'inin 'tools/testing/selftests/sched_ext/maybe_null' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* SPDX-License-Identifier: GPL-2.0 */ /* * Copyright (c) 2024 Meta Platforms, Inc. and affiliates. */ #include <bpf/bpf.h> #include <scx/common.h> #include <sys/wait.h> #include <unistd.h> #include "maybe_null.bpf.skel.h" #include "maybe_null_fail_dsp.bpf.skel.h" #include "maybe_null_fail_yld.bpf.skel.h" #inclu...
Linux kernel'inin 'tools/testing/selftests/sched_ext/prog_run.bpf' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* SPDX-License-Identifier: GPL-2.0 */ /* * A scheduler that validates that we can invoke sched_ext kfuncs in * BPF_PROG_TYPE_SYSCALL programs. * * Copyright (c) 2024 Meta Platforms, Inc. and affiliates. * Copyright (c) 2024 David Vernet <dvernet@meta.com> */ #include <scx/common.bpf.h> UEI_DEFINE(uei); c...
Linux kernel'inin 'tools/testing/selftests/sched_ext/init_enable_count.bpf' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* SPDX-License-Identifier: GPL-2.0 */ /* * A scheduler that verifies that we do proper counting of init, enable, etc * callbacks. * * Copyright (c) 2023 Meta Platforms, Inc. and affiliates. * Copyright (c) 2023 David Vernet <dvernet@meta.com> * Copyright (c) 2023 Tejun Heo <tj@kernel.org> */ #include <scx...
Linux kernel'inin 'tools/testing/selftests/sched_ext/select_cpu_dispatch' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* SPDX-License-Identifier: GPL-2.0 */ /* * Copyright (c) 2023 Meta Platforms, Inc. and affiliates. * Copyright (c) 2023 David Vernet <dvernet@meta.com> * Copyright (c) 2023 Tejun Heo <tj@kernel.org> */ #include <bpf/bpf.h> #include <scx/common.h> #include <sys/wait.h> #include <unistd.h> #include "select_cpu_...
Linux kernel'inin 'tools/testing/selftests/sched_ext/numa' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * Copyright (c) 2025 Andrea Righi <arighi@nvidia.com> */ #include <bpf/bpf.h> #include <scx/common.h> #include <sys/wait.h> #include <unistd.h> #include "numa.bpf.skel.h" #include "scx_test.h" static enum scx_test_status setup(void **ctx) { struct numa *skel; skel = num...
Linux kernel'inin 'tools/testing/selftests/sched_ext/maybe_null.bpf' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* SPDX-License-Identifier: GPL-2.0 */ /* * Copyright (c) 2024 Meta Platforms, Inc. and affiliates. */ #include <scx/common.bpf.h> char _license[] SEC("license") = "GPL"; u64 vtime_test; void BPF_STRUCT_OPS(maybe_null_running, struct task_struct *p) {} void BPF_STRUCT_OPS(maybe_null_success_dispatch, s32 cp...
Linux kernel'inin 'tools/testing/selftests/sched_ext/select_cpu_dfl.bpf' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* SPDX-License-Identifier: GPL-2.0 */ /* * A scheduler that validates the behavior of direct dispatching with a default * select_cpu implementation. * * Copyright (c) 2023 Meta Platforms, Inc. and affiliates. * Copyright (c) 2023 David Vernet <dvernet@meta.com> * Copyright (c) 2023 Tejun Heo <tj@kernel.org>...
Linux kernel'inin 'tools/testing/selftests/sched_ext/total_bw' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * Test to verify that total_bw value remains consistent across all CPUs * in different BPF program states. * * Copyright (C) 2025 NVIDIA Corporation. */ #include <bpf/bpf.h> #include <errno.h> #include <pthread.h> #include <scx/common.h> #include <stdio.h> #include <stdl...
Linux kernel'inin 'tools/testing/selftests/sched_ext/enq_last_no_enq_fails.bpf' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* SPDX-License-Identifier: GPL-2.0 */ /* * A scheduler that validates the behavior of direct dispatching with a default * select_cpu implementation. * * Copyright (c) 2023 Meta Platforms, Inc. and affiliates. * Copyright (c) 2023 David Vernet <dvernet@meta.com> * Copyright (c) 2023 Tejun Heo <tj@kernel.org>...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/sched_ext/util' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0 */ /* * Copyright (c) 2024 Meta Platforms, Inc. and affiliates. * Copyright (c) 2024 David Vernet <void@manifault.com> */ #ifndef __SCX_TEST_UTIL_H__ #define __SCX_TEST_UTIL_H__ long file_read_long(const char *path); int file_write_long(const char *path, long val); #endif ...
Linux kernel'inin 'tools/testing/selftests/sched_ext/maybe_null_fail_yld.bpf' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* SPDX-License-Identifier: GPL-2.0 */ /* * Copyright (c) 2024 Meta Platforms, Inc. and affiliates. */ #include <scx/common.bpf.h> char _license[] SEC("license") = "GPL"; u64 vtime_test; void BPF_STRUCT_OPS(maybe_null_running, struct task_struct *p) {} bool BPF_STRUCT_OPS(maybe_null_fail_yield, struct task_...
Linux kernel'inin 'tools/testing/selftests/sched_ext/exit' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* SPDX-License-Identifier: GPL-2.0 */ /* * Copyright (c) 2024 Meta Platforms, Inc. and affiliates. * Copyright (c) 2024 David Vernet <dvernet@meta.com> */ #include <bpf/bpf.h> #include <sched.h> #include <scx/common.h> #include <sys/wait.h> #include <unistd.h> #include "exit.bpf.skel.h" #include "scx_test.h" ...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/sched_ext/hotplug_test' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0 */ /* * Copyright (c) 2024 Meta Platforms, Inc. and affiliates. * Copyright (c) 2024 David Vernet <dvernet@meta.com> */ #ifndef __HOTPLUG_TEST_H__ #define __HOTPLUG_TEST_H__ enum hotplug_test_flags { HOTPLUG_EXIT_RSN = 1LLU << 0, HOTPLUG_ONLINING = 1LLU << 1, }; #endif ...
Linux kernel'inin 'tools/testing/selftests/sched_ext/maybe_null_fail_dsp.bpf' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* SPDX-License-Identifier: GPL-2.0 */ /* * Copyright (c) 2024 Meta Platforms, Inc. and affiliates. */ #include <scx/common.bpf.h> char _license[] SEC("license") = "GPL"; u64 vtime_test; void BPF_STRUCT_OPS(maybe_null_running, struct task_struct *p) {} void BPF_STRUCT_OPS(maybe_null_fail_dispatch, s32 cpu, ...
Linux kernel'inin 'tools/testing/selftests/sched_ext/select_cpu_dfl_nodispatch.bpf' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* SPDX-License-Identifier: GPL-2.0 */ /* * A scheduler that validates the behavior of direct dispatching with a default * select_cpu implementation, and with the SCX_OPS_ENQ_DFL_NO_DISPATCH ops flag * specified. * * Copyright (c) 2023 Meta Platforms, Inc. and affiliates. * Copyright (c) 2023 David Vernet <d...
Linux kernel'inin 'tools/testing/selftests/sched_ext/allowed_cpus' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * Copyright (c) 2025 Andrea Righi <arighi@nvidia.com> */ #include <bpf/bpf.h> #include <scx/common.h> #include <sys/wait.h> #include <unistd.h> #include "allowed_cpus.bpf.skel.h" #include "scx_test.h" static enum scx_test_status setup(void **ctx) { struct allowed_cpus *sk...
Linux kernel'inin 'tools/testing/selftests/sched_ext/dequeue.bpf' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * A scheduler that validates ops.dequeue() is called correctly: * - Tasks dispatched to terminal DSQs (local, global) bypass the BPF * scheduler entirely: no ops.dequeue() should be called * - Tasks dispatched to user DSQs from ops.enqueue() enter BPF custody: * ops....
Linux kernel'inin 'tools/testing/selftests/sched_ext/enq_select_cpu' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * Copyright (c) 2023 Meta Platforms, Inc. and affiliates. * Copyright (c) 2023 David Vernet <dvernet@meta.com> * Copyright (c) 2023 Tejun Heo <tj@kernel.org> */ #include <bpf/bpf.h> #include <scx/common.h> #include <sys/wait.h> #include <unistd.h> #include "enq_select_cpu...
Linux kernel'inin 'tools/testing/selftests/sched_ext/hotplug.bpf' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* SPDX-License-Identifier: GPL-2.0 */ /* * Copyright (c) 2024 Meta Platforms, Inc. and affiliates. * Copyright (c) 2024 David Vernet <dvernet@meta.com> */ #include <scx/common.bpf.h> char _license[] SEC("license") = "GPL"; #include "hotplug_test.h" UEI_DEFINE(uei); void BPF_STRUCT_OPS(hotplug_exit, struct...
Linux kernel'inin 'tools/testing/selftests/sched_ext/create_dsq.bpf' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* SPDX-License-Identifier: GPL-2.0 */ /* * Create and destroy DSQs in a loop. * * Copyright (c) 2024 Meta Platforms, Inc. and affiliates. * Copyright (c) 2024 David Vernet <dvernet@meta.com> */ #include <scx/common.bpf.h> char _license[] SEC("license") = "GPL"; void BPF_STRUCT_OPS(create_dsq_exit_task, st...
Linux kernel'inin 'tools/testing/selftests/sched_ext/non_scx_kfunc_deny.bpf' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* SPDX-License-Identifier: GPL-2.0 */ /* * Verify that context-sensitive SCX kfuncs (even "unlocked" ones) are * restricted to only SCX struct_ops programs. Non-SCX struct_ops programs, * such as TCP congestion control programs, should be rejected by the BPF * verifier when attempting to call these kfuncs. *...
Linux kernel'inin 'tools/testing/selftests/sched_ext/dequeue' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * Copyright (c) 2025 NVIDIA Corporation. */ #define _GNU_SOURCE #include <stdio.h> #include <unistd.h> #include <signal.h> #include <time.h> #include <bpf/bpf.h> #include <scx/common.h> #include <sys/wait.h> #include <sched.h> #include <pthread.h> #include "scx_test.h" #inc...
Linux kernel'inin 'tools/testing/selftests/sched_ext/minimal.bpf' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* SPDX-License-Identifier: GPL-2.0 */ /* * A completely minimal scheduler. * * This scheduler defines the absolute minimal set of struct sched_ext_ops * fields: its name. It should _not_ fail to be loaded, and can be used to * exercise the default scheduling paths in ext.c. * * Copyright (c) 2023 Meta Plat...
Linux kernel'inin 'tools/testing/selftests/sched_ext/ddsp_vtimelocal_fail.bpf' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* SPDX-License-Identifier: GPL-2.0 */ /* * Copyright (c) 2024 Meta Platforms, Inc. and affiliates. * Copyright (c) 2024 David Vernet <dvernet@meta.com> * Copyright (c) 2024 Tejun Heo <tj@kernel.org> */ #include <scx/common.bpf.h> char _license[] SEC("license") = "GPL"; UEI_DEFINE(uei); s32 BPF_STRUCT_OPS(d...
Linux kernel'inin 'tools/testing/selftests/sched_ext/select_cpu_dispatch_dbl_dsp' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* SPDX-License-Identifier: GPL-2.0 */ /* * Copyright (c) 2023 Meta Platforms, Inc. and affiliates. * Copyright (c) 2023 David Vernet <dvernet@meta.com> * Copyright (c) 2023 Tejun Heo <tj@kernel.org> */ #include <bpf/bpf.h> #include <scx/common.h> #include <sys/wait.h> #include <unistd.h> #include "select_cpu_...
Linux kernel'inin 'tools/testing/selftests/sched_ext/ddsp_bogus_dsq_fail' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* SPDX-License-Identifier: GPL-2.0 */ /* * Copyright (c) 2024 Meta Platforms, Inc. and affiliates. * Copyright (c) 2024 David Vernet <dvernet@meta.com> * Copyright (c) 2024 Tejun Heo <tj@kernel.org> */ #include <bpf/bpf.h> #include <scx/common.h> #include <sys/wait.h> #include <unistd.h> #include "ddsp_bogus_...
Linux kernel'inin 'tools/testing/selftests/sched_ext/create_dsq' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* SPDX-License-Identifier: GPL-2.0 */ /* * Copyright (c) 2024 Meta Platforms, Inc. and affiliates. * Copyright (c) 2024 David Vernet <dvernet@meta.com> */ #include <bpf/bpf.h> #include <scx/common.h> #include <sys/wait.h> #include <unistd.h> #include "create_dsq.bpf.skel.h" #include "scx_test.h" static enum s...
Linux kernel'inin 'tools/testing/selftests/sched_ext/allowed_cpus.bpf' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * A scheduler that validates the behavior of scx_bpf_select_cpu_and() by * selecting idle CPUs strictly within a subset of allowed CPUs. * * Copyright (c) 2025 Andrea Righi <arighi@nvidia.com> */ #include <scx/common.bpf.h> char _license[] SEC("license") = "GPL"; UEI_...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/sched_ext/scx_test' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0 */ /* * Copyright (c) 2023 Meta Platforms, Inc. and affiliates. * Copyright (c) 2023 Tejun Heo <tj@kernel.org> * Copyright (c) 2023 David Vernet <dvernet@meta.com> */ #ifndef __SCX_TEST_H__ #define __SCX_TEST_H__ #include <errno.h> #include <scx/common.h> #include <scx/com...
Linux kernel'inin 'tools/testing/selftests/sched_ext/enq_last_no_enq_fails' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* SPDX-License-Identifier: GPL-2.0 */ /* * Copyright (c) 2023 Meta Platforms, Inc. and affiliates. * Copyright (c) 2023 David Vernet <dvernet@meta.com> * Copyright (c) 2023 Tejun Heo <tj@kernel.org> */ #include <bpf/bpf.h> #include <scx/common.h> #include <sys/wait.h> #include <unistd.h> #include "enq_last_no...
Linux kernel'inin 'tools/testing/selftests/sched_ext/test_example' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* SPDX-License-Identifier: GPL-2.0 */ /* * Copyright (c) 2024 Meta Platforms, Inc. and affiliates. * Copyright (c) 2024 Tejun Heo <tj@kernel.org> * Copyright (c) 2024 David Vernet <dvernet@meta.com> */ #include <bpf/bpf.h> #include <scx/common.h> #include "scx_test.h" static bool setup_called = false; static...
Linux kernel'inin 'tools/testing/selftests/sched_ext/prog_run' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* SPDX-License-Identifier: GPL-2.0 */ /* * Copyright (c) 2024 Meta Platforms, Inc. and affiliates. * Copyright (c) 2024 David Vernet <dvernet@meta.com> */ #include <bpf/bpf.h> #include <sched.h> #include <scx/common.h> #include <sys/wait.h> #include <unistd.h> #include "prog_run.bpf.skel.h" #include "scx_test....
Linux kernel'inin 'tools/testing/selftests/sched_ext/enq_select_cpu.bpf' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * Copyright (c) 2023 Meta Platforms, Inc. and affiliates. * Copyright (c) 2023 David Vernet <dvernet@meta.com> * Copyright (c) 2023 Tejun Heo <tj@kernel.org> */ #include <scx/common.bpf.h> char _license[] SEC("license") = "GPL"; UEI_DEFINE(uei); s32 BPF_STRUCT_OPS(enq...
Linux kernel'inin 'tools/testing/selftests/sched_ext/reload_loop' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* SPDX-License-Identifier: GPL-2.0 */ /* * Copyright (c) 2024 Meta Platforms, Inc. and affiliates. * Copyright (c) 2024 David Vernet <dvernet@meta.com> */ #include <bpf/bpf.h> #include <pthread.h> #include <scx/common.h> #include <sys/wait.h> #include <unistd.h> #include "maximal.bpf.skel.h" #include "scx_test...
Linux kernel'inin 'tools/testing/selftests/sched_ext/select_cpu_vtime' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* SPDX-License-Identifier: GPL-2.0 */ /* * Copyright (c) 2024 Meta Platforms, Inc. and affiliates. * Copyright (c) 2024 David Vernet <dvernet@meta.com> * Copyright (c) 2024 Tejun Heo <tj@kernel.org> */ #include <bpf/bpf.h> #include <scx/common.h> #include <sys/wait.h> #include <unistd.h> #include "select_cpu_...
Linux kernel'inin 'tools/testing/selftests/sched_ext/cyclic_kick_wait.bpf' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* SPDX-License-Identifier: GPL-2.0 */ /* * Stress concurrent SCX_KICK_WAIT calls to reproduce wait-cycle deadlock. * * Three CPUs are designated from userspace. Every enqueue from one of the * three CPUs kicks the next CPU in the ring with SCX_KICK_WAIT, creating a * persistent A -> B -> C -> A wait cycle pr...
Linux kernel'inin 'tools/testing/selftests/sched_ext/rt_stall' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * Copyright (c) 2025 NVIDIA Corporation. */ #define _GNU_SOURCE #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <sched.h> #include <sys/prctl.h> #include <sys/types.h> #include <sys/wait.h> #include <time.h> #include <linux/sched.h> #include <signal.h> #...
Linux kernel'inin 'tools/testing/selftests/sched_ext/minimal' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* SPDX-License-Identifier: GPL-2.0 */ /* * Copyright (c) 2023 Meta Platforms, Inc. and affiliates. * Copyright (c) 2023 David Vernet <dvernet@meta.com> * Copyright (c) 2023 Tejun Heo <tj@kernel.org> */ #include <bpf/bpf.h> #include <scx/common.h> #include <sys/wait.h> #include <unistd.h> #include "minimal.bpf...
Linux kernel'inin 'tools/testing/selftests/sched_ext/hotplug' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* SPDX-License-Identifier: GPL-2.0 */ /* * Copyright (c) 2024 Meta Platforms, Inc. and affiliates. * Copyright (c) 2024 David Vernet <dvernet@meta.com> */ #include <bpf/bpf.h> #include <sched.h> #include <scx/common.h> #include <sys/wait.h> #include <unistd.h> #include "hotplug_test.h" #include "hotplug.bpf.s...
Linux kernel'inin 'tools/testing/selftests/sched_ext/ddsp_vtimelocal_fail' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* SPDX-License-Identifier: GPL-2.0 */ /* * Copyright (c) 2024 Meta Platforms, Inc. and affiliates. * Copyright (c) 2024 David Vernet <dvernet@meta.com> * Copyright (c) 2024 Tejun Heo <tj@kernel.org> */ #include <bpf/bpf.h> #include <scx/common.h> #include <unistd.h> #include "ddsp_vtimelocal_fail.bpf.skel.h" ...
Linux kernel'inin 'tools/testing/selftests/sched_ext/exit.bpf' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* SPDX-License-Identifier: GPL-2.0 */ /* * Copyright (c) 2024 Meta Platforms, Inc. and affiliates. * Copyright (c) 2024 David Vernet <dvernet@meta.com> */ #include <scx/common.bpf.h> char _license[] SEC("license") = "GPL"; #include "exit_test.h" const volatile int exit_point; UEI_DEFINE(uei); #define EXIT...
Linux kernel'inin 'tools/testing/selftests/sched_ext/init_enable_count' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* SPDX-License-Identifier: GPL-2.0 */ /* * Copyright (c) 2023 Meta Platforms, Inc. and affiliates. * Copyright (c) 2023 David Vernet <dvernet@meta.com> * Copyright (c) 2023 Tejun Heo <tj@kernel.org> */ #include <signal.h> #include <stdio.h> #include <unistd.h> #include <sched.h> #include <bpf/bpf.h> #include ...
Linux kernel'inin 'tools/testing/selftests/sched_ext/runner' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* SPDX-License-Identifier: GPL-2.0 */ /* * Copyright (c) 2024 Meta Platforms, Inc. and affiliates. * Copyright (c) 2024 David Vernet <dvernet@meta.com> * Copyright (c) 2024 Tejun Heo <tj@kernel.org> */ #include <stdio.h> #include <unistd.h> #include <signal.h> #include <libgen.h> #include <bpf/bpf.h> #include...
Linux kernel'inin 'tools/testing/selftests/sched_ext/select_cpu_dispatch_dbl_dsp.bpf' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* SPDX-License-Identifier: GPL-2.0 */ /* * A scheduler that validates the behavior of direct dispatching with a default * select_cpu implementation. * * Copyright (c) 2023 Meta Platforms, Inc. and affiliates. * Copyright (c) 2023 David Vernet <dvernet@meta.com> * Copyright (c) 2023 Tejun Heo <tj@kernel.org>...
Linux kernel'inin 'tools/testing/selftests/sched_ext/ddsp_bogus_dsq_fail.bpf' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* SPDX-License-Identifier: GPL-2.0 */ /* * Copyright (c) 2024 Meta Platforms, Inc. and affiliates. * Copyright (c) 2024 David Vernet <dvernet@meta.com> * Copyright (c) 2024 Tejun Heo <tj@kernel.org> */ #include <scx/common.bpf.h> char _license[] SEC("license") = "GPL"; UEI_DEFINE(uei); s32 BPF_STRUCT_OPS(d...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/sched_ext/exit_test' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0 */ /* * Copyright (c) 2024 Meta Platforms, Inc. and affiliates. * Copyright (c) 2024 David Vernet <dvernet@meta.com> */ #ifndef __EXIT_TEST_H__ #define __EXIT_TEST_H__ enum exit_test_case { EXIT_SELECT_CPU, EXIT_ENQUEUE, EXIT_DISPATCH, EXIT_ENABLE, EXIT_INIT_TASK, EXI...
Linux kernel'inin 'tools/testing/selftests/sched_ext/rt_stall.bpf' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * A scheduler that verified if RT tasks can stall SCHED_EXT tasks. * * Copyright (c) 2025 NVIDIA Corporation. */ #include <scx/common.bpf.h> char _license[] SEC("license") = "GPL"; UEI_DEFINE(uei); void BPF_STRUCT_OPS(rt_stall_exit, struct scx_exit_info *ei) { UEI_RE...
Linux kernel'inin 'tools/testing/selftests/sched_ext/select_cpu_dispatch_bad_dsq' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* SPDX-License-Identifier: GPL-2.0 */ /* * Copyright (c) 2023 Meta Platforms, Inc. and affiliates. * Copyright (c) 2023 David Vernet <dvernet@meta.com> * Copyright (c) 2023 Tejun Heo <tj@kernel.org> */ #include <bpf/bpf.h> #include <scx/common.h> #include <sys/wait.h> #include <unistd.h> #include "select_cpu_...
Linux kernel'inin 'tools/testing/selftests/sched_ext/select_cpu_dfl_nodispatch' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* SPDX-License-Identifier: GPL-2.0 */ /* * Copyright (c) 2023 Meta Platforms, Inc. and affiliates. * Copyright (c) 2023 David Vernet <dvernet@meta.com> * Copyright (c) 2023 Tejun Heo <tj@kernel.org> */ #include <bpf/bpf.h> #include <scx/common.h> #include <sys/wait.h> #include <unistd.h> #include "select_cpu_...
Linux kernel'inin 'tools/testing/selftests/sched_ext/cyclic_kick_wait' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* SPDX-License-Identifier: GPL-2.0 */ /* * Test SCX_KICK_WAIT forward progress under cyclic wait pressure. * * SCX_KICK_WAIT busy-waits until the target CPU enters the scheduling path. * If multiple CPUs form a wait cycle (A waits for B, B waits for C, C waits * for A), all CPUs deadlock unless the implement...
Linux kernel'inin 'tools/testing/selftests/sched_ext/select_cpu_dispatch.bpf' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* SPDX-License-Identifier: GPL-2.0 */ /* * A scheduler that validates the behavior of direct dispatching with a default * select_cpu implementation. * * Copyright (c) 2023 Meta Platforms, Inc. and affiliates. * Copyright (c) 2023 David Vernet <dvernet@meta.com> * Copyright (c) 2023 Tejun Heo <tj@kernel.org>...
Linux kernel'inin 'tools/testing/selftests/sched_ext/non_scx_kfunc_deny' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* SPDX-License-Identifier: GPL-2.0 */ /* * Verify that context-sensitive SCX kfuncs (even "unlocked" ones) are * restricted to only SCX struct_ops programs. Non-SCX struct_ops programs, * such as TCP congestion control programs, should be rejected by the BPF * verifier when attempting to call these kfuncs. *...
Linux kernel'inin 'tools/testing/selftests/sched_ext/dsp_local_on' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* SPDX-License-Identifier: GPL-2.0 */ /* * Copyright (c) 2024 Meta Platforms, Inc. and affiliates. * Copyright (c) 2024 David Vernet <dvernet@meta.com> */ #include <bpf/bpf.h> #include <scx/common.h> #include <unistd.h> #include "dsp_local_on.bpf.skel.h" #include "scx_test.h" static enum scx_test_status setup...
Linux kernel'inin 'tools/testing/selftests/sched_ext/util' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* SPDX-License-Identifier: GPL-2.0 */ /* * Copyright (c) 2024 Meta Platforms, Inc. and affiliates. * Copyright (c) 2024 David Vernet <dvernet@meta.com> */ #include <errno.h> #include <fcntl.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> /* Returns read len on success, or -er...
Linux kernel'inin 'tools/testing/selftests/sched_ext/select_cpu_dispatch_bad_dsq.bpf' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* SPDX-License-Identifier: GPL-2.0 */ /* * A scheduler that validates the behavior of direct dispatching with a default * select_cpu implementation. * * Copyright (c) 2023 Meta Platforms, Inc. and affiliates. * Copyright (c) 2023 David Vernet <dvernet@meta.com> * Copyright (c) 2023 Tejun Heo <tj@kernel.org>...
Linux kernel'inin 'tools/testing/selftests/sched_ext/peek_dsq' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * Test for DSQ operations including create, destroy, and peek operations. * * Copyright (c) 2025 Meta Platforms, Inc. and affiliates. * Copyright (c) 2025 Ryan Newton <ryan.newton@alum.mit.edu> */ #include <bpf/bpf.h> #include <scx/common.h> #include <sys/wait.h> #includ...
Linux kernel'inin 'tools/testing/selftests/sched_ext/maximal.bpf' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* SPDX-License-Identifier: GPL-2.0 */ /* * A scheduler with every callback defined. * * This scheduler defines every callback. * * Copyright (c) 2024 Meta Platforms, Inc. and affiliates. * Copyright (c) 2024 David Vernet <dvernet@meta.com> */ #include <scx/common.bpf.h> char _license[] SEC("license") = "...
Linux kernel'inin 'tools/testing/selftests/sched_ext/numa.bpf' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * A scheduler that validates the behavior of the NUMA-aware * functionalities. * * The scheduler creates a separate DSQ for each NUMA node, ensuring tasks * are exclusively processed by CPUs within their respective nodes. Idle * CPUs are selected only within the same no...
Linux kernel'inin 'tools/testing/selftests/nolibc/nolibc-test-linkage' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* SPDX-License-Identifier: GPL-2.0 */ #include "nolibc-test-linkage.h" #include <errno.h> void *linkage_test_errno_addr(void) { return &errno; } int linkage_test_constructor_test_value = 0; __attribute__((constructor)) static void constructor1(void) { linkage_test_constructor_test_value |= 1 << 0; } __att...
Linux kernel'inin 'tools/testing/selftests/nolibc/nolibc-test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* SPDX-License-Identifier: GPL-2.0 */ #define _GNU_SOURCE #define _LARGEFILE64_SOURCE /* libc-specific include files * The program may be built in 3 ways: * $(CC) -nostdlib -include /path/to/nolibc.h => NOLIBC already defined * $(CC) -nostdlib -I/path/to/nolibc/sysroot => _NOLIBC_* guards are present *...
Linux kernel'inin 'tools/testing/selftests/nolibc/nolibc-test-ignore-errno' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* SPDX-License-Identifier: GPL-2.0 */ #define NOLIBC_IGNORE_ERRNO /* Include all of nolibc and make sure everything compiles */ #include <stdlib.h> ```
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/nolibc/nolibc-test-linkage' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0 */ #ifndef _NOLIBC_TEST_LINKAGE_H #define _NOLIBC_TEST_LINKAGE_H void *linkage_test_errno_addr(void); extern int linkage_test_constructor_test_value; #endif /* _NOLIBC_TEST_LINKAGE_H */ ```
Linux kernel'inin 'tools/testing/selftests/ptp/testptp' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-or-later /* * PTP 1588 clock support - User space test program * * Copyright (C) 2010 OMICRON electronics GmbH */ #define _GNU_SOURCE #define __SANE_USERSPACE_TYPES__ /* For PPC64, to get LL64 types */ #include <errno.h> #include <fcntl.h> #include <inttypes.h> #inclu...
Linux kernel'inin 'tools/testing/selftests/capabilities/validate_cap' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #include <cap-ng.h> #include <linux/capability.h> #include <stdbool.h> #include <string.h> #include <stdio.h> #include <sys/prctl.h> #include <sys/auxv.h> #include "kselftest.h" #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 19) # define HAVE_GETAUXVAL #endif stat...
Linux kernel'inin 'tools/testing/selftests/capabilities/test_execve' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #define _GNU_SOURCE #include <cap-ng.h> #include <linux/capability.h> #include <stdbool.h> #include <string.h> #include <stdio.h> #include <fcntl.h> #include <errno.h> #include <stdarg.h> #include <sched.h> #include <sys/mount.h> #include <limits.h> #include <libgen.h> #include...
Linux kernel'inin 'tools/testing/selftests/mm/pkey_util' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only #define __SANE_USERSPACE_TYPES__ #include <sys/syscall.h> #include <unistd.h> #include "pkey-helpers.h" int sys_pkey_alloc(unsigned long flags, unsigned long init_val) { int ret = syscall(SYS_pkey_alloc, flags, init_val); dprintf1("%s(flags=%lx, init_val=%lx) syscall re...
Linux kernel'inin 'tools/testing/selftests/mm/hugetlb_madv_vs_map' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * A test case that must run on a system with one and only one huge page available. * # echo 1 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages * * During setup, the test allocates the only available page, and starts three threads: * - thread1: * * madvise(MADV_...
Linux kernel'inin 'tools/testing/selftests/mm/soft-dirty' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #include <stdio.h> #include <string.h> #include <stdbool.h> #include <fcntl.h> #include <stdint.h> #include <malloc.h> #include <sys/mman.h> #include "kselftest.h" #include "vm_util.h" #include "thp_settings.h" #define PAGEMAP_FILE_PATH "/proc/self/pagemap" #define TEST_ITERAT...
Linux kernel'inin 'tools/testing/selftests/mm/hugepage-mremap' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * hugepage-mremap: * * Example of remapping huge page memory in a user application using the * mremap system call. The path to a file in a hugetlbfs filesystem must * be passed as the last argument to this test. The amount of memory used * by this test in MBs can opti...
Linux kernel'inin 'tools/testing/selftests/mm/hugetlb_dio' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * This program tests for hugepage leaks after DIO writes to a file using a * hugepage as the user buffer. During DIO, the user buffer is pinned and * should be properly unpinned upon completion. This patch verifies that the * kernel correctly unpins the buffer at DIO comp...
Linux kernel'inin 'tools/testing/selftests/mm/mkdirty' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Test handling of code that might set PTE/PMD dirty in read-only VMAs. * Setting a PTE/PMD dirty must not accidentally set the PTE/PMD writable. * * Copyright 2023, Red Hat, Inc. * * Author(s): David Hildenbrand <david@redhat.com> */ #include <fcntl.h> #include <...
Linux kernel'inin 'tools/testing/selftests/mm/rmap' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * RMAP functional tests * * Author(s): Wei Yang <richard.weiyang@gmail.com> */ #include "kselftest_harness.h" #include <strings.h> #include <pthread.h> #include <numa.h> #include <numaif.h> #include <sys/mman.h> #include <sys/prctl.h> #include <sys/types.h> #include <sig...
Linux kernel'inin 'tools/testing/selftests/mm/transhuge-stress' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* * Stress test for transparent huge pages, memory compaction and migration. * * Authors: Konstantin Khlebnikov <koct9i@gmail.com> * * This is free and unencumbered software released into the public domain. */ #include <stdlib.h> #include <stdio.h> #include <stdint.h> #include <err.h> #include <time.h> #in...
Linux kernel'inin 'tools/testing/selftests/mm/droppable' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * Copyright (C) 2024 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved. */ #include <assert.h> #include <stdbool.h> #include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <signal.h> #include <sys/mman.h> #include <linux/mman.h> #in...
Linux kernel'inin 'tools/testing/selftests/mm/gup_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c #define __SANE_USERSPACE_TYPES__ // Use ll64 #include <fcntl.h> #include <errno.h> #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <dirent.h> #include <sys/ioctl.h> #include <sys/mman.h> #include <sys/stat.h> #include <sys/types.h> #include <pthread.h> #include <assert.h> #include <mm/gup_test....
Linux kernel'inin 'tools/testing/selftests/mm/map_populate' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * Copyright (c) 2018 Dmitry Safonov, Arista Networks * * MAP_POPULATE | MAP_PRIVATE should COW VMA pages. */ #define _GNU_SOURCE #include <errno.h> #include <fcntl.h> #include <sys/mman.h> #include <sys/socket.h> #include <sys/types.h> #include <sys/wait.h> #include <std...
Linux kernel'inin 'tools/testing/selftests/mm/pfnmap' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Basic VM_PFNMAP tests relying on mmap() of input file provided. * Use '/dev/mem' as default. * * Copyright 2025, Red Hat, Inc. * * Author(s): David Hildenbrand <david@redhat.com> */ #define _GNU_SOURCE #include <stdlib.h> #include <string.h> #include <stdint.h> ...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/mm/uffd-common' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Userfaultfd tests common header * * Copyright (C) 2015-2023 Red Hat, Inc. */ #ifndef __UFFD_COMMON_H__ #define __UFFD_COMMON_H__ #define _GNU_SOURCE #define __SANE_USERSPACE_TYPES__ // Use ll64 #include <stdio.h> #include <errno.h> #include <unistd.h> #include <s...
Linux kernel'inin 'tools/testing/selftests/mm/merge' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-or-later #define _GNU_SOURCE #include "kselftest_harness.h" #include <linux/prctl.h> #include <fcntl.h> #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <sys/mman.h> #include <sys/prctl.h> #include <sys/syscall.h> #include <sys/wait.h> #include <linux/perf_ev...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/mm/thp_settings' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0 */ #ifndef __THP_SETTINGS_H__ #define __THP_SETTINGS_H__ #include <stdbool.h> #include <stddef.h> #include <stdint.h> enum thp_enabled { THP_NEVER, THP_ALWAYS, THP_INHERIT, THP_MADVISE, }; enum thp_defrag { THP_DEFRAG_ALWAYS, THP_DEFRAG_DEFER, THP_DEFRAG_DEFER_MADVISE,...
Linux kernel'inin 'tools/testing/selftests/mm/folio_split_race_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * The test creates shmem PMD huge pages, fills all pages with known patterns, * then continuously verifies non-punched pages with 16 threads. Meanwhile, the * main thread punches holes via MADV_REMOVE on the shmem. * * It tests the race condition between folio_split() an...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/mm/pkey-helpers' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0 */ #ifndef _PKEYS_HELPER_H #define _PKEYS_HELPER_H #define _GNU_SOURCE #include <string.h> #include <stdarg.h> #include <stdio.h> #include <stdint.h> #include <stdbool.h> #include <signal.h> #include <assert.h> #include <stdlib.h> #include <ucontext.h> #include <sys/mman.h> #in...
Linux kernel'inin 'tools/testing/selftests/mm/on-fault-limit' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #include <sys/mman.h> #include <stdio.h> #include <unistd.h> #include <string.h> #include <sys/time.h> #include <sys/resource.h> #include "kselftest.h" static void test_limit(void) { struct rlimit lims; void *map; if (getrlimit(RLIMIT_MEMLOCK, &lims)) ksft_exit_fail_msg("...
Linux kernel'inin 'tools/testing/selftests/mm/vm_util' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #include <string.h> #include <errno.h> #include <fcntl.h> #include <dirent.h> #include <inttypes.h> #include <sys/ioctl.h> #include <linux/userfaultfd.h> #include <linux/fs.h> #include <sys/syscall.h> #include <unistd.h> #include "kselftest.h" #include "vm_util.h" #define PMD_S...
Linux kernel'inin 'tools/testing/selftests/mm/process_madv' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-or-later #define _GNU_SOURCE #include "kselftest_harness.h" #include <errno.h> #include <setjmp.h> #include <signal.h> #include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <linux/mman.h> #include <sys/syscall.h> #include <unistd.h> #include <...
Linux kernel'inin 'tools/testing/selftests/mm/ksm_tests' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #include <sys/mman.h> #include <sys/prctl.h> #include <sys/wait.h> #include <stdbool.h> #include <time.h> #include <string.h> #include <numa.h> #include <unistd.h> #include <fcntl.h> #include <stdint.h> #include <err.h> #include "kselftest.h" #include <include/vdso/time64.h> #...
Linux kernel'inin 'tools/testing/selftests/mm/migration' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * The main purpose of the tests here is to exercise the migration entry code * paths in the kernel. */ #include "kselftest_harness.h" #include "thp_settings.h" #include <strings.h> #include <pthread.h> #include <numa.h> #include <numaif.h> #include <sys/mman.h> #include ...
Linux kernel'inin 'tools/testing/selftests/mm/mremap_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * Copyright 2020 Google LLC */ #define _GNU_SOURCE #include <errno.h> #include <fcntl.h> #include <linux/userfaultfd.h> #include <stdlib.h> #include <stdio.h> #include <string.h> #include <sys/ioctl.h> #include <sys/mman.h> #include <syscall.h> #include <time.h> #include <...
Linux kernel'inin 'tools/testing/selftests/mm/hugepage-vmemmap' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * A test case of using hugepage memory in a user application using the * mmap system call with MAP_HUGETLB flag. Before running this program * make sure the administrator has allocated enough default sized huge * pages to cover the 2 MB allocation. */ #include <stdlib.h...
Linux kernel'inin 'tools/testing/selftests/mm/cow' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * COW (Copy On Write) tests. * * Copyright 2022, Red Hat, Inc. * * Author(s): David Hildenbrand <david@redhat.com> */ #define _GNU_SOURCE #include <stdlib.h> #include <string.h> #include <stdbool.h> #include <stdint.h> #include <unistd.h> #include <errno.h> #includ...
Linux kernel'inin 'tools/testing/selftests/mm/compaction_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * * A test for the patch "Allow compaction of unevictable pages". * With this patch we should be able to allocate at least 1/4 * of RAM in huge pages. Without the patch much less is * allocated. */ #include <stdio.h> #include <stdlib.h> #include <sys/mman.h> #include <...
Linux kernel'inin 'tools/testing/selftests/mm/uffd-wp-mremap' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only #define _GNU_SOURCE #include <stdbool.h> #include <stdint.h> #include <fcntl.h> #include <assert.h> #include <linux/mman.h> #include <sys/mman.h> #include "kselftest.h" #include "thp_settings.h" #include "uffd-common.h" static int pagemap_fd; static size_t pagesize; stati...
Linux kernel'inin 'tools/testing/selftests/mm/hugetlb-madvise' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * hugepage-madvise: * * Basic functional testing of madvise MADV_DONTNEED and MADV_REMOVE * on hugetlb mappings. * * Before running this test, make sure the administrator has pre-allocated * at least MIN_FREE_PAGES hugetlb pages and they are free. In addition, * the ...
Linux kernel'inin 'tools/testing/selftests/mm/ksm_functional_tests' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * KSM functional tests * * Copyright 2022, Red Hat, Inc. * * Author(s): David Hildenbrand <david@redhat.com> */ #define _GNU_SOURCE #include <stdlib.h> #include <string.h> #include <stdbool.h> #include <stdint.h> #include <unistd.h> #include <errno.h> #include <fcn...
Linux kernel'inin 'tools/testing/selftests/mm/mrelease_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * Copyright 2022 Google LLC */ #define _GNU_SOURCE #include <errno.h> #include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <sys/syscall.h> #include <sys/wait.h> #include <unistd.h> #include <asm-generic/unistd.h> #include "vm_util.h" #include "kselftest.h" ...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/mm/pkey-powerpc' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0 */ #ifndef _PKEYS_POWERPC_H #define _PKEYS_POWERPC_H #include <sys/stat.h> #ifndef SYS_pkey_alloc # define SYS_pkey_alloc 384 # define SYS_pkey_free 385 #endif #define REG_IP_IDX PT_NIP #define MCONTEXT_IP(mc) mc.gp_regs[REG_IP_IDX] #define MCONTEXT_TRAPNO(mc) mc.gp_regs[...
Linux kernel'inin 'tools/testing/selftests/mm/hugetlb-read-hwpoison' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #define _GNU_SOURCE #include <stdlib.h> #include <stdio.h> #include <string.h> #include <linux/magic.h> #include <sys/mman.h> #include <sys/statfs.h> #include <errno.h> #include <stdbool.h> #include "kselftest.h" #define PREFIX " ... " #define ERROR_PREFIX " !!! " #define M...
Linux kernel'inin 'tools/testing/selftests/mm/thuge-gen' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* Test selecting other page sizes for mmap/shmget. Before running this huge pages for each huge page size must have been reserved. For large pages beyond MAX_PAGE_ORDER (like 1GB on x86) boot options must be used. 1GB wouldn't be tested if it isn't available. Al...
Linux kernel'inin 'tools/testing/selftests/mm/map_hugetlb' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * Example of using hugepage memory in a user application using the mmap * system call with MAP_HUGETLB flag. Before running this program make * sure the administrator has allocated enough default sized huge pages * to cover the 256 MB allocation. */ #include <stdlib.h> ...
Linux kernel'inin 'tools/testing/selftests/mm/mdwe_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #ifdef __aarch64__ #include <asm/hwcap.h> #endif #include <linux/mman.h> #include <linux/prctl.h> #include <stdio.h> #include <stdlib.h> #include <sys/auxv.h> #include <sys/prctl.h> #include <sys/wait.h> #include <unistd.h> #include "kselftest_harness.h" #ifndef __aarch64__...