Re: rwlock(9) upgrade

2013-09-30 Thread Matthew Fleming
On Sun, Sep 29, 2013 at 11:09 PM, Hooman Fazaeli wrote: > Hi, > > For rwlock(9), there is no rwlock_upgrade function. > Is it safe to use rw_wlock() for that purpose? In other words, Does calling > rw_wlock() upgradeanalready r-locked lock? No, calling rw_wlock when you hold the lock in read mo

Re: Getting vnode + credentials of a file from a struct mount and UFS inode #

2011-04-13 Thread Matthew Fleming
dn't have been. > VFS_VGET gives you the vnode pointer; you shouldn't need getvnode() or struct file or anything else. There are other ways to get a vnode *, but from an ino_t that's the easiest I know of. Cheers, matthew > -Original Message- > From: Matthew Fle

Re: Getting vnode + credentials of a file from a struct mount and UFS inode #

2011-04-13 Thread Matthew Fleming
. I haven't looked at this field before, but it looks that f_cred is set on falloc() to the cred of the thread creating the struct file (the thread that called open or socket or pipe or kqueue, etc.). Are you running this as root/wheel? Cheers, matthew > -Original Message----- >

Re: Getting vnode + credentials of a file from a struct mount and UFS inode #

2011-04-13 Thread Matthew Fleming
ed properly? f_cred is a field in struct file, not struct vnode, so I'm confused as to what you're referring to. Cheers, matthew > -Original Message- > From: Matthew Fleming [mailto:mdf...@gmail.com] > Sent: Wednesday, April 13, 2011 1:48 PM > To: Jonathan Stuart &g

Re: Getting vnode + credentials of a file from a struct mount and UFS inode #

2011-04-13 Thread Matthew Fleming
On Wed, Apr 13, 2011 at 12:31 PM, Jonathan Stuart wrote: > Hi, > > I'd like to pull the owner/group ownership from a file (the information I > have about the file is it's UFS inode # and it's struct mount *).  I'm sure > there's got to be a function that would return a vnode and I could VTOI() t

Re: DMA controller on Northbridge?

2011-03-22 Thread Matthew Fleming
On Tue, Mar 22, 2011 at 11:12 AM, Kostik Belousov wrote: > On Tue, Mar 22, 2011 at 10:11:04AM -0700, Matthew Fleming wrote: >> How can I tell if the Northbridge on a machine has a built-in DMA >> controller?  And if it does, what device would I use to control it? >> >>

DMA controller on Northbridge?

2011-03-22 Thread Matthew Fleming
How can I tell if the Northbridge on a machine has a built-in DMA controller? And if it does, what device would I use to control it? I ask because I'm working with a PCI card that has a 36-bit physical address limit, and that means bounce buffers when using more than 64GB of memory. I'd prefer n

Re: Puzzled about VFS sysctl OIDs -- signed vs. unsigned

2011-03-03 Thread Matthew Fleming
On Thu, Mar 3, 2011 at 2:03 PM, Brandon Gooch wrote: > On Thu, Mar 3, 2011 at 3:34 PM, Matthew Fleming wrote: >> On Thu, Mar 3, 2011 at 1:03 PM, Brandon Gooch >> wrote: >>> On Thu, Mar 3, 2011 at 11:49 AM, David Wolfskill >>> wrote: >>>> I'

Re: Puzzled about VFS sysctl OIDs -- signed vs. unsigned

2011-03-03 Thread Matthew Fleming
On Thu, Mar 3, 2011 at 1:03 PM, Brandon Gooch wrote: > On Thu, Mar 3, 2011 at 11:49 AM, David Wolfskill wrote: >> I'm using a little shell script to capture selected sysctl OID >> values periodically, in an attempt to get a better idea how the >> resources of a system are being used during a long

Re: mtx_init/lock_init and uninitialized struct mtx

2011-02-24 Thread Matthew Fleming
On Thu, Feb 24, 2011 at 7:47 AM, Dmitry Krivenok wrote: > Hello Hackers, > > Is it allowed to call mtx_init on a mutex defined as an auto variable > and not initialized explicitly, i.e.: We recently ran into this problem at $WORK because we turned on the deadc0de checking in uma zones for any zon

Re: Divide-by-zero in loader

2011-01-28 Thread Matthew Fleming
On Fri, Jan 28, 2011 at 11:23 AM, John Baldwin wrote: > On Friday, January 28, 2011 2:14:45 pm Matthew Fleming wrote: >> On Fri, Jan 28, 2011 at 11:00 AM, John Baldwin wrote: >> > On Friday, January 28, 2011 12:41:08 pm Matthew Fleming wrote: >> >> I spent a few d

Re: Divide-by-zero in loader

2011-01-28 Thread Matthew Fleming
On Fri, Jan 28, 2011 at 11:00 AM, John Baldwin wrote: > On Friday, January 28, 2011 12:41:08 pm Matthew Fleming wrote: >> I spent a few days chasing down a bug and I'm wondering if a loader >> change would be appropriate. >> >> So we have these new front-panel LCDs

Divide-by-zero in loader

2011-01-28 Thread Matthew Fleming
I spent a few days chasing down a bug and I'm wondering if a loader change would be appropriate. So we have these new front-panel LCDs, and like everything these days it's a SoC. Normally it presents to FreeBSD as a USB communications device (ucom), but when the SoC is sitting in its own boot loa

Re: Question about sysctl-ing coretemp module values

2011-01-15 Thread Matthew Fleming
On Sat, Jan 15, 2011 at 12:09 PM, Harald Servat wrote: > Hello, > >  First of all, forgive if this is not the appropiate list to ask this. > Could you point me the correct list if so? > >  I'm writing a small program to capture the temperature reported by the > coretemp kernel module. I'm doing th

Re: getting a list of open files versus PID nos.?

2010-12-08 Thread Matthew Fleming
On Wed, Dec 8, 2010 at 3:01 PM, Bruce Cran wrote: > On Wed, 8 Dec 2010 14:54:57 -0800 > Matthew Fleming wrote: > >> This is what lsof is for.  I believe there's one in ports, but I have >> never tried it. > > Is there any advantage to using lsof instead of fst

Re: getting a list of open files versus PID nos.?

2010-12-08 Thread Matthew Fleming
On Wed, Dec 8, 2010 at 2:18 PM, Chuck Robey wrote: > I think, *maybe* that I have located what's been giving me all of those > machine lockups.  I was all ready to replace the mobo & cpu when I noticed a > panic error of being out of open files.  The message suggested just adding > the ability for

Re: Question about process rlimits

2010-12-02 Thread Matthew Fleming
On Thu, Dec 2, 2010 at 12:51 PM, Andrew Duane wrote: > > I've been poking at some bugs we have around pushing user memory to/past the > limits of our box, and decided to try seeing what happens on a stock FreeBSD > system (7.1 in this case). > > Basically I have a program that mallocs big memory

Re: Examining the VM splay tree effectiveness

2010-09-30 Thread Matthew Fleming
On Thu, Sep 30, 2010 at 9:37 AM, Andre Oppermann wrote: > Just for the kick of it I decided to take a closer look at the use of > splay trees (inherited from Mach if I read the history correctly) in > the FreeBSD VM system suspecting an interesting journey. > > The VM system has two major structur

Re: Adding a V=R mapping for amd64?

2010-09-29 Thread Matthew Fleming
On Wed, Sep 29, 2010 at 1:12 PM, Kostik Belousov wrote: > On Wed, Sep 29, 2010 at 12:40:57PM -0700, Matthew Fleming wrote: >> I'm hacking around with making a "fast reboot" that puts a copy of the >> MBR from disk into address 0x7c00 and, after disabling various &g

Adding a V=R mapping for amd64?

2010-09-29 Thread Matthew Fleming
I'm hacking around with making a "fast reboot" that puts a copy of the MBR from disk into address 0x7c00 and, after disabling various translation bits and stopping other CPUs, branches to it, to skip the hardware self test that normally happens on boot. I haven't gotten to the point of attempting

Re: race conditions for destroying and opening a dev

2010-09-16 Thread Matthew Fleming
On Thu, Sep 16, 2010 at 12:00 PM, Matthew Jacob wrote: > > Has anyone seen this scenario before? I am seeing it in RELENG_7, but the > code in question exists through to head. > > Thread 1: > > (kgdb) where > #0  sched_switch (td=0xff003a04ea80, newtd=0xff00210b4000, > flags=Variable "flag

Re: Questions about mutex implementation in kern/kern_mutex.c

2010-09-15 Thread Matthew Fleming
I'll take a stab at answering these... On Wed, Sep 15, 2010 at 6:44 AM, Andrey Simonenko wrote: > Hello, > > I have questions about mutex implementation in kern/kern_mutex.c > and sys/mutex.h files (current versions of these files): > > 1. Is the following statement correct for a volatile pointer

Re: Using lex in a shared library

2010-07-06 Thread Matthew Fleming
On Fri, Jul 2, 2010 at 4:52 PM, Xin LI wrote: > I think you could probably just change the code and use %option noyywrap > in the .l file?  (do your code call yywrap() directly?) The code doesn't use yywrap directly, and this has fixed the build for amd64. Thanks! matthew ___

Re: Using lex in a shared library

2010-07-02 Thread Matthew Fleming
On Fri, Jul 2, 2010 at 11:54 PM, Xin LI wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA256 > > On 2010/07/02 16:52, Xin LI wrote: >> On 2010/07/02 16:34, Matthew Fleming wrote: >>> On Fri, Jul 2, 2010 at 4:02 PM, Garrett Cooper wrote: >>>> On Fri,

Re: Using lex in a shared library

2010-07-02 Thread Matthew Fleming
On Fri, Jul 2, 2010 at 4:02 PM, Garrett Cooper wrote: > On Fri, Jul 2, 2010 at 2:51 PM, Matthew Fleming wrote: >> I have the following Makefile for a shared library at $work: >> >> ISI_TOP=        ../.. >> >> LIB=            isi_date >> SHLIB_M

Re: Using lex in a shared library

2010-07-02 Thread Matthew Fleming
On Fri, Jul 2, 2010 at 2:54 PM, Philip Herron wrote: > On 2 July 2010 22:51, Matthew Fleming wrote: >> I have the following Makefile for a shared library at $work: >> >> ISI_TOP=        ../.. >> >> LIB=            isi_date >> SHLIB_MAJOR=    1 >>

Using lex in a shared library

2010-07-02 Thread Matthew Fleming
I have the following Makefile for a shared library at $work: ISI_TOP=../.. LIB=isi_date SHLIB_MAJOR=1 SHLIB_MINOR=0 SRCS= date.c date_parser.new.c lex.yy.c INCS= date.h INCLUDEDIR= /usr/include/isi_date YFLAGS+=-vt FLEX= /usr/

RE: idle threads

2010-04-23 Thread Matthew Fleming
> then they rightly passes sched_idletd(). Any scheduler may define its > own version of sched_idletd(). Oops, youre right, I was just unable to read at the end of the day on Friday. Thanks! matthew ___ freebsd-hackers@freebsd.org mailing list http://li

idle threads

2010-04-23 Thread Matthew Fleming
I'm looking at kern_idle.c in stable/7 and I don't quite follow how idle threads work. The kthread_create(9) call does not pass in a function pointer, so what code does a processor run when there is no other runnable thread? Thanks, matthew ___ freebsd-

RE: Error checking in ioctl(2)?

2010-04-22 Thread Matthew Fleming
> Hi hackers, > I realize that this isn't 100% userland code, so the checks should > be minimalized, but when looking at the ioctl(2) syscall code (at > least I think it is... there's another dupe hanging around in > sys/dev/hptmv/ioctl.c), I had some questions related to the error > handling n

memguard(9) rewrite

2010-03-11 Thread Matthew Fleming
This patch is against something close to stable/7. We've found internally that memguard(9) isn't very usable for debugging; it seems to run out of resources and do other unfriendly things. This patch is my first attempt to make it more usable. The basic changes are: - take a lot more KVA if av

RE: [patch] burncd: honour for envar SPEED

2009-11-10 Thread Matthew Fleming
> On Tue, Nov 10, 2009 at 08:03:26AM -0800, Nate Eldredge wrote: > > On Tue, 10 Nov 2009, Alexander Best wrote: > > > > >ps: would be nice if strcasecmp could protect itself from segfault > > >with one or both of the args being NULL. > > > > I disagree. What do you think it should do instead? Ret

RE: C++ incompatability, was C99: Suggestions for style(9)

2009-05-01 Thread Matthew Fleming
> > [snip exciting discussion on style] > > > > > There are several C99 features used already, e.g. designated initializers: > > > bla bli = { .blub = "foo", .arr[0] = 42 }; > > > Do you suggest that this should not be used, because it is inconsistent > > > with all the other existing compound i

C++ incompatability, was C99: Suggestions for style(9)

2009-05-01 Thread Matthew Fleming
[snip exciting discussion on style] > There are several C99 features used already, e.g. designated initializers: > bla bli = { .blub = "foo", .arr[0] = 42 }; > Do you suggest that this should not be used, because it is inconsistent > with all the other existing compound initialisations? Re

knotes

2009-03-03 Thread Matthew Fleming
I am trying to understand the knote system (on 6.1) and I am having some troubles. Specifically, I am confused by the uses of KN_DETACHED and EV_ONESHOT. >From what I can determine from the comments and code, knotes have a filterops member, kn_fop. This among other things has a callback to handle

Re: Dynamic ddb commands

2009-02-02 Thread Matthew Fleming
> In general it is far easier to just add sysinit's than to hack directly on > the > kernel linker. There are very few ddb commands, so one extra pointer or two > per command is not a lot of space. Respectfully, I disagree, for several reasons. First, in order to make sysinit and sysctl work,

Re: Dynamic ddb commands

2009-01-30 Thread Matthew Fleming
> If I recall it was painful to find entries in the help listing w/o sorting. So it's a human reading problem, where ddb spat out the command names in order that they were in the in-memory struct, and if I wanted to look over the listing I had to visually scan every one since they weren't in order

Re: Dynamic ddb commands

2009-01-30 Thread Matthew Fleming
Just an addenda: > I see that BSD 7.1 has dynamic commands using sysinits and sysuninit's to > call a new > db_[un]register_cmd. I was looking at HEAD, not RELENG_7_1. The remainder of my questions as to why this mechanism are the same, though. Thanks, matthew _

Dynamic ddb commands

2009-01-30 Thread Matthew Fleming
I'm working on BSD 6.x and of course the set of ddb commands is static to whatever is in the kernel at compile. I see that BSD 7.1 has dynamic commands using sysinits and sysuninit's to call a new db_[un]register_cmd. I see this, though, only after I have spent a day or so adding a linker_file_[u