Re: dup3 syscall - atomic set O_CLOEXEC with dup2

2012-01-21 Thread Kostik Belousov
On Fri, Jan 20, 2012 at 07:09:43PM -0500, Eitan Adler wrote: > 2012/1/20 Kostik Belousov : > > On Fri, Jan 20, 2012 at 06:25:42PM -0500, Eitan Adler wrote: > >> I figure this isn't wanted? > > You silently ignored part of the notes that were provided, > > I fix

Re: dup3 syscall - atomic set O_CLOEXEC with dup2

2012-01-20 Thread Kostik Belousov
On Fri, Jan 20, 2012 at 06:25:42PM -0500, Eitan Adler wrote: > I figure this isn't wanted? You silently ignored part of the notes that were provided, and keep complete silence on the primary question about non-standard and fractional nature of the patch. I see no reason to retype my previous respo

Re: Processes' FIBs

2012-01-13 Thread Kostik Belousov
On Thu, Jan 12, 2012 at 10:44:51PM -0800, Julian Elischer wrote: > On 1/12/12 6:04 AM, Oliver Fromme wrote: > >Bjoern A. Zeeb wrote: > > > On 11. Jan 2012, at 15:06 , Oliver Fromme wrote: > > > > I'm currently looking at the source code of ps, but adding > > > > a field for the FIB isn't as

Re: dup3 syscall - atomic set O_CLOEXEC with dup2

2012-01-12 Thread Kostik Belousov
On Thu, Jan 12, 2012 at 12:08:40PM +0200, Kostik Belousov wrote: > On Thu, Jan 12, 2012 at 12:01:29AM -0500, Eitan Adler wrote: > > This is an implementation of dup3 for FreeBSD: > > man page here (with a FreeBSD patch coming soon): > > https://www.kernel.org/doc/man-pages/on

Re: dup3 syscall - atomic set O_CLOEXEC with dup2

2012-01-12 Thread Kostik Belousov
On Thu, Jan 12, 2012 at 12:01:29AM -0500, Eitan Adler wrote: > This is an implementation of dup3 for FreeBSD: > man page here (with a FreeBSD patch coming soon): > https://www.kernel.org/doc/man-pages/online/pages/man2/dup.2.html > > Is this implementation correct? If so any objection to adding th

Re: Checking for other kernel modules on load

2011-12-29 Thread Kostik Belousov
On Thu, Dec 29, 2011 at 12:53:19PM +, Chris Rees wrote: > 2011/12/29 Kostik Belousov : > > On Thu, Dec 29, 2011 at 11:46:57AM +, Chris Rees wrote: > >> 2011/12/28 Kostik Belousov : > >> > On Wed, Dec 28, 2011 at 02:53:42PM +, Chris Rees wrote: >

Re: Checking for other kernel modules on load

2011-12-29 Thread Kostik Belousov
On Thu, Dec 29, 2011 at 11:46:57AM +, Chris Rees wrote: > 2011/12/28 Kostik Belousov : > > On Wed, Dec 28, 2011 at 02:53:42PM +, Chris Rees wrote: > >> 2011/12/28 Kostik Belousov : > >> > On Wed, Dec 28, 2011 at 12:23:58PM +, Chris Rees wrote: > >&g

Re: Checking for other kernel modules on load

2011-12-28 Thread Kostik Belousov
On Wed, Dec 28, 2011 at 02:53:42PM +, Chris Rees wrote: > 2011/12/28 Kostik Belousov : > > On Wed, Dec 28, 2011 at 12:23:58PM +, Chris Rees wrote: > >> On 28 December 2011 12:21, Daniel O'Connor wrote: > >> > > >> > On 28/12/2011, at 22:07,

Re: Checking for other kernel modules on load

2011-12-28 Thread Kostik Belousov
On Wed, Dec 28, 2011 at 12:23:58PM +, Chris Rees wrote: > On 28 December 2011 12:21, Daniel O'Connor wrote: > > > > On 28/12/2011, at 22:07, Chris Rees wrote: > >> Is there a simple way to check for existence of a driver?  I could > >> even check for /dev/sndstat, though that doesn't seem eleg

Re: Per-mount syncer threads and fanout for pagedaemon cleaning

2011-12-27 Thread Kostik Belousov
On Tue, Dec 27, 2011 at 05:05:04PM +0100, Attilio Rao wrote: > 2011/12/27 Giovanni Trematerra : > > On Mon, Dec 26, 2011 at 9:24 PM, Venkatesh Srinivas > > wrote: > >> Hi! > >> > >> I've been playing with two things in DragonFly that might be of interest > >> here. > >> > >> Thing #1 := > >> > >>

Re: Getting swapped-out memory per process

2011-12-26 Thread Kostik Belousov
On Mon, Dec 26, 2011 at 02:02:09PM -0500, Boris Kochergin wrote: > Hi. > > Is there a way, from userspace, to get the amount of memory a given > process currently has swapped out? The VM does not track memory 'per process'. Simplifying to the point where the statement becomes false, it assigns th

Re: rtld and noexec

2011-12-04 Thread Kostik Belousov
On Sun, Dec 04, 2011 at 02:17:43PM +0100, joris dedieu wrote: > 2011/12/2 Alexander Kabaev : > > On Fri, 2 Dec 2011 18:22:57 +0100 > > joris dedieu wrote: > > > >> Hi, > >> > >> Here is a patch I use to prevent loading a shared object from a noexec > >> mountpoint.  It's an easy way, I found, afte

Re: "ps -e" without procfs(5)

2011-11-09 Thread Kostik Belousov
On Wed, Nov 09, 2011 at 02:44:55PM +0200, Kostik Belousov wrote: > On Tue, Nov 08, 2011 at 11:47:54PM +0200, Mikolaj Golub wrote: > > > > On Sun, 6 Nov 2011 20:10:41 +0200 Kostik Belousov wrote: > > > > KB> On Sat, Nov 05, 2011 at 10:37:46PM +0200, Mikolaj Golu

Re: "ps -e" without procfs(5)

2011-11-09 Thread Kostik Belousov
On Tue, Nov 08, 2011 at 11:47:54PM +0200, Mikolaj Golub wrote: > > On Sun, 6 Nov 2011 20:10:41 +0200 Kostik Belousov wrote: > > KB> On Sat, Nov 05, 2011 at 10:37:46PM +0200, Mikolaj Golub wrote: > >> > >> http://people.freebsd.org/~trociny/env.sys.3.patch >

Re: "ps -e" without procfs(5)

2011-11-06 Thread Kostik Belousov
On Sat, Nov 05, 2011 at 10:37:46PM +0200, Mikolaj Golub wrote: > > On Sat, 5 Nov 2011 21:45:53 +0200 Kostik Belousov wrote: > > KB> On Sat, Nov 05, 2011 at 08:59:21PM +0200, Mikolaj Golub wrote: > >> > >> On Sat, 5 Nov 2011 17:44:43 +0200 Kostik Belousov wro

Re: "ps -e" without procfs(5)

2011-11-05 Thread Kostik Belousov
On Sat, Nov 05, 2011 at 08:59:21PM +0200, Mikolaj Golub wrote: > > On Sat, 5 Nov 2011 17:44:43 +0200 Kostik Belousov wrote: > > >> KB> I think that the aux vector must be naturally aligned. You can return > >> KB> ENOEXEC early if vptr is not aligned. >

Re: "ps -e" without procfs(5)

