Quellcodebibliothek Statistik Leitseite products/sources/formale Sprachen/C/Linux/tools/testing/selftests/sched_ext/   (Open Source Betriebssystem Version 6.17.9©)  Datei vom 24.10.2025 mit Größe 1 kB image not shown  

Quelle  create_dsq.bpf.c   Sprache: 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, struct task_struct *p,
      struct scx_exit_task_args *args)
{
 scx_bpf_destroy_dsq(p->pid);
}

s32 BPF_STRUCT_OPS_SLEEPABLE(create_dsq_init_task, struct task_struct *p,
        struct scx_init_task_args *args)
{
 s32 err;

 err = scx_bpf_create_dsq(p->pid, -1);
 if (err)
  scx_bpf_error("Failed to create DSQ for %s[%d]",
         p->comm, p->pid);

 return err;
}

s32 BPF_STRUCT_OPS_SLEEPABLE(create_dsq_init)
{
 u32 i;
 s32 err;

 bpf_for(i, 0, 1024) {
  err = scx_bpf_create_dsq(i, -1);
  if (err) {
   scx_bpf_error("Failed to create DSQ %d", i);
   return 0;
  }
 }

 bpf_for(i, 0, 1024) {
  scx_bpf_destroy_dsq(i);
 }

 return 0;
}

SEC(".struct_ops.link")
struct sched_ext_ops create_dsq_ops = {
 .init_task  = (void *) create_dsq_init_task,
 .exit_task  = (void *) create_dsq_exit_task,
 .init   = (void *) create_dsq_init,
 .name   = "create_dsq",
};

Messung V0.5
C=97 H=96 G=96

¤ Dauer der Verarbeitung: 0.2 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.