mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: "Bryan O'Sullivan" <bos@pathscale.com>
Cc: linux-kernel@vger.kernel.org, rdreier@cisco.com, greg@kroah.com,
	openib-general@openib.org
Subject: Re: [PATCH 10 of 18] ipath - support for userspace apps using core driver
Date: Wed, 22 Mar 2006 19:06:36 -0800	[thread overview]
Message-ID: <20060322190636.667d43c0.akpm@osdl.org> (raw)
In-Reply-To: <35c1d2f22ae1e2de483c.1143072303@eng-12.pathscale.com>

"Bryan O'Sullivan" <bos@pathscale.com> wrote:
>
>  +	/*
>  +	 * This code is present to allow a knowledgeable person to
>  +	 * specify the layout of processes to processors before opening
>  +	 * this driver, and then we'll assign the process to the "closest"
>  +	 * HT-400 to that processor (we assume reasonable connectivity,
>  +	 * for now).  This code assumes that if affinity has been set
>  +	 * before this point, that at most one cpu is set; for now this
>  +	 * is reasonable.  I check for both cpus_empty() and cpus_full(),
>  +	 * in case some kernel variant sets none of the bits when no
>  +	 * affinity is set.  2.6.11 and 12 kernels have all present
>  +	 * cpus set.  Some day we'll have to fix it up further to handle
>  +	 * a cpu subset.  This algorithm fails for two HT-400's connected
>  +	 * in tunnel fashion.  Eventually this needs real topology
>  +	 * information.  There may be some issues with dual core numbering
>  +	 * as well.  This needs more work prior to release.
>  +	 */
>  +	if (!cpus_empty(current->cpus_allowed) &&
>  +	    !cpus_full(current->cpus_allowed)) {
>  +		int ncpus = num_online_cpus(), curcpu = -1;
>  +		for (i = 0; i < ncpus; i++)
>  +			if (cpu_isset(i, current->cpus_allowed)) {
>  +				ipath_cdbg(PROC, "%s[%u] affinity set for "
>  +					   "cpu %d\n", current->comm,
>  +					   current->pid, i);
>  +				curcpu = i;
>  +			}
>  +		if (curcpu != -1) {
>  +			if (npresent) {
>  +				prefunit = curcpu / (ncpus / npresent);
>  +				ipath_dbg("%s[%u] %d chips, %d cpus, "
>  +					  "%d cpus/chip, select unit %d\n",
>  +					  current->comm, current->pid,
>  +					  npresent, ncpus, ncpus / npresent,
>  +					  prefunit);
>  +			}
>  +		}
>  +	}

CPU topology is available in sysfs - it shouild be possible to push policy
decisions like this up to userspace.  If the topology info is insufficient,
we can add to it.


  reply	other threads:[~2006-03-23  3:10 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-23  0:04 [PATCH 0 of 18] [RFC] ipath - almost-final round of patches for submission Bryan O'Sullivan
2006-03-23  0:04 ` [PATCH 1 of 18] ipath - core driver header files Bryan O'Sullivan
2006-03-23  0:04 ` [PATCH 2 of 18] ipath - core device driver Bryan O'Sullivan
2006-03-23  0:04 ` [PATCH 3 of 18] ipath - copy and send routines for sending an skb Bryan O'Sullivan
2006-03-23  0:04 ` [PATCH 4 of 18] ipath - support for HyperTransport devices Bryan O'Sullivan
2006-03-23  0:04 ` [PATCH 5 of 18] ipath - support for PCI Express devices Bryan O'Sullivan
2006-03-23  0:04 ` [PATCH 6 of 18] ipath - chip initialisation code Bryan O'Sullivan
2006-03-23  0:05 ` [PATCH 7 of 18] ipath - misc driver support code Bryan O'Sullivan
2006-03-23  0:05 ` [PATCH 8 of 18] ipath - sysfs and ipathfs support for core driver Bryan O'Sullivan
2006-03-23  5:49   ` Greg KH
2006-03-23  8:44     ` Bryan O'Sullivan
2006-03-23 20:06       ` Robert Walsh
2006-03-23 23:25       ` Greg KH
2006-03-23  6:30   ` Michael S. Tsirkin
2006-03-23  8:46     ` Bryan O'Sullivan
2006-03-23  9:40       ` Michael S. Tsirkin
2006-03-23  0:05 ` [PATCH 9 of 18] ipath - char devices for diagnostics and lightweight subnet management Bryan O'Sullivan
2006-03-23  6:41   ` Michael S. Tsirkin
2006-03-23  8:48     ` Bryan O'Sullivan
2006-03-23  9:37       ` Michael S. Tsirkin
2006-03-23  9:51         ` Bryan O'Sullivan
2006-03-23 10:13           ` Michael S. Tsirkin
2006-03-23 10:19             ` Bryan O'Sullivan
2006-03-23 19:18       ` Roland Dreier
2006-03-23 23:58         ` Bryan O'Sullivan
2006-03-24  1:27           ` Roland Dreier
2006-03-24  2:59             ` [openib-general] " Robert Walsh
2006-03-23  0:05 ` [PATCH 10 of 18] ipath - support for userspace apps using core driver Bryan O'Sullivan
2006-03-23  3:06   ` Andrew Morton [this message]
2006-03-23  8:37     ` Bryan O'Sullivan
2006-03-23  0:05 ` [PATCH 11 of 18] ipath - layering interfaces used by higher-level driver code Bryan O'Sullivan
2006-03-23  0:05 ` [PATCH 12 of 18] ipath - infiniband header files Bryan O'Sullivan
2006-03-23  0:05 ` [PATCH 13 of 18] ipath - infiniband UC and UD protocol support Bryan O'Sullivan
2006-03-23  0:05 ` [PATCH 14 of 18] ipath - infiniband RC " Bryan O'Sullivan
2006-03-23  0:05 ` [PATCH 15 of 18] ipath - misc infiniband code, part 1 Bryan O'Sullivan
2006-03-23  0:05 ` [PATCH 16 of 18] ipath - misc infiniband code, part 2 Bryan O'Sullivan
2006-03-23  0:05 ` [PATCH 17 of 18] ipath - infiniband verbs support Bryan O'Sullivan
2006-03-23  0:05 ` [PATCH 18 of 18] ipath - kbuild infrastructure Bryan O'Sullivan
2006-03-24  4:41 [PATCH 0 of 18] ipath driver - for inclusion in 2.6.17 Bryan O'Sullivan
2006-03-24  4:41 ` [PATCH 10 of 18] ipath - support for userspace apps using core driver Bryan O'Sullivan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060322190636.667d43c0.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=bos@pathscale.com \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=openib-general@openib.org \
    --cc=rdreier@cisco.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®