Re: Problem with LOCK_PROFILING stats in 7.2

2009-05-25 Thread Nikola Knežević

On 05.22.2009, at 14:21 , Nikola Knežević wrote:

I'm using LOCK_PROFILING to, well, profile some locks in the module  
I'm working on. I also have INVARIANTS turned on. Numbers I'm  
getting look correct, however, name of the lock is strange (for some  
of the locks I'm using):


25725 51777294 10979957 7331938 7 1
408303   896814 /home/knl/work/mx/click/bsdmodule/..//include/ 
click/sync.hh:395 (sleep mutex:?? ?Yf;??? ??:?)


Why am I getting this instead of lock's real name: MasterLock[10060]?


To reply to myself :)

mtx_init & co. expects the name to be persistent during the whole run.  
So, never pass values from the stack to it, as I did.


Cheers,
Nikola___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Problem with LOCK_PROFILING stats in 7.2

2009-05-22 Thread Nikola Knežević

Hi,

I'm using LOCK_PROFILING to, well, profile some locks in the module  
I'm working on. I also have INVARIANTS turned on. Numbers I'm getting  
look correct, however, name of the lock is strange (for some of the  
locks I'm using):


 25725 51777294 10979957 7331938 7 1
408303   896814 /home/knl/work/mx/click/bsdmodule/..//include/ 
click/sync.hh:395 (sleep mutex:?? ?Yf;??? ??:?)


Why am I getting this instead of lock's real name: MasterLock[10060]?

Cheers,
Nikola___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Failing to get dc-misses with pmc

2009-05-12 Thread Nikola Knežević

Hi,

I'm trying to get number of L2 cache misses on a system level via:
 sudo pmcstat -S dc-misses -O /tmp/sample.out

However, I'm getting this error:
pmcstat: ERROR: Cannot allocate system-mode pmc with specification "dc- 
misses": Invalid argument


I'm running 7.1-RELEASE-p3 on:
CPU: Intel(R) Xeon(R) CPU   X5472  @ 3.00GHz (3004.49-MHz K8- 
class CPU)

  Origin = "GenuineIntel"  Id = 0x10676  Stepping = 6
   
Features 
= 
0xbfebfbff 
< 
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,HTT,TM,PBE>
   
Features2 
= 
0xce3bd 
>

  AMD Features=0x20100800
  AMD Features2=0x1
  Cores per package: 4
usable memory = 8570097664 (8173 MB)
avail memory  = 8243294208 (7861 MB)
ACPI APIC Table: 


What am I doing wrong?

Thanks,
Nikola
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Cannot access memory at address 0xb

2009-02-11 Thread Nikola Knežević

Hi,

my 8-core amd64 machine crashes when I'm trying to run my module. The  
problem is that I can't debug it, since core dump is broken.


---8<---
GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and  
you are
welcome to change it and/or distribute copies of it under certain  
conditions.

Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for  
details.

This GDB was configured as "amd64-marcel-freebsd"...
Cannot access memory at address 0xb
(kgdb) bt
#0  0x in ?? ()
Cannot access memory at address 0x0
(kgdb)
--->8---

I can obtain correct coredumps when I'm running everything inside  
QEMU, but not when I'm running on a real machine. Also, panic doesn't  
occur inside QEMU :(


Any hints?

Cheers,
Nikola


___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: Setting per processor (/core) affinity from within FreeBSD

2008-12-22 Thread Nikola Knežević

16 Dec 2008, at 06:40 , Garrett Cooper wrote:


  I was wondering if anyone has written a utility for FreeBSD to tie
a particular process group to a processor / core, similar to what
Linux has done with taskset, so that affinity can be properly set  
with

FreeBSD and the ULE scheduler.


I believe cpuset(2) will do what you want. It is available starting
with 7.1-RELEASE (which isn't released yet, but you can grab 7.1-RC1
to test it out).


Hi,

what I read from the documentation is that cpuset works on processes.  
Is it possible to pin a kthread to a particular core?


Cheers,
N.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Cluster-wide installation of FreeBSD

2008-12-14 Thread Nikola Knežević

Hi,

I have a machine running FreeBSD 7.1, and now I would like to  
"replicate" it to other machines in our cluster. Other machines have  
smaller disks, and a different processor, but all are amd64.


Is there a way to do this kind of installation (either by copying  
content, or installing and then copying /etc) in automated fashion? I  
can set up the netboot environment (since I'm using FAI to install  
linux on the same machines).


Cheers,
Nikola
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Compiling C++ modules

2008-11-19 Thread Nikola Knežević

Hi,

what are the recommended CXXFLAGS for C++ code which should go in  
kernel module?


Yes, I know C++ in kernel is a bad idea, but those are the  
requirements...


Best,
Nikola
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Strange hang with dummynet

2008-09-16 Thread Nikola Knežević

On 16 Sep 2008, at 14:38 , Nikola Kne?evi? wrote:

I'm running FreeBSD 7.1-PRERELEASE with custom kernel on my box, and  
when I did:

kldload dummynet && kldload ipfw
the machine just "hanged" - I couldn't access it over ssh, and  
current sessions were blocked.
This happens also with GENERIC. I didn't touch anything related to  
ipfw or dummynet's configuration (that I know).

Any thoughts? How can I debug this?


To reply to myself, for future reference :)

dummynet loads ipfw, which has the default rule of drop all. Thus  
machines shows as inaccessible/unresponsive.


Cheers,
Nikola
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: /: write failed, filesystem is full

2008-09-05 Thread Nikola Knežević

On 5 Sep 2008, at 04:34 , Gautham Ganapathy wrote:



As soon as I start copying files from FTP, this is the error I get:
/: write failed, filesystem is full



I used to get the same error on freebsd 7.0-release if the bsd  
partition was
not aligned to cylinder boundaries. did sysinstall give any warnings  
about

this when you partitioned your harddrive?


No, there was no warning about alignment. Only warning was about disk  
geometry.


I tried to install FreeBSD couple of times, and third time it worked  
like charm :) No warning, no errors. Since I have two machines which  
are the same, I will try the second one today.


Cheers,
Nikola
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


error: symbol ether_poll_register undefined

2008-09-03 Thread Nikola Knežević

Hi guys,

I'm trying to port Click modular router to FreeBSD 7.0. Along the way,  
I changed it quite a bit, but I managed to get it to compile. Well,  
when I try to load it (via sudo make load), this is what I get:


link_elf_obj: symbol ether_poll_register undefined
kldload: /usr/home/knl/work/mx-dfly/core/module/mxcore.ko: Unsupported  
file type


What am I missing? I assume that ether_poll_register should be in the  
kernel.


objdump -x -d mxcore.ko gives me a bunch of '*UND*', like _vn_lock,  
but they exist in the kernel.


Cheers,
Nikola
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


/: write failed, filesystem is full

2008-09-03 Thread Nikola Knežević

Hi,
I'm trying to install FreeBSD 7.0 on our new server (Intel Xeon 2x4- 
core machine), which has a 250GB SATAII disk. I used -bootonly CD  
image, and assigned whole disk to FreeBSD. Breakdown is:

/ - 2GB
swap - 4GB
/var - 9GB
/tmp - 4GB
/usr - 213GB

As soon as I start copying files from FTP, this is the error I get:
/: write failed, filesystem is full

This shouldn't happen, since sysinstall did newfs on these partitions.

What to do?

I'll now try to run livefs disk, to see what is happening there.

Cheers,
Nikola
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


SMP aware programming

2008-08-03 Thread Nikola Knežević

Hi,

I'm about to port ModelNet (a large-scale internet emulator) from  
FreeBSD 4 to FreeBSD 7. It is implemented as a module. Well, changing  
couple of headers and structs will probably solve the thing, but I  
would like to make it SMP aware. Since it emulates a lot of nodes,  
each of which is doing some processing, I would like to "group" them,  
so ones are executing on one core, other on second and so on...


Can someone give me some pointers to some good tutorial, text,  
documentation? I know about multiprogramming, but I never did anything  
in a kernel.


Thank,
Nikola
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"