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=-2.3 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,USER_AGENT_SANE_1 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 3306EC49ED9 for ; Thu, 12 Sep 2019 09:26:57 +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 E599F2084F for ; Thu, 12 Sep 2019 09:26:56 +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="RuTCDKZ7" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E599F2084F 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 1i8LN0-0001e3-5k; Thu, 12 Sep 2019 05:26:30 -0400 Received: from mail-pg1-x531.google.com ([2607:f8b0:4864:20::531]) by shelob.surriel.com with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.92.2) (envelope-from ) id 1i8LMx-0001dx-66 for kernelnewbies@kernelnewbies.org; Thu, 12 Sep 2019 05:26:27 -0400 Received: by mail-pg1-x531.google.com with SMTP id u17so13154444pgi.6 for ; Thu, 12 Sep 2019 02:26:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=SHmIu2z1VnG5d3atXLxc3IfViJ7i6vO9wsfno+cTJUQ=; b=RuTCDKZ7T7k4mHIiAwmVS6IMZP/MHKzZ5J67P2cC96uNXo0siJe/NRqpCO9iIOF2sI w5P8Qc9nN/SF8O+XrVJoQ5XOT9VdcXutt6RP0c5PHcEhLzV71Orc2xx27nFaRwOI5gK2 t7q0GDxlPDkMg4p9lUEB5YSTwpBJ2vifFhjzoHsOWbrnnEaohqbxpOaE8rnr3IG2HXet Jg0hObnNVEOIE+xeson19WlhBk6zJB7FleQVlmKfnRfVvyfOw5t9VxdvDjAYEb8vOx6l sLXUS9nXucZ+jtsuZD2uKO3RSOHurRFedE4TtGpucXwr58KwfXbHiip0rmNNDDT/NpbA lRVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=SHmIu2z1VnG5d3atXLxc3IfViJ7i6vO9wsfno+cTJUQ=; b=oFPreT6eo2OIuFo26z/zloWpNwYLvY5V8uOhrZyf93m80O12slBqcux6ch8gppMbQc D31Sga8kYpv2Rgy93onlho3u2w6qxj9iS8wTGc2srlvfUpgI5ErqzHDoxKC2Z21f9pBF HLNgzWvFFJExB3e5QztrohXDgtFOHcZ49gT0+ixqMdYENegwz5m5MKk57FB2aC9+iXLF 3wVSEG9bk868tsRHEnt1y+YLMGfGaqFr2weACP8ESzBwn+JgDqXt0X2NASPfvmsOxXmH 6ZDcKOJKeCCStLw6HDYQLNlAkFfmjk8AimrOM+Z5ETB0m5YbFjAqeXdCqbM+d7PG1s7u PBEQ== X-Gm-Message-State: APjAAAUK2Z0PG17fZMcDqcR2lhl4uWpNM/JrJsEDoapTjhrcdGgR+oox kg7QsXPlH3ZnLqa+4WixAd0= X-Google-Smtp-Source: APXvYqyY4cBGd8OYgAur/rc60Kq4KZMnxJrDZuZttHev6gkPuo3dlwSVes8s1POgk4TDsTiFv37bDQ== X-Received: by 2002:a62:76d1:: with SMTP id r200mr48916701pfc.27.1568280383483; Thu, 12 Sep 2019 02:26:23 -0700 (PDT) Received: from bharath12345-Inspiron-5559 ([117.198.99.29]) by smtp.gmail.com with ESMTPSA id d22sm7038578pfq.168.2019.09.12.02.26.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 Sep 2019 02:26:22 -0700 (PDT) Date: Thu, 12 Sep 2019 14:56:18 +0530 From: Bharath Vedartham To: Martin Galvan Subject: Re: Setting CPU affinity for current process on kernel module? Message-ID: <20190912092618.GA5911@bharath12345-Inspiron-5559> References: <20190911191657.GA11969@bharath12345-Inspiron-5559> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Cc: 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="iso-8859-1" Content-Transfer-Encoding: quoted-printable Errors-To: kernelnewbies-bounces@kernelnewbies.org On Wed, Sep 11, 2019 at 04:19:41PM -0300, Martin Galvan wrote: > El mi=E9., 11 sept. 2019 a las 16:17, Bharath Vedartham > () escribi=F3: > > So one thing that pops to my head is using cgroups. Create a cgroup, > > modify the cpu file in cpusets cgroup and add the required task to it. > > But I am not sure whether you can do all of this from a kernel module... > = > Thanks, but that's not feasible. This should all be done > programmatically from the module, and be as minimally invasive as > possible. Just to be clear, What do you mean by current process. Is it the process which is executing the kernel module? That would be a kernel thread I believe or do you want to be able to set the cpu affinity for any process given its PID? = And are you looking at setting CPU affinity of kernel threads or user threads. = Thank you Bharath _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies