From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0BBB5C5ACAE for ; Wed, 11 Sep 2019 18:53:46 +0000 (UTC) Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C089E20578 for ; Wed, 11 Sep 2019 18:53:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="FOJrUEA+" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C089E20578 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=fail smtp.mailfrom=kernelnewbies-bounces@kernelnewbies.org Received: from localhost ([::1] helo=shelob.surriel.com) by shelob.surriel.com with esmtp (Exim 4.92.2) (envelope-from ) id 1i87k2-0002M1-KH; Wed, 11 Sep 2019 14:53:22 -0400 Received: from mail-oi1-x230.google.com ([2607:f8b0:4864:20::230]) by shelob.surriel.com with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.92.2) (envelope-from ) id 1i87k0-0002Lq-Kg for kernelnewbies@kernelnewbies.org; Wed, 11 Sep 2019 14:53:20 -0400 Received: by mail-oi1-x230.google.com with SMTP id k20so15021145oih.3 for ; Wed, 11 Sep 2019 11:53:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=t3k7kCOEQ+PU62IlejrXjduvD9VObmyXhHB/l0LJFoY=; b=FOJrUEA+1yv6zcSw0/zmeG5IcPMvFmB1rSbbdcY1+T1d2CE0zGQOHHQ5bQ06l6u6Br y3y+fWhcHAHVXey77Ypqn8/kMDnz5X66KLGaKOjiSdqzwwwL0QaZOb3Sp2tsOxLT8YXT tar538HxN3q43616s7olQOIe+NGgfgS2NbbQrYtejSdULe5PPPe3FQg0imM1NQetPgrB eHL9BQZbOn1oId6dKzBHXcwmRwGEvx2At4AWkEVPhxIdE30QDrpmVVNt9MLXMXpa9wjq t1PjbH3Ewo17zHXtaFtcJLl6+Ky9JUaY/k+9/MRrLf1sYAIhsKn3lrLYDyagIEfkjkD3 7C6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=t3k7kCOEQ+PU62IlejrXjduvD9VObmyXhHB/l0LJFoY=; b=ecS5wY+1ZWcQWkcsy6GIE/zONeFgitZrEoxn56Qsb53kjxfrSf6+7CQsTfWx8/Qv7T v66rd9NY3h06CF+BH9kN2QQBjRXRLVBnVgF7+WuEMMGclAAal4AIRmRyzcU4EW7qoLn1 lvDZgGTNJf3DgCqbaRjQkPJDqg++yQXbkzV0hgXkzbc679czLFWAuMNfPleulSJ1lg7c ZbsxNyWjaNCP0FXwsVEgeT+RwybLU+LHNMx3pF2mT6VzpksQjsJa031ONE3VoenjDDmG 41I559QVqMp9nEZedYsAHb7ibczP6PAOniA9YirdR/YhZYZBx9GTP8snfEDYVuRGZtwI 3FfQ== X-Gm-Message-State: APjAAAXWL2Xo7//M5xgTTYCV6FVjzg1tOjDTKh+yqFLTJTvnswub1Nmn 9c2krg8PV649TIhruQKhPOHSMh2QqoWdTcXHsbWxUBm6 X-Google-Smtp-Source: APXvYqyflUQiot0MNEO7ZCOkkoFGR4w8EyePtTY2Pw2pAPM0lqaLBGQgudz+y6KmkeVvB7IuCnh69X2ucmz0ULoaNqU= X-Received: by 2002:a54:4e8f:: with SMTP id c15mr5607530oiy.117.1568227937827; Wed, 11 Sep 2019 11:52:17 -0700 (PDT) MIME-Version: 1.0 From: Martin Galvan Date: Wed, 11 Sep 2019 15:52:06 -0300 Message-ID: Subject: Setting CPU affinity for current process on kernel module? To: kernelnewbies@kernelnewbies.org X-BeenThere: kernelnewbies@kernelnewbies.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Learn about the Linux kernel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kernelnewbies-bounces@kernelnewbies.org Hi, I have a kernel module which needs to perform CPU core-specific operations. I know that there's a kernel mode version of sched_setaffinity, however it's not exported to modules and can only be accessed through e.g. kallsyms_lookup_name, which is ugly. The alternative is to spawn a new kthread and bind it to the desired CPU before starting it, but I was wondering if there's a more straightforward method of doing this. Thanks! _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies