What are the factor on which PID_MAX depends in Linux - linux

I have checked two linux systems, both were of 64 bit but PID_MAX is different for both of them.
On one system(SYSTEM1)
cat /proc/sys/kernel/pid_max
32768
SYSTEM1 configuration:
dmesg | grep -i smp.*allow
getconf PAGESIZE
4096
cat /proc/cpuinfo | awk '/^processor/{print $3}' | tail -1
11
cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 45
model name : Intel(R) Xeon(R) CPU E5-2430 0 # 2.20GHz
stepping : 7
microcode : 1803
cpu MHz : 2201.000
cache size : 15360 KB
physical id : 0
siblings : 6
core id : 0
cpu cores : 6
apicid : 0
initial apicid : 0
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx lahf_lm ida arat epb xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid
bogomips : 4389.48
clflush size : 64
cache_alignment : 64
address sizes : 46 bits physical, 48 bits virtual
power management:
processor : 1
vendor_id : GenuineIntel
cpu family : 6
model : 45
model name : Intel(R) Xeon(R) CPU E5-2430 0 # 2.20GHz
stepping : 7
microcode : 1803
cpu MHz : 2201.000
cache size : 15360 KB
physical id : 0
siblings : 6
core id : 1
cpu cores : 6
apicid : 2
initial apicid : 2
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx lahf_lm ida arat epb xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid
bogomips : 4389.48
clflush size : 64
cache_alignment : 64
address sizes : 46 bits physical, 48 bits virtual
power management:
processor : 2
vendor_id : GenuineIntel
cpu family : 6
model : 45
model name : Intel(R) Xeon(R) CPU E5-2430 0 # 2.20GHz
stepping : 7
microcode : 1803
cpu MHz : 2201.000
cache size : 15360 KB
physical id : 0
siblings : 6
core id : 2
cpu cores : 6
apicid : 4
initial apicid : 4
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx lahf_lm ida arat epb xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid
bogomips : 4389.48
clflush size : 64
cache_alignment : 64
address sizes : 46 bits physical, 48 bits virtual
power management:
processor : 3
vendor_id : GenuineIntel
cpu family : 6
model : 45
model name : Intel(R) Xeon(R) CPU E5-2430 0 # 2.20GHz
stepping : 7
microcode : 1803
cpu MHz : 1300.000
cache size : 15360 KB
physical id : 0
siblings : 6
core id : 3
cpu cores : 6
apicid : 6
initial apicid : 6
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx lahf_lm ida arat epb xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid
bogomips : 4389.48
clflush size : 64
cache_alignment : 64
address sizes : 46 bits physical, 48 bits virtual
power management:
processor : 4
vendor_id : GenuineIntel
cpu family : 6
model : 45
model name : Intel(R) Xeon(R) CPU E5-2430 0 # 2.20GHz
stepping : 7
microcode : 1803
cpu MHz : 2201.000
cache size : 15360 KB
physical id : 0
siblings : 6
core id : 4
cpu cores : 6
apicid : 8
initial apicid : 8
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx lahf_lm ida arat epb xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid
bogomips : 4389.48
clflush size : 64
cache_alignment : 64
address sizes : 46 bits physical, 48 bits virtual
power management:
processor : 5
vendor_id : GenuineIntel
cpu family : 6
model : 45
model name : Intel(R) Xeon(R) CPU E5-2430 0 # 2.20GHz
stepping : 7
microcode : 1803
cpu MHz : 1200.000
cache size : 15360 KB
physical id : 0
siblings : 6
core id : 5
cpu cores : 6
apicid : 10
initial apicid : 10
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx lahf_lm ida arat epb xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid
bogomips : 4389.48
clflush size : 64
cache_alignment : 64
address sizes : 46 bits physical, 48 bits virtual
power management:
processor : 6
vendor_id : GenuineIntel
cpu family : 6
model : 45
model name : Intel(R) Xeon(R) CPU E5-2430 0 # 2.20GHz
stepping : 7
microcode : 1803
cpu MHz : 2201.000
cache size : 15360 KB
physical id : 1
siblings : 6
core id : 0
cpu cores : 6
apicid : 32
initial apicid : 32
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx lahf_lm ida arat epb xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid
bogomips : 4392.34
clflush size : 64
cache_alignment : 64
address sizes : 46 bits physical, 48 bits virtual
power management:
processor : 7
vendor_id : GenuineIntel
cpu family : 6
model : 45
model name : Intel(R) Xeon(R) CPU E5-2430 0 # 2.20GHz
stepping : 7
microcode : 1803
cpu MHz : 2201.000
cache size : 15360 KB
physical id : 1
siblings : 6
core id : 1
cpu cores : 6
apicid : 34
initial apicid : 34
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx lahf_lm ida arat epb xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid
bogomips : 4392.34
clflush size : 64
cache_alignment : 64
address sizes : 46 bits physical, 48 bits virtual
power management:
processor : 8
vendor_id : GenuineIntel
cpu family : 6
model : 45
model name : Intel(R) Xeon(R) CPU E5-2430 0 # 2.20GHz
stepping : 7
microcode : 1803
cpu MHz : 2201.000
cache size : 15360 KB
physical id : 1
siblings : 6
core id : 2
cpu cores : 6
apicid : 36
initial apicid : 36
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx lahf_lm ida arat epb xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid
bogomips : 4392.34
clflush size : 64
cache_alignment : 64
address sizes : 46 bits physical, 48 bits virtual
power management:
processor : 9
vendor_id : GenuineIntel
cpu family : 6
model : 45
model name : Intel(R) Xeon(R) CPU E5-2430 0 # 2.20GHz
stepping : 7
microcode : 1803
cpu MHz : 2201.000
cache size : 15360 KB
physical id : 1
siblings : 6
core id : 3
cpu cores : 6
apicid : 38
initial apicid : 38
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx lahf_lm ida arat epb xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid
bogomips : 4392.34
clflush size : 64
cache_alignment : 64
address sizes : 46 bits physical, 48 bits virtual
power management:
processor : 10
vendor_id : GenuineIntel
cpu family : 6
model : 45
model name : Intel(R) Xeon(R) CPU E5-2430 0 # 2.20GHz
stepping : 7
microcode : 1803
cpu MHz : 1200.000
cache size : 15360 KB
physical id : 1
siblings : 6
core id : 4
cpu cores : 6
apicid : 40
initial apicid : 40
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx lahf_lm ida arat epb xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid
bogomips : 4392.34
clflush size : 64
cache_alignment : 64
address sizes : 46 bits physical, 48 bits virtual
power management:
processor : 11
vendor_id : GenuineIntel
cpu family : 6
model : 45
model name : Intel(R) Xeon(R) CPU E5-2430 0 # 2.20GHz
stepping : 7
microcode : 1803
cpu MHz : 1200.000
cache size : 15360 KB
physical id : 1
siblings : 6
core id : 5
cpu cores : 6
apicid : 42
initial apicid : 42
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx lahf_lm ida arat epb xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid
bogomips : 4392.34
clflush size : 64
cache_alignment : 64
address sizes : 46 bits physical, 48 bits virtual
power management:
Whereas on other(SYSTEM2), it was
cat /proc/sys/kernel/pid_max
65536
SYSTEM2 configuration:
dmesg | grep -i smp.*allow
SMP: Allowing 64 CPUs, 61 hotplug CPUs
getconf PAGESIZE
4096
cat /proc/cpuinfo | awk '/^processor/{print $3}' | tail -1
2
cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 23
model name : Intel(R) Xeon(R) CPU X5450 # 3.00GHz
stepping : 6
microcode : 4294967295
cpu MHz : 2992.467
cache size : 6144 KB
physical id : 0
siblings : 3
core id : 0
cpu cores : 3
apicid : 0
initial apicid : 0
fpu : yes
fpu_exception : yes
cpuid level : 10
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc rep_good unfair_spinlock pni ssse3 cx16 sse4_1 hypervisor lahf_lm
bogomips : 5984.93
clflush size : 64
cache_alignment : 64
address sizes : 38 bits physical, 48 bits virtual
power management:
processor : 1
vendor_id : GenuineIntel
cpu family : 6
model : 23
model name : Intel(R) Xeon(R) CPU X5450 # 3.00GHz
stepping : 6
microcode : 4294967295
cpu MHz : 2992.467
cache size : 6144 KB
physical id : 0
siblings : 3
core id : 1
cpu cores : 3
apicid : 1
initial apicid : 1
fpu : yes
fpu_exception : yes
cpuid level : 10
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc rep_good unfair_spinlock pni ssse3 cx16 sse4_1 hypervisor lahf_lm
bogomips : 5984.93
clflush size : 64
cache_alignment : 64
address sizes : 38 bits physical, 48 bits virtual
power management:
processor : 2
vendor_id : GenuineIntel
cpu family : 6
model : 23
model name : Intel(R) Xeon(R) CPU X5450 # 3.00GHz
stepping : 6
microcode : 4294967295
cpu MHz : 2992.467
cache size : 6144 KB
physical id : 0
siblings : 3
core id : 2
cpu cores : 3
apicid : 2
initial apicid : 2
fpu : yes
fpu_exception : yes
cpuid level : 10
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc rep_good unfair_spinlock pni ssse3 cx16 sse4_1 hypervisor lahf_lm
bogomips : 5984.93
clflush size : 64
cache_alignment : 64
address sizes : 38 bits physical, 48 bits virtual
power management:
From man pages.
proc/sys/kernel/pid_max This file (new in Linux 2.5) specifies the
value at which PIDs wrap around (i.e., the value in this file is one
greater than the maximum PID). The default value for this file,
32768, results in the same range of PIDs as on earlier kernels. On
32-bit platfroms, 32768 is the maximum value for pid_max. On 64-bit
systems, pid_max can be set to any value up to 2^22 (PID_MAX_LIMIT,
approximately 4 million).
Please note, both of these system were having same linux kernel but SYSTEM2 was running on hyper-V.
Now, my question is what are factors which are responsible for changing pid_max?
Thank you in advance.

pid_max is set based on the number of possible CPUs, which you can see in the kernel source in pid.c line 595
pid_max = min(pid_max_max, max_t(int, pid_max,
PIDS_PER_CPU_DEFAULT * num_possible_cpus()));
num_possible_cpus() returns the maximum number of CPUs that could be in the system (including hotplug CPUs that could be plugged in after boot).
As you can see the expression includes a minimum and maximum.
The minimum is the initial value of pid_max, which is derived from the macro PID_MAX_DEFAULT, which will be either 0x1000 or 0x8000 depending on the compile-time configuration setting CONFIG_BASE_SMALL.
The maximum is pid_max_max, which in turn is derived from some kernel compile-time configuration settings, specifically CONFIG_BASE_SMALL and PAGE_SIZE. This is defined in the macro PID_MAX_LIMIT see threads.h line 33:
#define PID_MAX_LIMIT (CONFIG_BASE_SMALL ? PAGE_SIZE * 8 : \
(sizeof(long) > 4 ? 4 * 1024 * 1024 : PID_MAX_DEFAULT))
So putting all this together in an example: on my system here (Centos 6):
PAGESIZE is 4096
CONFIG_BASE_SMALL is 0
PID_MAX_DEFAULT would therefore be 0x8000 (32768)
PID_MAX_LIMIT would be 4 * 1024 * 1024 = 4194304
max_pid would therefore be in the range 4194304 >= max_pid >= 32768
From userland, you can inspect the number of possible CPUs in file /sys/devices/system/cpu/possible. The format of the data in this file is a little strange - it will be a string of the form 0-max, for example 0-15 would mean a maximum of 16 CPUs (noting that the number is zero counting).
For more information about this file and the other files in this directory, see cputopology.txt.
For more information about CPU hotplugging in general, see cpu-hotplug.txt
If you want to check the kernel compile time configuration settings, check this answer for some tips.
NB. Kernel line numbers given are valid for Kernel 4.7.10.

