From owner-freebsd-hackers@FreeBSD.ORG Fri Apr 13 18:37:52 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 354BF106566B for ; Fri, 13 Apr 2012 18:37:52 +0000 (UTC) (envelope-from sushanth_rai@yahoo.com) Received: from nm10.bullet.mail.sp2.yahoo.com (nm10.bullet.mail.sp2.yahoo.com [98.139.91.80]) by mx1.freebsd.org (Postfix) with SMTP id 07B708FC1D for ; Fri, 13 Apr 2012 18:37:52 +0000 (UTC) Received: from [98.139.91.62] by nm10.bullet.mail.sp2.yahoo.com with NNFMP; 13 Apr 2012 18:37:45 -0000 Received: from [98.139.44.84] by tm2.bullet.mail.sp2.yahoo.com with NNFMP; 13 Apr 2012 18:37:45 -0000 Received: from [127.0.0.1] by omp1021.access.mail.sp2.yahoo.com with NNFMP; 13 Apr 2012 18:37:45 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 236562.93441.bm@omp1021.access.mail.sp2.yahoo.com Received: (qmail 30481 invoked by uid 60001); 13 Apr 2012 18:37:44 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1334342264; bh=900KiBa/0asXU5HSU8h1mybPVHluuIebD0cGo4Lrs70=; h=X-YMail-OSG:Received:X-Mailer:Message-ID:Date:From:Subject:To:Cc:MIME-Version:Content-Type; b=J3qbR6+EN/lOAj+sTvyybsJTb01ayRFK7qZr545HnAU0FwYVvmIDrU4AD5bmOox+AtZyxfbHKyX+UgXZ54ysZu8wxe9qc2U9wl/s+VZG/nGS6IosJEtRrbWMTeRzp1EtrQSJUmz1E3V1asB0mtvCAV9rxaVoaZPE3SO6BDU8Mrg= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Mailer:Message-ID:Date:From:Subject:To:Cc:MIME-Version:Content-Type; b=0/LMeaRYROmRE0oq1dDjHCYB6RH2vgX1yLR1iIrO6h7lQbhuSKxACy4L5Of9d6LnZf1gCG+J2ukU2uGzFWNmwaN0kAPDOtatP7WWzNjggAxocwz3lHXMOJMRdYAkZ4VeXWdUaZUlPCnb+a9po97kcyLJjMDnreou12VWPovgcTk=; X-YMail-OSG: pOnjQxcVM1klbKFfXCl_c4dIvHTOkru327gLIu.gwyH1C3d Fo2_wJlj4YKokTRVYbGU7Q2vBOMWOV__zUlgUgLldFbauZZg6kVZy4tnJTBa Axrhcz9eUlLvX9ejTE5AOl76Jw6dOqpwf0QQagRyaWmegDa3NMbW0FFGwEmT RkDkpchaFBIGKqQTW5YD7TfoHpJp6d2ZFINKTIapG4n.JAxr6qshVvAQNAuR 9kXS8_LRN2By_V60ZGiWM75d7UmWCKTJO_w.FRvi0bg0flTAYW3Ny0c.TUtt QQZttDKpiILdthEz7C7E4zSxZuOnLDbFo9mKiFbWI9vkDsxji3D6sx4_jXm6 Usk0G7onUc8MFfi1NLxIGbPzUYpPsVF7l9d8wBEqC82ZC3YQG_N2f46rNOtq zVW_00pjmhMI.qRCsRsTaH26m5hoeboFqW4LdMLDTYyvKhoh3vQyiTI2JLkg C4ACbRZ8- Received: from [209.119.38.67] by web180006.mail.gq1.yahoo.com via HTTP; Fri, 13 Apr 2012 11:37:44 PDT X-Mailer: YahooMailClassic/15.0.5 YahooMailWebService/0.8.117.340979 Message-ID: <1334342264.8672.YahooMailClassic@web180006.mail.gq1.yahoo.com> Date: Fri, 13 Apr 2012 11:37:44 -0700 (PDT) From: Sushanth Rai To: Konstantin Belousov MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="-729476438-1186198209-1334342264=:8672" X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-hackers@freebsd.org Subject: Re: mlockall() on freebsd 7.2 + amd64 returns EAGAIN X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2012 18:37:52 -0000 ---729476438-1186198209-1334342264=:8672 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable I've attached the simple program that creates 5 threads. Following is the o= /p of /proc//map when this program is running. Note that I modified = =0Asys/fs/procfs/procfs_map.c to print whether a region is wired. As you ca= n see from this o/p, none of stack areas get wired. =0A=0A0x400000 0x401000= 1 0 0xffffff002d943bd0 r-x 1 0 0x1000 COW NC wired vnode /var/tmp/thread1= =0A0x500000 0x501000 1 0 0xffffff002dd13e58 rw- 2 0 0x3100 NCOW NNC wired d= efault -=0A0x501000 0x600000 255 0 0xffffff002dd13e58 rwx 2 0 0x3100 NCOW N= NC wired default -=0A0x800500000 0x800526000 38 0 0xffffff0025574000 r-x 19= 2 46 0x1004 COW NC wired vnode /libexec/ld-elf.so.1=0A0x800526000 0x8005370= 00 17 0 0xffffff002d9f81b0 rw- 1 0 0x3100 NCOW NNC wired default -=0A0x8006= 26000 0x80062d000 7 0 0xffffff002dd13bd0 rw- 1 0 0x3100 COW NNC wired vnode= /libexec/ld-elf.so.1=0A0x80062d000 0x800633000 6 0 0xffffff002dd145e8 rw- = 1 0 0x3100 NCOW NNC wired default -=0A0x800633000 0x800645000 18 0 0xffffff= 00256d71b0 r-x 63 42 0x4 COW NC wired vnode /lib/libthr.so.3=0A0x800645000 = 0x800646000 1 0 0xffffff002d975510 r-x 1 0 0x3100 COW NNC wired vnode /lib/= libthr.so.3=0A0x800646000 0x800746000 0 0 0xffffff002dc5cca8 --- 4 0 0x3100= NCOW NNC not-wired default -=0A0x800746000 0x80074a000 4 0 0xffffff002572a= 288 rw- 1 0 0x3100 COW NNC wired vnode /lib/libthr.so.3=0A0x80074a000 0x800= 74c000 2 0 0xffffff002dc5cca8 rw- 4 0 0x3100 NCOW NNC wired default -=0A0x8= 0074c000 0x80083e000 242 0 0xffffff001cd226c0 r-x 238 92 0x1004 COW NC wire= d vnode /lib/libc.so.7=0A0x80083e000 0x80083f000 1 0 0xffffff002dd12000 r-x= 1 0 0x3100 COW NNC wired vnode /lib/libc.so.7=0A0x80083f000 0x80093e000 0 = 0 0xffffff002dc5cca8 --- 4 0 0x3100 NCOW NNC not-wired default -=0A0x80093e= 000 0x80095d000 31 0 0xffffff002dddc360 rw- 1 0 0x3100 COW NNC wired vnode = /lib/libc.so.7=0A0x80095d000 0x800974000 23 0 0xffffff002dc5cca8 rw- 4 0 0x= 3100 NCOW NNC wired default -=0A0x800a00000 0x800b00000 256 0 0xffffff002db= d1798 rw- 1 0 0x3100 NCOW NNC wired default -=0A0x800b00000 0x800c00000 256= 0 0xffffff002dd14948 rw- 1 0 0x3100 NCOW NNC wired default -=0A0x7fffff3db= 000 0x7fffff3fb000 1 0 0xffffff002dbb4360 rw- 1 0 0x3100 NCOW NNC not-wired= default -=0A0x7fffff5dc000 0x7fffff5fc000 1 0 0xffffff002dc66af8 rw- 1 0 0= x3100 NCOW NNC not-wired default -=0A0x7fffff7dd000 0x7fffff7fd000 1 0 0xff= ffff002dbea438 rw- 1 0 0x3100 NCOW NNC not-wired default -=0A0x7fffff9de000= 0x7fffff9fe000 1 0 0xffffff002dd7fd80 rw- 1 0 0x3100 NCOW NNC not-wired de= fault -=0A0x7fffffbdf000 0x7fffffbff000 1 0 0xffffff002dbe9438 rw- 1 0 0x31= 00 NCOW NNC not-wired default -=0A0x7fffffbff000 0x7fffffc00000 0 0 0 --- 0= 0 0x0 NCOW NNC not-wired none -=0A0x7ffffffe0000 0x800000000000 32 0 0xfff= fff002dd125e8 rwx 1 0 0x3100 NCOW NNC wired default -=0A=0A--- On Fri, 4/13= /12, Konstantin Belousov wrote:=0A=0A> From: Konstant= in Belousov =0A> Subject: Re: mlockall() on freebsd 7.= 2 + amd64 returns EAGAIN=0A> To: "Sushanth Rai" =0A= > Cc: freebsd-hackers@freebsd.org=0A> Date: Friday, April 13, 2012, 1:11 AM= =0A> On Thu, Apr 12, 2012 at 08:10:26PM=0A> -0700, Sushanth Rai wrote:=0A> = > > =0A> > > Then it should be fixed in r190885.=0A> > > =0A> > =0A> > Than= ks. That works like a charm. =0A> > =0A> > mlockall() mostly works now. The= re is still a, issue in=0A> wiring the stacks of multithreaded program when= the program=0A> uses default stack allocation scheme. Thread library=0A> a= llocates stack for each thread by calling mmap() and=0A> sending address an= d size to be mapped. The kernel adjusts=0A> the start address to sgrowsz in= =A0 vm_map_stack() and=0A> maps at the adjusted address. But the subsequent= wiring is=0A> done using the original address, which fails. =0A> > =0A> Ca= n you, please provide stand-alone example which=0A> demostrates the issue ?= =0A> I suspect this should have not changed in HEAD.=0A> ---729476438-1186198209-1334342264=:8672--