2011-11-05 Thread Kostik Belousov
On Sat, Nov 05, 2011 at 05:40:22PM +0200, Mikolaj Golub wrote: > > On Sat, 5 Nov 2011 15:58:01 +0200 Kostik Belousov wrote: > > KB> +if (error == EFAULT) { > KB> +for (i = 0; i < len; i++) { > KB> +

Re: "ps -e" without procfs(5)

2011-11-05 Thread Kostik Belousov
On Wed, Nov 02, 2011 at 11:27:37PM +0200, Mikolaj Golub wrote: > > On Mon, 31 Oct 2011 11:49:48 +0200 Kostik Belousov wrote: > > KB> I think it is better to use sys/elf.h over the machine/elf.h. > > KB> Please change the comment for PROC_AUXV_MAX to "Safety limit o

Re: "ps -e" without procfs(5)

2011-11-01 Thread Kostik Belousov
On Tue, Nov 01, 2011 at 09:07:11AM +0200, Mikolaj Golub wrote: > > On Mon, 31 Oct 2011 11:49:48 +0200 Kostik Belousov wrote: > > KB> For PROC_ARG and PROC_ENV, you blindly trust the read values of the arg > and > KB> env vector sizes. This can easily cause kernel pa

Re: "ps -e" without procfs(5)

2011-10-31 Thread Kostik Belousov
On Mon, Oct 31, 2011 at 12:54:42PM +0200, Mikolaj Golub wrote: > > On Mon, 31 Oct 2011 11:49:48 +0200 Kostik Belousov wrote: > > KB> On Sat, Oct 29, 2011 at 01:32:39PM +0300, Mikolaj Golub wrote: > >> > >> What do you think about the attached p

Re: "ps -e" without procfs(5)

2011-10-31 Thread Kostik Belousov
On Sat, Oct 29, 2011 at 01:32:39PM +0300, Mikolaj Golub wrote: > > On Tue, 25 Oct 2011 11:24:51 +0300 Kostik Belousov wrote: > > KB> On Tue, Oct 25, 2011 at 12:13:10AM +0300, Mikolaj Golub wrote: > >> > >> On Sun, 16 Oct 2011 20:10:05 +0300 Kostik Belous

Re: In-kernel API for tasks, which could wait?

2011-10-30 Thread Kostik Belousov
On Sun, Oct 30, 2011 at 06:54:51PM +0400, Lev Serebryakov wrote: > So, I have question: what should I do if I need to perofrm ONE > action, which could block for some time (for example, open file or > create ALQ)? > > I could create thread for this. But it looks strange and too heavy: create >

Re: Kernel Space Memory Allocation

2011-10-27 Thread Kostik Belousov
On Thu, Oct 27, 2011 at 10:31:43AM +0200, Daniel Grech wrote: > Hi, > > I am allocating memory from a device driver in the kernel and passing it on > to another driver. In the other driver it is neccessary for me to determine > whether the address passed is from user space or kernel space as this

Re: sigprocmask and fork

2011-10-26 Thread Kostik Belousov
On Wed, Oct 26, 2011 at 05:02:00PM +0400, Alexandr Matveev wrote: > Hi, > > We are using FreeBSD 8.2 on our servers for high load projects. > When I was preparing system for production I saw strange (as I think) > behavior, > that leads to increased load on servers. > > If I made truss on httpd

Re: "ps -e" without procfs(5)

2011-10-25 Thread Kostik Belousov
On Tue, Oct 25, 2011 at 12:13:10AM +0300, Mikolaj Golub wrote: > > On Sun, 16 Oct 2011 20:10:05 +0300 Kostik Belousov wrote: > > KB> In my opinion, the way to implement the feature is to (re)use > KB> linprocfs_doargv() and provide another kern.proc sysctl to retrieve th

Re: "ps -e" without procfs(5)

2011-10-16 Thread Kostik Belousov
On Sun, Oct 16, 2011 at 07:57:57PM +0300, Mikolaj Golub wrote: > Hi, > > I have a patch that makes kvm_uread() read from user space using ptrace(2). > > http://people.freebsd.org/~trociny/kvm_uread.ptrace.patch > > With this change 'ps -e' does not requires procfs(5). > > Do you like it or ther

Re: Power usage on FreeBSD

2011-10-08 Thread Kostik Belousov
On Sat, Oct 08, 2011 at 01:44:37AM +0200, Harald Servat wrote: > Dear hackers, > > does anyone know if I can measure power consumption of the processor via > software by using FreeBSD on a Intel Core i5? Any pointer on this, or other > architectures, will be welcome. > > Thank you very much in

Re: mmap performance and memory use

2011-10-06 Thread Kostik Belousov
On Thu, Oct 06, 2011 at 04:41:45PM +0200, Wojciech Puchar wrote: > i have few questions. > > 1) suppose i map 1TB of address space as anonymous and touch just one > page. how much memory is used to manage this? I am not sure how deep the enumeration you want to know, but the first approximation w

Re: Memory allocation in kernel -- what to use in which situation? What is the best for page-sized allocations?

2011-10-02 Thread Kostik Belousov
On Sun, Oct 02, 2011 at 04:21:09PM +0400, Lev Serebryakov wrote: > Hello, Freebsd-hackers. > > Here are several memory-allocation mechanisms in the kernel. The two > I'm aware of is MALLOC_DEFINE()/malloc()/free() and uma_* (zone(9)). > > As far as I understand, malloc() is general-purpose, b

Re: Installation of kernel symbols file in a separate directory [Was: Re: Experiences with FreeBSD 9.0-BETA2]

2011-09-28 Thread Kostik Belousov
On Wed, Sep 28, 2011 at 10:30:06AM -0400, Ryan Stone wrote: > You might be interested in this PR: > > http://www.freebsd.org/cgi/query-pr.cgi?pr=153157&cat= > > This does the same thing for userland .symbols files, and teaches gdb > how to find them. The patch is not committable as is. In partic

Re: Thread-local storage issue

2011-09-15 Thread Kostik Belousov
On Thu, Sep 15, 2011 at 10:50:47AM +0800, Thinker K.F. Li wrote: > Hi Guys, > > I was in trouble for an issue of TLS implementation of FreeBSD. It is > an issue of ld-elf.so actually. If I have a thread-local variable in > program, the value of the variable is not consistent after an > dlopen().

Re: Re: Kernel timers infrastructure

2011-09-12 Thread Kostik Belousov
On Mon, Sep 12, 2011 at 11:48:42AM +0200, "Marc L?rner" wrote: > Hello, > what about changing order of callout_reset and uprintf? > And your timeout isn't 1minute, it's one second! > > Regards, > Marc > > >I already did that to ensure timer_event_handler would be called correctly. > > > >The resu

Re: Where to ask about a 7.2 bug, and debugging sys/queue.h errors

2011-08-25 Thread Kostik Belousov
On Thu, Aug 25, 2011 at 05:12:09PM -0500, Brandon Gooch wrote: > On Thu, Aug 25, 2011 at 4:53 PM, Kostik Belousov wrote: > > On Thu, Aug 25, 2011 at 03:16:09PM -0600, Charlie Martin wrote: > >> We're having a crash in some internal code running on FreeBSD 7.2 > >&g

Re: Where to ask about a 7.2 bug, and debugging sys/queue.h errors

2011-08-25 Thread Kostik Belousov
On Thu, Aug 25, 2011 at 03:16:09PM -0600, Charlie Martin wrote: > We're having a crash in some internal code running on FreeBSD 7.2 > (specifically 7.2-PRERELEASE FreeBSD 7.2-PRERELEASE and yeah, I know > it's quite a bit behind) in which after 18-30 hours of running load > tests, the code pani

Re: debugging frequent kernel panics on 8.2-RELEASE

2011-08-17 Thread Kostik Belousov
On Wed, Aug 17, 2011 at 11:21:42PM +0300, Andriy Gapon wrote: [skip] > But I also would like to use this opportunity to discuss how we can > make it easier to debug such issue as this. I think that this problem > demonstrates that when we treat certain junk in kernel address value > as a userland

Re: cam / ata timeout limited to 2147 due to overflow bug?

2011-08-05 Thread Kostik Belousov
On Fri, Aug 05, 2011 at 12:02:19AM +0100, Steven Hartland wrote: > I'm working on adding security methods to camcontrol and have > come up against a strange issue. It seems that the timeout > value for cam, at least on ata (ahci), is limited to less than > 2148 seconds. > > This can be seen by run

Re: kern/159281: [PATCH] Linux-like /proc/swaps for linprocfs

2011-07-31 Thread Kostik Belousov
On Sun, Jul 31, 2011 at 06:56:51PM +0200, Robert Millan wrote: > 2011/7/30 Kostik Belousov : > > Second, my proposal contains a flaw. Namely, if some swap device was removed > > between calls to swap_info and swap_devname calls, we get mangled list. > > Ok, I see that you f

Re: kern/159281: [PATCH] Linux-like /proc/swaps for linprocfs

2011-07-30 Thread Kostik Belousov
On Sat, Jul 30, 2011 at 01:06:48AM +0200, Robert Millan wrote: > Hi Kostik, > > 2011/7/29 Kostik Belousov : > > The patch is too hackish, IMHO. > > I would prefer to have an exported kernel function that fills xswdev > > by index, used both by vm_swap_info and linpro

Re: [PATCH] Linux-like /proc/swaps for linprocfs

2011-07-28 Thread Kostik Belousov
On Fri, Jul 29, 2011 at 01:15:59AM +0200, Robert Millan wrote: > Please consider this patch, it implements Linux-like /proc/swaps for > linprocfs. > > E.g. > > $ cat /proc/swaps > FilenameTypeSizeUsed > Priority > /dev/zvol/dimoni/swap

Re: wdrain vs. fuse/ggate (was: Re: mount vdi)

2011-07-26 Thread Kostik Belousov
On Tue, Jul 26, 2011 at 11:35:44PM +0200, Juergen Lock wrote: > On Wed, Jul 27, 2011 at 12:22:34AM +0300, Kostik Belousov wrote: > > On Tue, Jul 26, 2011 at 08:03:35PM +0200, Juergen Lock wrote: > > > On Mon, Jul 25, 2011 at 06:31:36PM -0500, Brandon Gooch wrote: > >

Re: wdrain vs. fuse/ggate (was: Re: mount vdi)

2011-07-26 Thread Kostik Belousov
On Tue, Jul 26, 2011 at 08:03:35PM +0200, Juergen Lock wrote: > On Mon, Jul 25, 2011 at 06:31:36PM -0500, Brandon Gooch wrote: > > 2011/7/25 Andrey V. Elsukov : > > > On 25.07.2011 10:18, Joe Sciulli wrote: > > >> Is it possible to mount virtualbox vdi file on the FreeBSD host?  This > > >> appear

Re: [PATCH] Improve LinuxThreads compatibility in rfork()

2011-07-12 Thread Kostik Belousov
On Tue, Jul 12, 2011 at 11:53:05PM +0200, Petr Salinger wrote: > >>I will bump revision for stable/8 when merging, but I do not see much > >>reason to bump on HEAD right now. > > Many thanks. > > >Uhm I think we can survive without a bump in HEAD. For now we will > >need to keep our backward-com

Re: [PATCH] Improve LinuxThreads compatibility in rfork()

2011-07-12 Thread Kostik Belousov
On Tue, Jul 12, 2011 at 04:36:24PM +0200, Petr Salinger wrote: > >Below is the patch I intend to commit after you retest it. > > I applied it against our 8.2 based package, > altered our "clone" to use this new > interface and run eglibc testsuite. No regression. > > Our runtime detection of thi

Re: [PATCH] Improve LinuxThreads compatibility in rfork()

2011-07-12 Thread Kostik Belousov
On Tue, Jul 12, 2011 at 11:16:28AM +0200, Petr Salinger wrote: > >>Seems this interface be acceptable ? > > > >Looks good to me. > > The proposed code changes are in the attached patch. > > Proposed wording of addition into RFORK(2): Below is the patch I intend to commit after you retest it. I a

Re: [PATCH] Improve LinuxThreads compatibility in rfork()

2011-07-11 Thread Kostik Belousov
On Mon, Jul 11, 2011 at 08:05:56PM +0200, Petr Salinger wrote: > >>Should the bit slice be 7 or 8 bits ? > > >I propose to go 8 bits, and add the check to be future-proof. > > >It seems that we already parse GNU/kFreeBSD brandnote. I think this > >could be used to distinguish between old behaviou

Re: [PATCH] Improve LinuxThreads compatibility in rfork()

2011-07-11 Thread Kostik Belousov
On Mon, Jul 11, 2011 at 06:12:15PM +0200, Petr Salinger wrote: > >I would instead use a new flag to specify a signal sent on the child > >death. Like RFTSIGZMB. If flag is not set, SIGCHLD is used. If it is > >set, the bit slice is used as signal number, 0 means do not send any > >signal. > > > >Pl

Re: [PATCH] Improve LinuxThreads compatibility in rfork()

2011-07-11 Thread Kostik Belousov
On Mon, Jul 11, 2011 at 05:43:23PM +0200, Petr Salinger wrote: > >>The 1st patch satisfies this. I agree that SIGCHLD part > >>is not easily readable. > >The SIGCHLD part is ugly. This is why I am asking about possible ways > >to overcome this. > > We need a way to specify "no signal". > It can be

Re: [PATCH] Improve LinuxThreads compatibility in rfork()

2011-07-11 Thread Kostik Belousov
On Mon, Jul 11, 2011 at 04:50:44PM +0200, Petr Salinger wrote: > >RFLINUXPTH was used by the linuxthreads port, that was popular in the > >time of FreeBSD 4.x and may be 5.x to run mysql. I will object against > >this breakage. > > Do I understand correctly that API/ABI backward compatibility with

Re: [PATCH] Improve LinuxThreads compatibility in rfork()

2011-07-11 Thread Kostik Belousov
On Mon, Jul 11, 2011 at 04:23:36PM +0200, Petr Salinger wrote: > >>>Can you, please, describe the reasoning behind the > + if (sig == SIGCHLD) sig = 0; > >>>line ? > >> > >>The main reason is backward compatibility. > >>The original FreeBSD code allows only to select between > >>SIGUSR1

Re: [PATCH] Improve LinuxThreads compatibility in rfork()

2011-07-11 Thread Kostik Belousov
On Mon, Jul 11, 2011 at 03:27:56PM +0200, Petr Salinger wrote: > >>This patch made by Petr Salinger improves compatibility with > >>LinuxThreads in rfork() syscall. The Linux clone() implementation > >>allows specifying the signal sent to parent when child terminates > >>(instead of SIGCHLD). > >>