Related

Cannot set rustflags target-cpu=native in Cargo.toml (SIMD-JSON)

I'm trying to compile the Rust simd-json package. It complains that the box is not SIMD-compatible:
|
221 | fn please_compile_with_a_simd_compatible_cpu_setting_read_the_simdjsonrs_readme() -> ! {}
| ---------------------------------------------------------------------------- ^ expected `!`, found `()`
| |
| implicitly returns `()` as its body has no tail or `return` expression
However, the box is x86 as required:
$ uname -a
Linux ip-172-31-68-220 5.15.0-1011-aws #14-Ubuntu SMP Wed Jun 1 20:54:22 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
And Cargo.toml contains the required compiler flags:
[build]
rustflags = ["-C", "target-cpu=native"]
[target.wasm32-unknown-unknown]
rustflags = ["-C", "target-feature=+simd128"]
[target.wasm32-wasi]
rustflags = ["-C", "target-feature=+simd128"]
Why is simd-json unhappy?
Full /proc/cpuinfo output below.
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 85
model name : Intel(R) Xeon(R) Platinum 8259CL CPU # 2.50GHz
stepping : 7
microcode : 0x500320a
cpu MHz : 2500.006
cache size : 36608 KB
physical id : 0
siblings : 4
core id : 0
cpu cores : 2
apicid : 0
initial apicid : 0
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl xtopology nonstop_tsc cpuid tsc_known_freq pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single pti fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid mpx avx512f avx512dq rdseed adx smap clflushopt clwb avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves ida arat pku ospke
bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit
bogomips : 5000.01
clflush size : 64
cache_alignment : 64
address sizes : 46 bits physical, 48 bits virtual
power management:
processor : 1
vendor_id : GenuineIntel
cpu family : 6
model : 85
model name : Intel(R) Xeon(R) Platinum 8259CL CPU # 2.50GHz
stepping : 7
microcode : 0x500320a
cpu MHz : 2500.006
cache size : 36608 KB
physical id : 0
siblings : 4
core id : 1
cpu cores : 2
apicid : 2
initial apicid : 2
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl xtopology nonstop_tsc cpuid tsc_known_freq pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single pti fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid mpx avx512f avx512dq rdseed adx smap clflushopt clwb avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves ida arat pku ospke
bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit
bogomips : 5000.01
clflush size : 64
cache_alignment : 64
address sizes : 46 bits physical, 48 bits virtual
power management:
processor : 2
vendor_id : GenuineIntel
cpu family : 6
model : 85
model name : Intel(R) Xeon(R) Platinum 8259CL CPU # 2.50GHz
stepping : 7
microcode : 0x500320a
cpu MHz : 2500.006
cache size : 36608 KB
physical id : 0
siblings : 4
core id : 0
cpu cores : 2
apicid : 1
initial apicid : 1
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl xtopology nonstop_tsc cpuid tsc_known_freq pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single pti fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid mpx avx512f avx512dq rdseed adx smap clflushopt clwb avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves ida arat pku ospke
bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit
bogomips : 5000.01
clflush size : 64
cache_alignment : 64
address sizes : 46 bits physical, 48 bits virtual
power management:
processor : 3
vendor_id : GenuineIntel
cpu family : 6
model : 85
model name : Intel(R) Xeon(R) Platinum 8259CL CPU # 2.50GHz
stepping : 7
microcode : 0x500320a
cpu MHz : 2500.006
cache size : 36608 KB
physical id : 0
siblings : 4
core id : 1
cpu cores : 2
apicid : 3
initial apicid : 3
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl xtopology nonstop_tsc cpuid tsc_known_freq pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single pti fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid mpx avx512f avx512dq rdseed adx smap clflushopt clwb avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves ida arat pku ospke
bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit
bogomips : 5000.01
clflush size : 64
cache_alignment : 64
address sizes : 46 bits physical, 48 bits virtual
power management:
The implementation of that function is defined as follows:
#[cfg(all(
not(feature = "allow-non-simd"),
not(any(
target_feature = "sse4.2",
target_feature = "avx2",
target_feature = "neon",
target_feature = "simd128"
))
))]
fn please_compile_with_a_simd_compatible_cpu_setting_read_the_simdjsonrs_readme() -> ! {}
This means that the Rust compiler thinks your CPU doesn't have sse4.2 or avx2 or neon or simd128.
Your /proc/cpuinfo seems to have avx2, so is a giveaway of something strange going on.
The problem is that rustflags is not valid in your Cargo.toml, it needs to be added to your .cargo/config.toml file instead. The configuration file is meant primarily for global settings for cargo and rustc, but you can make one local to your repository in your project root. (e.g myproject/.cargo/config.toml)
If you look at the example of simd-json, you can see that is what they do.

CentOS 6.5 kernel panic when running a perf process

I'm working on making continuous profiling on running process, so I set a crontab on server. It periodically runs a python script which exec perf subprocess collecting perf data from a daemon process started by supervise
The perf command I use is like this:
perf record -p {target process} -e cycles:u -a -q -g -- sleep {some time}
Everything goes on well except for the running process terminates.We sometimes need to update the target process executable file and restart the process with svc -t. The operation may lead to a kernel panic and we have to reboot the machine
My server's distribution version is CentOS release 6.5 (Final) and linux release version is 2.6.32-431.23.3.el6.x86_64
The core dump log and backtrace is shown as below
general protection fault: 0000 [#1] SMP
last sysfs file: /sys/devices/system/cpu/online
CPU 1
Modules linked in: AliSecGuard(U) AliSecProcFilter64(U) tcp_diag inet_diag joydev microcode virtio_net virtio_balloon shpchp i2c_piix4 i2c_core ext4 jbd2 mbcache virtio_blk virtio_console virtio_pci virtio_ring virtio pata_acpi ata_generic ata_piix dm_mirror dm_region_hash dm_log dm_mod [last unloaded: scsi_wait_scan]
Pid: 22748, comm: server Not tainted 2.6.32-573.22.1.el6.x86_64 #1 Alibaba Cloud Alibaba Cloud ECS
RIP: 0010:[<ffffffff8111db57>] [<ffffffff8111db57>] ring_buffer_put+0x77/0xf0
RSP: 0018:ffff8801afadbda8 EFLAGS: 00010006
RAX: ffff880416d81e60 RBX: ffff8803d335f000 RCX: 63496d6165727473
RDX: 676e697274736f5f RSI: 0000000000000003 RDI: ffff880416d81c00
RBP: ffff8801afadbdd8 R08: 0000000000000001 R09: 00000000ffffffff
R10: 00000000ffffffff R11: dead000000200200 R12: ffff8803d335f058
R13: 676e697274736cff R14: ffff8803d335f060 R15: 0000000000000202
FS: 0000000000000000(0000) GS:ffff880028240000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
CR2: 0000000004264d70 CR3: 0000000001a8d000 CR4: 00000000001406e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Process gameserver (pid: 22748, threadinfo ffff8801afad8000, task ffff8803a19cd520)
Stack:
ffff8801afadbdf8 ffff8803a1b03800 ffff8804138bf78c ffff8804138bf790
<d> ffff88001a9fb800 ffff8804182a1c80 ffff8801afadbdf8 ffffffff8111e377
<d> ffff8804138bf790 ffff8803a1b03800 ffff8801afadbe28 ffffffff8111fe72
Call Trace:
[<ffffffff8111e377>] free_event+0x37/0x170
[<ffffffff8111fe72>] perf_event_release_kernel+0x72/0xb0
[<ffffffff8111ff49>] put_event+0x99/0xd0
[<ffffffff81123a65>] __perf_event_exit_task+0xf5/0x150
[<ffffffff81123c91>] perf_event_exit_task+0x1d1/0x210
[<ffffffff8107ca24>] do_exit+0x1e4/0x870
[<ffffffff8107d1b7>] sys_exit+0x17/0x20
[<ffffffff8100b0d2>] system_call_fastpath+0x16/0x1b
Code: ff ff 4c 39 f0 48 8b 97 60 02 00 00 74 5f 4c 8d aa a0 fd ff ff eb 08 0f 1f 44 00 00 49 89 cd 48 8b 8f 68 02 00 00 be 03 00 00 00 <48> 89 4a 08 48 89 11 31 c9 48 89 87 60 02 00 00 48 89 87 68 02
RIP [<ffffffff8111db57>] ring_buffer_put+0x77/0xf0
RSP <ffff8801afadbda8>
PID: 22748 TASK: ffff8803a19cd520 CPU: 1 COMMAND: "server"
#0 [ffff8801afadbb30] machine_kexec at ffffffff8103d1fb
#1 [ffff8801afadbb90] crash_kexec at ffffffff810cc882
#2 [ffff8801afadbc60] oops_end at ffffffff8153da20
#3 [ffff8801afadbc90] die at ffffffff81010fab
#4 [ffff8801afadbcc0] do_general_protection at ffffffff8153d512
#5 [ffff8801afadbcf0] general_protection at ffffffff8153cce5
[exception RIP: ring_buffer_put+119]
RIP: ffffffff8111db57 RSP: ffff8801afadbda8 RFLAGS: 00010006
RAX: ffff880416d81e60 RBX: ffff8803d335f000 RCX: 63496d6165727473
RDX: 676e697274736f5f RSI: 0000000000000003 RDI: ffff880416d81c00
RBP: ffff8801afadbdd8 R8: 0000000000000001 R9: 00000000ffffffff
R10: 00000000ffffffff R11: dead000000200200 R12: ffff8803d335f058
R13: 676e697274736cff R14: ffff8803d335f060 R15: 0000000000000202
ORIG_RAX: ffffffffffffffff CS: 0010 SS: 0018
#6 [ffff8801afadbda0] ring_buffer_put at ffffffff8111db20
#7 [ffff8801afadbde0] free_event at ffffffff8111e377
#8 [ffff8801afadbe00] perf_event_release_kernel at ffffffff8111fe72
#9 [ffff8801afadbe30] put_event at ffffffff8111ff49
#10 [ffff8801afadbe60] __perf_event_exit_task at ffffffff81123a65
#11 [ffff8801afadbe90] perf_event_exit_task at ffffffff81123c91
#12 [ffff8801afadbef0] do_exit at ffffffff8107ca24
#13 [ffff8801afadbf70] sys_exit at ffffffff8107d1b7
#14 [ffff8801afadbf80] system_call_fastpath at ffffffff8100b0d2
RIP: 0000003026207c41 RSP: 00007fe4d1e56e50 RFLAGS: 00000246
RAX: 000000000000003c RBX: ffffffff8100b0d2 RCX: 0000000000000001
RDX: 0000000000000004 RSI: 00000000009fb000 RDI: 0000000000000000
RBP: 0000000000000000 R8: 000000000598f280 R9: 00000000000058dc
R10: 00007fe4d259f3ac R11: 0000000000000246 R12: ffffffff8107d1b7
R13: ffff8801afadbf78 R14: 0000000000000003 R15: 0000000000000000
ORIG_RAX: 000000000000003c CS: 0033 SS: 002b
The attached process's thread exit causes the kernel panic and the panic cannot be reproduced every time, so I suppose this may be kind of a race condition bug in kernel?
BTW, the perf process doesn't exit after attached process terminates on my server (because of old version I guess), so perf will continue to work until I interrupt it. I'm not sure whether this can affect the target process exit
Sounds like a bug in that old kernel version; user-space perf shouldn't be able to panic the kernel. Either Linux 2.6.32 was buggy, or maybe CentOS's patch backporting (or the patches themselves) introduced a bug that only happens when perf is active.
I don't think it's plausible to fix this on your own, unless you want to really dig into kernel debugging, so your options are
update your kernel (from CentOS if available, otherwise you'll have to find another source for kernels, e.g. mainline).
update your distro to one that uses newer kernels. (And newer everything else).
stop using perf.
Maybe not possible: find a different set of perf options that doesn't trigger this crash. (Be careful testing, whatever bug is causing this could possibly manifest in other ways like memory corruption, possibly leading to corrupting file data before it's written out to disk if you get unlucky with writing through a wild pointer. The bug might not have that possible failure mode, but you can't be certain until you've found it.)

Is device.is_kernel_driver_active() not working in libusb-1.0.22.7z?

Why am I getting the "Operation not supported or unimplemented on this platform" message?
I am running windows 10 64 bit and have installed python 3.7 64 bit, pyusb 1.0.2 and libusb-1.0.22.7z. For libusb-1.0.22.7z I unzipped it and copied the MS64\dll\libusb-1.0.dll to C:\Users..\AppData\Local\Programs\Python\Python37\ folder.
import usb
device = usb.core.find(idVendor = 0x0461, idProduct = 0x4d65) #mouse
if device is None:
raise ValueError('No device')
print(device)
interface = 0
if device.is_kernel_driver_active(interface):
print("kernel driver active")
The output is:
DEVICE ID 0461:4d65 on Bus 008 Address 002 =================
bLength : 0x12 (18 bytes)
bDescriptorType : 0x1 Device
bcdUSB : 0x200 USB 2.0
bDeviceClass : 0x0 Specified at interface
bDeviceSubClass : 0x0
bDeviceProtocol : 0x0
bMaxPacketSize0 : 0x8 (8 bytes)
idVendor : 0x0461
idProduct : 0x4d65
bcdDevice : 0x200 Device 2.0
iManufacturer : 0x0
iProduct : 0x2 USB Optical Mouse
iSerialNumber : 0x0
bNumConfigurations : 0x1
CONFIGURATION 1: 98 mA ===================================
bLength : 0x9 (9 bytes)
bDescriptorType : 0x2 Configuration
wTotalLength : 0x22 (34 bytes)
bNumInterfaces : 0x1
bConfigurationValue : 0x1
iConfiguration : 0x0
bmAttributes : 0xa0 Bus Powered, Remote Wakeup
bMaxPower : 0x31 (98 mA)
INTERFACE 0: Human Interface Device ====================
bLength : 0x9 (9 bytes)
bDescriptorType : 0x4 Interface
bInterfaceNumber : 0x0
bAlternateSetting : 0x0
bNumEndpoints : 0x1
bInterfaceClass : 0x3 Human Interface Device
bInterfaceSubClass : 0x1
bInterfaceProtocol : 0x2
iInterface : 0x0
ENDPOINT 0x81: Interrupt IN ==========================
bLength : 0x7 (7 bytes)
bDescriptorType : 0x5 Endpoint
bEndpointAddress : 0x81 IN
bmAttributes : 0x3 Interrupt
wMaxPacketSize : 0x6 (6 bytes)
bInterval : 0xa
Traceback (most recent call last):
File "c:\Users\me\Documents\Python\usb\usb test.py", line 16, in <module>
if device.is_kernel_driver_active(interface):
File "C:\Users\me\AppData\Local\Programs\Python\Python37\lib\site-packages\usb\core.py", line 1064, in is_kernel_driver_active
interface)
File "C:\Users\me\AppData\Local\Programs\Python\Python37\lib\site-packages\usb\backend\libusb1.py", line 898, in is_kernel_driver_active
intf)))
File "C:\Users\me\AppData\Local\Programs\Python\Python37\lib\site-packages\usb\backend\libusb1.py", line 593, in _check
raise NotImplementedError(_strerror(ret))
NotImplementedError: Operation not supported or unimplemented on this platform

