Project

General

Profile

Bug #6534

Improve processor_bind(2) EINVAL description

Added by Ryan Zezeski over 4 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
manpage - manual pages
Start date:
2015-12-27
Due date:
% Done:

100%

Estimated time:
Difficulty:
Bite-size
Tags:
needs-triage
Gerrit CR:

Description

The processor_bind(2) manual states the following under the EINVAL section:

       EINVAL
                  The specified processor is not on-line, or the idtype
                  argument was not P_PID, P_LWPID, P_PROJID, P_TASKID, P_CTID,
                  or P_ZONEID.

                  The caller is in a non-global zone, the pools facility is
                  active, and the processor is not a member of the zone's
                  pool's processor set.

This second paragraph is incorrect. If the LWP is a member of a partition (processor set or resource pool) then the processor bound to must be a member of the partition. Otherwise, EINVAL is returned. This is verified both by experimentation and by the code.

https://github.com/illumos/illumos-gate/blob/master/usr/src/uts/common/os/cpu.c#L2602

# psrinfo -vp
The physical processor has 6 cores and 12 virtual processors (0-11)
  The core has 2 virtual processors (0-1)
  The core has 2 virtual processors (2-3)
  The core has 2 virtual processors (4-5)
  The core has 2 virtual processors (6-7)
  The core has 2 virtual processors (8-9)
  The core has 2 virtual processors (10-11)
    x86 (GenuineIntel 206D7 family 6 model 45 step 7 clock 3500 MHz)
      Intel(r) Core(tm) i7-3970X CPU @ 3.50GHz

# psrset -c 0 1
created processor set 1
processor 0: was not assigned, now 1
processor 1: was not assigned, now 1

# psrset -b 1 $$
process id 74611: was not bound, now 1

# psrset -q $$
process id 74611: 1

# pbind -b 2 $$
pbind: cannot bind pid 74611: Invalid argument

# truss -t processor_bind pbind -b 2 $$
processor_bind(P_PID, 74611, 2, 0xFFFFFD7FFFDFFB58) Err#22 EINVAL
pbind: cannot bind pid 74611: Invalid argument

History

#1

Updated by Electric Monk over 4 years ago

  • % Done changed from 0 to 100
  • Status changed from New to Closed

git commit 43b03420337dfd6b23d347fb1a237f0554fcde98

commit  43b03420337dfd6b23d347fb1a237f0554fcde98
Author: Ryan Zezeski <ryan@zinascii.com>
Date:   2015-12-28T21:59:03.000Z

    6534 Improve processor_bind(2) EINVAL description
    Reviewed by: Richard Lowe <richlowe@richlowe.net>
    Reviewed by: Garrett D'Amore <garrett@damore.org>
    Approved by: Dan McDonald <danmcd@omniti.com>

Also available in: Atom PDF