Re: [PATCH] Improve LinuxThreads compatibility in rfork()

2011-07-11 Thread Kostik Belousov
On Mon, Jul 11, 2011 at 12:54:06PM +0200, Robert Millan wrote: > This patch made by Petr Salinger improves compatibility with > LinuxThreads in rfork() syscall. The Linux clone() implementation > allows specifying the signal sent to parent when child terminates > (instead of SIGCHLD). > > As the

Re: [PATCH] PAGE_SIZE in libsbuf

2011-07-03 Thread Kostik Belousov
On Sun, Jul 03, 2011 at 02:07:59PM +0200, Robert Millan wrote: > 2011/7/3 Kostik Belousov : > > I think the different workaround is already included in the latest > > sbuf source. Please see > > http://svnweb.freebsd.org/base/head/sys/kern/subr_sbuf.c?revision=222015&

Re: [PATCH] PAGE_SIZE in libsbuf

2011-07-03 Thread Kostik Belousov
On Sun, Jul 03, 2011 at 01:47:38PM +0200, Robert Millan wrote: > On arm, ia64, powerpc and sparc, Linux doesn't define a static > PAGE_SIZE. It can only be obtained via sysconf(). In addition, > GNU/Hurd doesn't define PAGE_SIZE at all. > > This patch improves portability of libsbuf to be built

Re: FreeBSD I/OAT (QuickData now?) driver

2011-06-06 Thread Kostik Belousov
On Mon, Jun 06, 2011 at 12:47:38PM -0700, Artem Belevich wrote: > Jack, > > Quite a while back you've posted I/OAT driver. Unfortunately the link > you posted does not seem to have the drivers any more. Do you still > have them available somewhere? > > Do you know if Intel has technical info on t