kernel crash bug caused by ixgbevf kernel module of centos-3.10.0-229.20.1.el7?

I found a bug about ixgbevf kernel module on centos-3.10.0-229.20.1.el7. And I think this bug is fixed in 3.10.0-514.10.2.el7.
So could someone tell me which patch fix this bug, or how to find this patch?
BUG:
[308026.586026] ixgbevf 0000:01:10.0: NIC Link is Down
[308026.586037] ixgbevf 0000:01:10.1: NIC Link is Down
[308026.683724] bonding: bond1: link status definitely down for interface enp1s16, disabling it
[308026.683728] bonding: bond1: now running without any active interface !
[308026.683729] bonding: bond1: link status definitely down for interface enp1s16f1, disabling it
[308028.266060] bonding: bond1: Removing slave enp1s16.
[308028.266135] bonding: bond1: Warning: the permanent HWaddr of enp1s16 - 4e:cd:a6:59:26:2c - is still in use by bond1. Set the HWaddr of enp1s16 to a different address to avoid conflicts.
[308028.266139] bonding: bond1: releasing active interface enp1s16
[308028.359872] BUG: unable to handle kernel NULL pointer dereference at 0000000000000008
[308028.361319] IP: [<ffffffffa0494970>] ixgbevf_alloc_rx_buffers+0x60/0x160 [ixgbevf]
[308028.362049] PGD 0
[308028.362777] Oops: 0000 [#1] SMP
[308028.363481] Modules linked in: ixgbevf(OF) igb_uio(OF) iptable_mangle iptable_nat nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 nf_nat nf_conntrack iptable_filter nbd(OF) vhost_net macvtap macvlan udp_diag unix_diag af_packet_diag netlink_diag tun tcp_diag inet_diag uio bonding ext4 mbcache jbd2 intel_powerclamp coretemp kvm_intel kvm crct10dif_pclmul crc32_pclmul crc32c_intel ghash_clmulni_intel mgag200 aesni_intel iTCO_wdt lrw dcdbas gf128mul syscopyarea sysfillrect iTCO_vendor_support glue_helper sysimgblt ablk_helper ttm cryptd ipmi_devintf igb ixgbe drm_kms_helper drm i2c_algo_bit ptp i2c_core ipmi_si pps_core sg mdio ipmi_msghandler dca sb_edac mei_me mei shpchp lpc_ich pcspkr mfd_core edac_core wmi acpi_power_meter acpi_pad ip_tables xfs libcrc32c sd_mod crc_t10dif crct10dif_common ahci libahci
[308028.368487] libata megaraid_sas [last unloaded: ixgbevf]
[308028.369345] CPU: 0 PID: 21971 Comm: kworker/0:1 Tainted: GF W O-------------- 3.10.0-229.el7.x86_64 #1
[308028.370226] Hardware name: Dell Inc. PowerEdge R720/068CDY, BIOS 2.5.2 01/28/2015
[308028.371132] Workqueue: events ixgbevf_service_task [ixgbevf]
[308028.372038] task: ffff88022b0dad80 ti: ffff88010905c000 task.ti: ffff88010905c000
[308028.372965] RIP: 0010:[<ffffffffa0494970>] [<ffffffffa0494970>] ixgbevf_alloc_rx_buffers+0x60/0x160 [ixgbevf]
[308028.373949] RSP: 0018:ffff88010905fd10 EFLAGS: 00010287
[308028.374900] RAX: 0000000000000200 RBX: 0000000000000000 RCX: 0000000000000000
[308028.375895] RDX: 0000000000000000 RSI: 00000000000001ff RDI: ffff8800b82061c0
[308028.376841] RBP: ffff88010905fd48 R08: 0000000000000282 R09: 0000000000000001
[308028.377780] R10: 0000000000000004 R11: 0000000000000005 R12: 0000000000000000
[308028.378702] R13: 00000000fffffe00 R14: 00000000000001ff R15: ffff8800b82061c0
[308028.379628] FS: 0000000000000000(0000) GS:ffff882f7fa00000(0000) knlGS:0000000000000000
[308028.380540] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[308028.381471] CR2: 0000000000000008 CR3: 000000000190a000 CR4: 00000000001427f0
[308028.382376] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[308028.383291] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
[308028.384180] Stack:
[308028.385051] ffff8832d1b58bc0 ffff88010905fd28 ffff8832d1b588c0 0000000000000009
[308028.385933] ffff8832d1b58bc0 ffff8800b82061c0 0000000000001028 ffff88010905fdb8
[308028.386804] ffffffffa0496ba3 ffff8832d1b58e58 000000022b1e2000 00000000819e2108
[308028.387693] Call Trace:
[308028.388520] [<ffffffffa0496ba3>] ixgbevf_configure+0x5d3/0x7d0 [ixgbevf]
[308028.389363] [<ffffffffa0498135>] ixgbevf_reinit_locked+0x65/0x90 [ixgbevf]
[308028.390213] [<ffffffffa049a3e4>] ixgbevf_service_task+0x324/0x420 [ixgbevf]
[308028.391043] [<ffffffff8108f1db>] process_one_work+0x17b/0x470
[308028.391888] [<ffffffff8108ffbb>] worker_thread+0x11b/0x400
[308028.392728] [<ffffffff8108fea0>] ? rescuer_thread+0x400/0x400
[308028.393576] [<ffffffff8109739f>] kthread+0xcf/0xe0
[308028.394434] [<ffffffff810972d0>] ? kthread_create_on_node+0x140/0x140
[308028.395339] [<ffffffff8161497c>] ret_from_fork+0x7c/0xb0
[308028.396205] [<ffffffff810972d0>] ? kthread_create_on_node+0x140/0x140
[308028.397068] Code: c5 41 89 f6 49 89 c4 48 8d 14 40 48 8b 47 28 49 c1 e4 04 4c 03 67 20 48 8d 1c d0 0f b7 47 4c 41 29 c5 66 0f 1f 84 00 00 00 00 00 <48> 83 7b 08 00 74 73 8b 53 10 48 8b 03 48 01 d0 49 83 c4 10 48
[308028.398959] RIP [<ffffffffa0494970>] ixgbevf_alloc_rx_buffers+0x60/0x160 [ixgbevf]
[308028.399910] RSP <ffff88010905fd10>
[308028.400846] CR2: 0000000000000008

Running Intel 7260 in AP mode under Ubuntu 14.04

I would like to use the built-in WiFi on a Gigabyte mini-ITX system I just bought as an access point. And for some reason I am going in circles.
lspci | grep -i wireless reveals:
04:00.0 Network controller: Intel Corporation Wireless 7260 (rev 73)
lsmod | grep 80211 gives:
mac80211 630669 1 iwlmvm
cfg80211 484040 3 iwlwifi,mac80211,iwlmvm
I installed hostapd. Here is the (more than) minimal hostapd.conf I created:
interface=wlan0
driver=nl80211
logger_syslog=-1
logger_syslog_level=2
logger_stdout=-1
logger_stdout_level=2
ctrl_interface=/var/run/hostapd
ctrl_interface_group=0
ssid=test
hw_mode=g
channel=1
beacon_int=100
dtim_period=2
max_num_sta=255
rts_threshold=2347
fragm_threshold=2346
macaddr_acl=0
auth_algs=3
ignore_broadcast_ssid=0
wmm_enabled=1
wmm_ac_bk_cwmin=4
wmm_ac_bk_cwmax=10
wmm_ac_bk_aifs=7
wmm_ac_bk_txop_limit=0
wmm_ac_bk_acm=0
wmm_ac_be_aifs=3
wmm_ac_be_cwmin=4
wmm_ac_be_cwmax=10
wmm_ac_be_txop_limit=0
wmm_ac_be_acm=0
wmm_ac_vi_aifs=2
wmm_ac_vi_cwmin=3
wmm_ac_vi_cwmax=4
wmm_ac_vi_txop_limit=94
wmm_ac_vi_acm=0
wmm_ac_vo_aifs=2
wmm_ac_vo_cwmin=2
wmm_ac_vo_cwmax=3
wmm_ac_vo_txop_limit=47
own_ip_addr=127.0.0.1
When I try to run hostapd, I get this:
$ sudo hostapd ./hostapd.conf
Configuration file: ./hostapd.conf
nl80211: Could not configure driver mode
nl80211 driver initialization failed.
hostapd_free_hapd_data: Interface wlan0 wasn't started
So, I read there was a problem with Ubuntu 14.04 and how to get around it.
https://bugs.launchpad.net/ubuntu/+source/wpa/+bug/1289047
Interestingly it appears that now the driver (version 2.1) does something with error, and before it ignored it.
a solution (in desktop cases) is to do following to release resource.. then hostapd has no error....
sudo nmcli nm wifi off
sudo rfkill unblock wlan
this info has been gleaned from https://bbs.archlinux.org/viewtopic.php?pid=1221799
nmcli is part of network-manager, which needed to be installed.
Next,
/etc/hostapd$ sudo nmcli nm wifi off
** (process:5724): WARNING **: Could not initialize NMClient /org/freedesktop/NetworkManager: The name org.freedesktop.NetworkManager was not provided by any .service files
So I ran these commands, which are supposedly a workaround.
/etc/hostapd$ sudo service network-manager start
network-manager start/running, process 5763
/etc/hostapd$ sudo nmcli nm wifi off
/etc/hostapd$ sudo rfkill unblock wlan
But still the same problem with trying to run hostapd.
https://askubuntu.com/questions/472794/hostapd-error-nl80211-could-not-configure-driver-mode recommends this:
sudo ifconfig wlan0 10.15.0.1/24 up
sleep 1
sudo service isc-dhcp-server restart
sudo service hostapd restart
isc-dhcp-server is not yet installed. Everything else ran without showing any error.
Still having the problem though!
ifconfig wlan0 shows:
wlan0 Link encap:Ethernet HWaddr 80:19:34:32:20:a3
inet addr:10.15.0.1 Bcast:10.15.0.255 Mask:255.255.255.0
inet6 addr: fd04:bd3:80e8:1:91e9:7f2e:f005:5af9/64 Scope:Global
inet6 addr: fe80::8219:34ff:fe32:20a3/64 Scope:Link
inet6 addr: fd04:bd3:80e8:1:8219:34ff:fe32:20a3/64 Scope:Global
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:43138 errors:0 dropped:0 overruns:0 frame:0
TX packets:638 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:6824297 (6.8 MB) TX bytes:121399 (121.3 KB)
iw list shows:
Wiphy phy0
Band 1:
Capabilities: 0x1062
HT20/HT40
Static SM Power Save
RX HT20 SGI
RX HT40 SGI
No RX STBC
Max AMSDU length: 3839 bytes
DSSS/CCK HT40
Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
Minimum RX AMPDU time spacing: 4 usec (0x05)
HT TX/RX MCS rate indexes supported: 0-15, 32
Frequencies:
* 2412 MHz [1] (22.0 dBm)
* 2417 MHz [2] (22.0 dBm)
* 2422 MHz [3] (22.0 dBm)
* 2427 MHz [4] (22.0 dBm)
* 2432 MHz [5] (22.0 dBm)
* 2437 MHz [6] (22.0 dBm)
* 2442 MHz [7] (22.0 dBm)
* 2447 MHz [8] (22.0 dBm)
* 2452 MHz [9] (22.0 dBm)
* 2457 MHz [10] (22.0 dBm)
* 2462 MHz [11] (22.0 dBm)
* 2467 MHz [12] (22.0 dBm) (passive scanning, no IBSS)
* 2472 MHz [13] (22.0 dBm) (passive scanning, no IBSS)
Bitrates (non-HT):
* 1.0 Mbps
* 2.0 Mbps (short preamble supported)
* 5.5 Mbps (short preamble supported)
* 11.0 Mbps (short preamble supported)
* 6.0 Mbps
* 9.0 Mbps
* 12.0 Mbps
* 18.0 Mbps
* 24.0 Mbps
* 36.0 Mbps
* 48.0 Mbps
* 54.0 Mbps
Band 2:
Capabilities: 0x1062
HT20/HT40
Static SM Power Save
RX HT20 SGI
RX HT40 SGI
No RX STBC
Max AMSDU length: 3839 bytes
DSSS/CCK HT40
Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
Minimum RX AMPDU time spacing: 4 usec (0x05)
HT TX/RX MCS rate indexes supported: 0-15, 32
Frequencies:
* 5180 MHz [36] (22.0 dBm) (passive scanning, no IBSS)
* 5200 MHz [40] (22.0 dBm) (passive scanning, no IBSS)
* 5220 MHz [44] (22.0 dBm) (passive scanning, no IBSS)
* 5240 MHz [48] (22.0 dBm) (passive scanning, no IBSS)
* 5260 MHz [52] (22.0 dBm) (passive scanning, no IBSS, radar detection)
* 5280 MHz [56] (22.0 dBm) (passive scanning, no IBSS, radar detection)
* 5300 MHz [60] (22.0 dBm) (passive scanning, no IBSS, radar detection)
* 5320 MHz [64] (22.0 dBm) (passive scanning, no IBSS, radar detection)
* 5500 MHz [100] (22.0 dBm) (passive scanning, no IBSS, radar detection)
* 5520 MHz [104] (22.0 dBm) (passive scanning, no IBSS, radar detection)
* 5540 MHz [108] (22.0 dBm) (passive scanning, no IBSS, radar detection)
* 5560 MHz [112] (22.0 dBm) (passive scanning, no IBSS, radar detection)
* 5580 MHz [116] (22.0 dBm) (passive scanning, no IBSS, radar detection)
* 5600 MHz [120] (22.0 dBm) (passive scanning, no IBSS, radar detection)
* 5620 MHz [124] (22.0 dBm) (passive scanning, no IBSS, radar detection)
* 5640 MHz [128] (22.0 dBm) (passive scanning, no IBSS, radar detection)
* 5660 MHz [132] (22.0 dBm) (passive scanning, no IBSS, radar detection)
* 5680 MHz [136] (22.0 dBm) (passive scanning, no IBSS, radar detection)
* 5700 MHz [140] (22.0 dBm) (passive scanning, no IBSS, radar detection)
* 5720 MHz [144] (22.0 dBm) (passive scanning, no IBSS, radar detection)
* 5745 MHz [149] (22.0 dBm) (passive scanning, no IBSS)
* 5765 MHz [153] (22.0 dBm) (passive scanning, no IBSS)
* 5785 MHz [157] (22.0 dBm) (passive scanning, no IBSS)
* 5805 MHz [161] (22.0 dBm) (passive scanning, no IBSS)
* 5825 MHz [165] (22.0 dBm) (passive scanning, no IBSS)
Bitrates (non-HT):
* 6.0 Mbps
* 9.0 Mbps
* 12.0 Mbps
* 18.0 Mbps
* 24.0 Mbps
* 36.0 Mbps
* 48.0 Mbps
* 54.0 Mbps
max # scan SSIDs: 20
max scan IEs length: 393 bytes
Coverage class: 0 (up to 0m)
Supported Ciphers:
* WEP40 (00-0f-ac:1)
* WEP104 (00-0f-ac:5)
* TKIP (00-0f-ac:2)
* CCMP (00-0f-ac:4)
* CMAC (00-0f-ac:6)
Available Antennas: TX 0 RX 0
Supported interface modes:
* IBSS
* managed
* AP
* AP/VLAN
* monitor
* P2P-client
* P2P-GO
* Unknown mode (10)
software interface modes (can always be added):
* AP/VLAN
* monitor
valid interface combinations:
* #{ managed } <= 1, #{ AP, P2P-client, P2P-GO } <= 1, #{ Unknown mode (10) } <= 1,
total <= 3, #channels <= 1
Supported commands:
* new_interface
* set_interface
* new_key
* new_beacon
* new_station
* new_mpath
* set_mesh_params
* set_bss
* authenticate
* associate
* deauthenticate
* disassociate
* join_ibss
* join_mesh
* remain_on_channel
* set_tx_bitrate_mask
* action
* frame_wait_cancel
* set_wiphy_netns
* set_channel
* set_wds_peer
* Unknown command (84)
* Unknown command (87)
* Unknown command (85)
* Unknown command (89)
* Unknown command (92)
* connect
* disconnect
Supported TX frame types:
* IBSS: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
* managed: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
* AP: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
* AP/VLAN: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
* mesh point: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
* P2P-client: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
* P2P-GO: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
* Unknown mode (10): 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
Supported RX frame types:
* IBSS: 0x40 0xb0 0xc0 0xd0
* managed: 0x40 0xd0
* AP: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
* AP/VLAN: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
* mesh point: 0xb0 0xc0 0xd0
* P2P-client: 0x40 0xd0
* P2P-GO: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
* Unknown mode (10): 0x40 0xd0
Device supports RSN-IBSS.
WoWLAN support:
* wake up on disconnect
* wake up on magic packet
* wake up on pattern match, up to 20 patterns of 16-128 bytes
* can do GTK rekeying
* wake up on GTK rekey failure
* wake up on EAP identity request
* wake up on 4-way handshake
* wake up on rfkill release
HT Capability overrides:
* MCS: ff ff ff ff ff ff ff ff ff ff
* maximum A-MSDU length
* supported channel width
* short GI for 40 MHz
* max A-MPDU length exponent
* min MPDU start spacing
Device supports TX status socket option.
Device supports HT-IBSS.
Using iwconfig to set it to "Master" mode, which I think means to set it to AP mode, results in this:
$ sudo iwconfig wlan0 mode Master
Error for wireless request "Set Mode" (8B06) :
SET failed on device wlan0 ; Invalid argument.
So, I guess it's possible that the 7260 driver does not want to work in AP mode. However, the iwlist command output shows AP mode as one of the possibilities.
(Question solved by edit. Converted to community wiki answer.)
The OP wrote:
All right, looks like happy day, I just needed to add this:
### Set your bridge name ###
bridge=br0
to the hostapd.conf file. Now I get:
$ sudo hostapd /etc/hostapd/hostapd.conf
Configuration file: /etc/hostapd/hostapd.conf
Using interface wlan0 with hwaddr 80:19:34:32:20:a3 and ssid "test"
wlan0: interface state UNINITIALIZED->ENABLED
wlan0: AP-ENABLED

Resources