Re: compiling ports with SSP (was: [PATCH] Add -lssp_nonshared to GCC's LIB_SPEC unconditionally)=

2011-06-02 Thread Kostik Belousov
reebsd-hackers/2010-August/032549.html > continued... > http://lists.freebsd.org/pipermail/freebsd-hackers/2010-September/033028.html > continued... > http://lists.freebsd.org/pipermail/freebsd-hackers/2010-November/033478.html > > On Sat, Nov 06, 2010 at 09:47:02PM +0200, Kostik Be

Re: NFS mount inside jail fails

2011-05-18 Thread Kostik Belousov
On Wed, May 18, 2011 at 04:03:26PM +0200, Pawel Jakub Dawidek wrote: > On Tue, May 17, 2011 at 10:17:12PM +0200, Alexander Leidinger wrote: > > On Tue, 17 May 2011 12:56:40 -0700 Sean Bruno > > wrote: > > > > > Silly thing I ran into today. User wanted to NFS mount a dir inside a > > > jail. Af

Re: Fwd: [PATCH v2 3/4] x86, head_32/64.S: Enable SMEP

2011-05-18 Thread Kostik Belousov
On Wed, May 18, 2011 at 10:50:30AM -0400, John Baldwin wrote: > On Wednesday, May 18, 2011 8:31:15 am Oliver Pinter wrote: > > On 5/18/11, Kostik Belousov wrote: > > > On Wed, May 18, 2011 at 02:03:07AM +0200, Oliver Pinter wrote: > > >> -- Forwarded

Re: Fwd: [PATCH v2 3/4] x86, head_32/64.S: Enable SMEP

2011-05-17 Thread Kostik Belousov
On Wed, May 18, 2011 at 02:03:07AM +0200, Oliver Pinter wrote: > -- Forwarded message -- > From: Fenghua Yu > Date: Mon, 16 May 2011 14:34:44 -0700 > Subject: [PATCH v2 3/4] x86, head_32/64.S: Enable SMEP > To: Ingo Molnar , Thomas Gleixner , > H Peter Anvin , Asit K Mallick > , Li

Re: Does FreeBSD have replacement for posix_fadvice() or fcntl(F_RDADVISE)?

2011-05-12 Thread Kostik Belousov
On Thu, May 12, 2011 at 11:38:12AM +0400, Lev Serebryakov wrote: > Hello, Freebsd-hackers. > >Does FreeBSD have some custom call, which can be used where Linux > programs uses posix_fadvice() and DARWIN ones fcntl(F_RDADVISE)? > >It is like madvise(2) but for file descriptors. No, it doe

Re: Runtime check for PAE option on BSD 6+ i386

2011-05-03 Thread Kostik Belousov
On Tue, May 03, 2011 at 11:44:32AM -0400, John Baldwin wrote: > On Tuesday, May 03, 2011 9:10:26 am Philip Soeberg wrote: > > Hi fellow FreeBSD hackers, > > > > I've been using the following poor-man's approach in my driver init for > > ages in an attempt at detecting PAE option on BSD 6 (or grea

Re: Is there some implicit locking of device methods?

2011-04-27 Thread Kostik Belousov
On Thu, Apr 28, 2011 at 12:14:49AM +0200, Bartosz Fabianowski wrote: > Indeed, I may have mixed up terminology. Sorry about that. What I am > doing (or trying to do) is very simple: > > There is a single physical USB device. I have a single device node > representing it. This device can be opene

Re: Is there some implicit locking of device methods?

2011-04-27 Thread Kostik Belousov
On Wed, Apr 27, 2011 at 11:14:36PM +0200, Bartosz Fabianowski wrote: > >If you have some sort of state that needs to get created on first > >open and then removed on last close [...] I would still depend on the > >cdevpriv destructor and use a reference count between open() and the > >destructor to

Re: Is there some implicit locking of device methods?

2011-04-27 Thread Kostik Belousov
On Wed, Apr 27, 2011 at 03:22:43PM +0200, Bartosz Fabianowski wrote: > >Err, if you use cdevpriv you shouldn't even have a d_close method. All > >your > >d_close logic should be in the cdevpriv destructor > > I see. There is no documentation for any of this, so I just implemented > it in the wa

Re: Is there some implicit locking of device methods?

2011-04-26 Thread Kostik Belousov
On Tue, Apr 26, 2011 at 02:38:30PM +0200, Bartosz Fabianowski wrote: > >You need to handle all cases in your driver. Fortunately there exists a > >solution for this already, called USB cdev. See > > I went through all the USB drivers with a fine comb (the driver I am > porting was based on the ol

Re: SMP question w.r.t. reading kernel variables

2011-04-17 Thread Kostik Belousov
On Sun, Apr 17, 2011 at 03:49:48PM -0400, Rick Macklem wrote: > Hi, > > I should know the answer to this, but... When reading a global kernel > variable, where its modifications are protected by a mutex, is it > necessary to get the mutex lock to just read its value? > > For example: > Aif ((

Re: State of FreeBSD/xbox

2011-04-03 Thread Kostik Belousov
On Sun, Apr 03, 2011 at 07:40:14PM +0100, Chris Rees wrote: > Hi all, > > I've got an xbox running at my parents' house as a backup MX, among > other things. > > Ages ago I updated it from 7.2 -> 8.1, and I ended up with no end of > trouble, and finished by restoring a backup. I emailed rink@, al

Re: Prebind from OpenBSD

2011-03-27 Thread Kostik Belousov
On Sun, Mar 27, 2011 at 08:54:18PM +0100, Robert Watson wrote: > On Sat, 26 Mar 2011, Jesse Smith wrote: > > >I'm interested in working on the "Port prebind from OpenBSD" project > >mentioned on the FreeBSD Ideas page. ( > >http://wiki.freebsd.org/IdeasPage#head-d28cdd95ca1755d5afe63d653cb4926d4

Re: [GSoc] Timeconter Performance Improvements

2011-03-26 Thread Kostik Belousov
On Sat, Mar 26, 2011 at 10:12:32AM -0400, John Baldwin wrote: > On Saturday, March 26, 2011 08:16:46 am Peter Jeremy wrote: > > On 2011-Mar-25 08:18:38 -0400, John Baldwin wrote: > > >For modern Intel CPUs you can just assume that the TSCs are in sync across > > >packages. They also have invarian

Re: [GSoc] Timeconter Performance Improvements

2011-03-26 Thread Kostik Belousov
On Sat, Mar 26, 2011 at 11:16:46PM +1100, Peter Jeremy wrote: > On 2011-Mar-25 08:18:38 -0400, John Baldwin wrote: > >For modern Intel CPUs you can just assume that the TSCs are in sync across > >packages. They also have invariant TSC's meaning that the frequency doesn't > >change. > > Synchro

Re: DMA controller on Northbridge?

2011-03-22 Thread Kostik Belousov
On Tue, Mar 22, 2011 at 11:55:59AM -0700, Matthew Fleming wrote: > 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 > >>

Re: GSoC'11: DWARF2 call frame information

2011-03-22 Thread Kostik Belousov
On Tue, Mar 22, 2011 at 11:39:58PM +0800, Xingxing Pan wrote: > 2011/3/22 Kostik Belousov : > > On Mon, Mar 21, 2011 at 08:32:04PM +0300, Chagin Dmitry wrote: > >> On Mon, Mar 21, 2011 at 05:36:13PM +0800, Xingxing Pan wrote: > >> > 2011/3/21 Chagin Dmitr

Re: DMA controller on Northbridge?

2011-03-22 Thread Kostik Belousov
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? > > I ask because I'm working with a PCI card that has a 36-bit physical > address limit, and t

Re: GSoC'11: DWARF2 call frame information

2011-03-21 Thread Kostik Belousov
On Mon, Mar 21, 2011 at 08:32:04PM +0300, Chagin Dmitry wrote: > On Mon, Mar 21, 2011 at 05:36:13PM +0800, Xingxing Pan wrote: > > 2011/3/21 Chagin Dmitry : > > >> powerfull script. > > >> > > >> Xingxing Pan > > > > > > hmm, which script? I think enough amd64, i386 and amd64/ia32. > > > > > > I su

Re: get_cyclecount(9) deprecation

2011-03-18 Thread Kostik Belousov
On Fri, Mar 18, 2011 at 02:09:58PM -0400, Jung-uk Kim wrote: > On Friday 18 March 2011 01:05 pm, Bruce Evans wrote: > > On Sat, 19 Mar 2011, Bruce Evans wrote: > > > On Fri, 18 Mar 2011, Kostik Belousov wrote: > > >> We definitely do not support configurations with d

Re: get_cyclecount(9) deprecation

2011-03-18 Thread Kostik Belousov
On Fri, Mar 18, 2011 at 05:51:27PM +0200, Andriy Gapon wrote: > on 18/03/2011 15:56 Kostik Belousov said the following: > > On Fri, Mar 18, 2011 at 05:26:53PM +1100, Bruce Evans wrote: > > ... > >> - set cputicker() has some design bugs. It assumes that the tick freq

Re: get_cyclecount(9) deprecation

2011-03-18 Thread Kostik Belousov
On Fri, Mar 18, 2011 at 05:26:53PM +1100, Bruce Evans wrote: ... > - set cputicker() has some design bugs. It assumes that the tick frequency > is the same across all CPUs, but the TSC is per-CPU. I have an old SMP > system with CPUs of different frequency that can demonstrate bugs from > t

Re: usertime and systime

2011-03-16 Thread Kostik Belousov
On Wed, Mar 16, 2011 at 12:56:14PM -0500, Dan Nelson wrote: > In the last episode (Mar 16), Thiago Damas said: > > Hi, > > without procfs, there is a way to get usertime and systime from a > > running process? > > Try applying the attached patch to ps. I've had it for a while but never > subm

Re: SIGSTOP and SIGKILL

2011-03-14 Thread Kostik Belousov
On Sun, Mar 13, 2011 at 11:30:00PM -0700, Ravi Murty wrote: > I haven't, are there specific improvements in this area of the kernel? First, the 8.2, compared to 8.0, changed the mechanism of delivering the process-global signal to a thread. Now, the thread to deliver is selected at the moment of de

Re: libdispatch don't build on 8.2-RELEASE amd64

2011-03-02 Thread Kostik Belousov
On Wed, Mar 02, 2011 at 12:19:01PM -0300, Danilo Egea wrote: > The problem is the binutils version, the port try to use the > binutils-2.21. With the binutils-2.15 (native of the system) works fine. Rather, it is binutils 2.15 silently creating broken library. 2.21 refuses to do it. Some object u

Re: buildkernel error

2011-02-23 Thread Kostik Belousov
On Wed, Feb 23, 2011 at 02:24:05PM +0900, mmats...@cybernet.co.jp wrote: > From: Garrett Cooper > Date: Tue, 22 Feb 2011 21:04:24 -0800 > ::On Tue, Feb 22, 2011 at 7:54 PM, wrote: > ::> From: Dimitry Andric > ::> Date: Tue, 22 Feb 2011 13:39:31 +0100 > ::> ::On 2011-02-22 08:30, gnehzuil wrote:

Re: svn commit: r218953 - stable/8/usr.sbin/sysinstall

2011-02-22 Thread Kostik Belousov
On Tue, Feb 22, 2011 at 01:06:38PM -0500, Ben Kaduk wrote: > [replying to the MFC that triggered the connection] > > On Tue, Feb 22, 2011 at 12:38 PM, Bruce Cran wrote: > > Author: brucec > > Date: Tue Feb 22 17:38:43 2011 > > New Revision: 218953 > > URL: http://svn.freebsd.org/changeset/base/21

Re: FreeBSD ABI?

2011-02-22 Thread Kostik Belousov
On Mon, Feb 21, 2011 at 03:58:32PM -0800, Yuri wrote: > On 02/21/2011 15:38, Joerg Sonnenberger wrote: > >That's a major difference. The Linux people decided a while ago that > >stack alignment should be 16 Byte. GCC effectively forces that down > >everyone's throat because until at least GCC 4.2 o

Re: Can vm_mmap()/vm_map_remove() be called with giant held? (linuxolator dvb patches)

2011-02-19 Thread Kostik Belousov
d) > > http://people.freebsd.org/~nox/dvb/linux-dvb-8.patch > > (for 8.) > > On Sun, Jan 30, 2011 at 12:54:48AM +0100, Juergen Lock wrote: > > On Sat, Jan 29, 2011 at 10:51:05PM +0200, Kostik Belousov wrote: > > > On Sat, Jan 29, 2011 at 09:10:00PM +0100, Juergen Lo

Re: spontaneous reboot - ptrace

2011-02-18 Thread Kostik Belousov
On Fri, Feb 18, 2011 at 03:58:05AM -0800, Dr. Baud wrote: > > > > First, do you have a console output during the run ? Is it possible > > that machine paniced ? If not, were there any kernel messages before> > > reboot ? > > > > Second, what is the process you are dumping ? Can you show at least

Re: sched_setscheduler() behaviour changed??

2011-02-18 Thread Kostik Belousov
On Thu, Feb 17, 2011 at 10:50:06AM +0100, Mats Lindberg wrote: > All, > I have been using a small program /rt) that utilize the sched_setscheduler() > syscall to set the scheduling policy of a process to SCHED_RR. Been running > it FBSD 5.x and 6.x. Now when migrating to FBSD 8.1 I get EPERM back a

Re: spontaneous reboot - ptrace

2011-02-15 Thread Kostik Belousov
On Tue, Feb 15, 2011 at 09:46:05AM -0800, Dr. Baud wrote: > I've an interesting anomaly I'd appreciate some help with. > > As a result of looking at a threading problem I modified gcore > to dump all memory segments associated with a process; > basically comment out the "Ignore" conditional i

Re: ptrace weirdness with 9.0-CURRENT

2011-02-08 Thread Kostik Belousov
On Wed, Feb 09, 2011 at 01:49:52AM +0200, Kostik Belousov wrote: > On Wed, Feb 09, 2011 at 12:42:15AM +0200, Ali Polatel wrote: > > Hello everyone, > > > > I'm the developer of pinktrace - http://dev.exherbo.org/~alip/pinktrace/ > > - a simple ptrace() wrapper

Re: ptrace weirdness with 9.0-CURRENT

2011-02-08 Thread Kostik Belousov
On Wed, Feb 09, 2011 at 12:42:15AM +0200, Ali Polatel wrote: > Hello everyone, > > I'm the developer of pinktrace - http://dev.exherbo.org/~alip/pinktrace/ > - a simple ptrace() wrapper library for FreeBSD and Linux. I have set up > a FreeBSD-9.0-CURRENT VM today to test various new features recen

Re: Can vm_mmap()/vm_map_remove() be called with giant held? (linuxolator dvb patches)

2011-01-30 Thread Kostik Belousov
On Sun, Jan 30, 2011 at 12:54:48AM +0100, Juergen Lock wrote: > On Sat, Jan 29, 2011 at 10:51:05PM +0200, Kostik Belousov wrote: > > On Sat, Jan 29, 2011 at 09:10:00PM +0100, Juergen Lock wrote: > > > Hi! > > > > > > I was kinda hoping to be able t

Re: Can vm_mmap()/vm_map_remove() be called with giant held? (linuxolator dvb patches)

2011-01-29 Thread Kostik Belousov
On Sat, Jan 29, 2011 at 09:10:00PM +0100, Juergen Lock wrote: > Hi! > > I was kinda hoping to be able to post a correct patch in public but > getting an answer to ${Subject} seems to be more difficult than I > thought... :) So, does anyone here know? copyout_map() and You do not need Giant lock

Re: rtld optimizations

2011-01-27 Thread Kostik Belousov
On Thu, Jan 27, 2011 at 09:12:34PM +, Devin Teske wrote: > On Thu, 2011-01-27 at 22:59 +0200, Kostik Belousov wrote: > > > On Thu, Jan 27, 2011 at 08:50:48PM +, Devin Teske wrote: > > > Probably did something like this: > > > > > > ti

Re: rtld optimizations

2011-01-27 Thread Kostik Belousov
On Thu, Jan 27, 2011 at 08:50:48PM +, Devin Teske wrote: > On Thu, 2011-01-27 at 22:31 +0200, Kostik Belousov wrote: > > > On Thu, Jan 27, 2011 at 12:37:54PM -0500, Mark Saad wrote: > > > On Thu, Jan 27, 2011 at 6:05 AM, David Naylor > > > wrote: > > &g

Re: rtld optimizations

2011-01-27 Thread Kostik Belousov
On Thu, Jan 27, 2011 at 12:37:54PM -0500, Mark Saad wrote: > On Thu, Jan 27, 2011 at 6:05 AM, David Naylor > wrote: > > On Wednesday 26 January 2011 06:49:11 Alexander Kabaev wrote: > >> On Tue, 25 Jan 2011 21:40:42 -0500 > >> > >> Mark Saad wrote: > >> > Hello Hackers > >> > > >> > The NetBSD f

Re: rc.d/jail issues

2011-01-27 Thread Kostik Belousov
On Thu, Jan 27, 2011 at 10:37:22AM -0700, Jamie Gritton wrote: > It's in the the subversion tree, under projects/jailconf. > > I've got the dependency stuff there (actually turns out to be a large > chunk of the code). I've got it doing almost everything that rc.d/jail > does now, though it doesn'

Re: [rfc] allow to boot with >= 256GB physmem

2011-01-21 Thread Kostik Belousov
On Fri, Jan 21, 2011 at 12:44:13PM -0500, John Baldwin wrote: > On Friday, January 21, 2011 11:09:10 am Sergey Kandaurov wrote: > > Hello. > > > > Some time ago I faced with a problem booting with 400GB physmem. > > The problem is that vm.max_proc_mmap type overflows with > > such high value, and

Re: Android development (was Re: best way to run -RELEASE and -CURRENT on the same machine)

2011-01-16 Thread Kostik Belousov
On Sun, Jan 16, 2011 at 09:19:22AM -0500, Aryeh Friedman wrote: > Are you talking about BSDoid or FreeDroid? I got SDK from http://bsdroid.org. No idea what FreeDroid is. > > On Sun, Jan 16, 2011 at 8:17 AM, Kostik Belousov wrote: > > On Sun, Jan 16, 2011 at 01:58:26PM +01

Re: Android development (was Re: best way to run -RELEASE and -CURRENT on the same machine)

2011-01-16 Thread Kostik Belousov
On Sun, Jan 16, 2011 at 01:58:26PM +0100, Hans Petter Selasky wrote: > On Sunday 16 January 2011 13:30:33 Aryeh Friedman wrote: > > On Sun, Jan 16, 2011 at 7:27 AM, Hans Petter Selasky > wrote: > > > On Sunday 16 January 2011 13:20:39 Aryeh Friedman wrote: > > >> On Sun, Jan 16, 2011 at 7:07 AM,

Re: What does the FreeBSD/i386 ABI say about stack alignment?

2011-01-14 Thread Kostik Belousov
On Thu, Jan 13, 2011 at 04:34:22PM -0700, Warner Losh wrote: > On 01/13/2011 13:28, Kostik Belousov wrote: > >On Thu, Jan 13, 2011 at 12:19:00PM -0500, Ryan Stone wrote: > >>I've been trying to get an application compiled with gcc 4.5.1 running > >>on FreeBSD 8.

Re: What does the FreeBSD/i386 ABI say about stack alignment?

2011-01-13 Thread Kostik Belousov
On Thu, Jan 13, 2011 at 10:57:15PM +0100, Joerg Sonnenberger wrote: > On Thu, Jan 13, 2011 at 12:19:00PM -0500, Ryan Stone wrote: > > I've been trying to get an application compiled with gcc 4.5.1 running > > on FreeBSD 8.1, but it's been crashing during startup with a SIGBUS. > > It turns out that

Re: What does the FreeBSD/i386 ABI say about stack alignment?

2011-01-13 Thread Kostik Belousov
On Thu, Jan 13, 2011 at 12:19:00PM -0500, Ryan Stone wrote: > I've been trying to get an application compiled with gcc 4.5.1 running > on FreeBSD 8.1, but it's been crashing during startup with a SIGBUS. > It turns out that the problem is that gcc is issuing SSE > instructions(in my case, a movdqa)

  1   2   3   4   >