From owner-svn-src-head@FreeBSD.ORG Sun Sep 12 00:03:39 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6349D1065673; Sun, 12 Sep 2010 00:03:39 +0000 (UTC) (envelope-from mdf356@gmail.com) Received: from mail-iw0-f182.google.com (mail-iw0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 006D58FC14; Sun, 12 Sep 2010 00:03:38 +0000 (UTC) Received: by iwn34 with SMTP id 34so4220222iwn.13 for ; Sat, 11 Sep 2010 17:03:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=52d1vFD9fzD/SQZwI1jKka+ezOwVmF3lD+RIJcOcXio=; b=IwPi1wk+Ow4Mwtdr9Rf2fYIO+HwLGATMZDwNbK/2DQB46L+5ERNuwYL7z2wuhweMFh v9WTdEVEr5sStA+K81XBZxRwfUC59k+QtnjhJak7L1nU4YeUVqM1RPc1qC2Kizhb+6pC wMXRIb6KUHiuzxDLmlKIkp7CHQqeBIUAsv8VU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=a5TnQaWflSl0IpVpvbuIze8jQQzkiWyPk5h/MeUwH08ve3idj8DFPWg9EPMUXYJu+k 0N1foN/umKrsb4zYnjYOq091I5p41KPnS0l9mEyYfFzI6ADArDza+Sgz/8iEHWYrPjR3 S8gkzzRxBhfe23hb/7U+f4NlW/TEK3q1OcAgU= MIME-Version: 1.0 Received: by 10.231.58.201 with SMTP id i9mr3502674ibh.98.1284249818139; Sat, 11 Sep 2010 17:03:38 -0700 (PDT) Sender: mdf356@gmail.com Received: by 10.231.130.34 with HTTP; Sat, 11 Sep 2010 17:03:38 -0700 (PDT) In-Reply-To: <201009111942.o8BJgocS032974@svn.freebsd.org> References: <201009111942.o8BJgocS032974@svn.freebsd.org> Date: Sun, 12 Sep 2010 00:03:38 +0000 X-Google-Sender-Auth: POnPdDsVBz7nimoS8vLO1etMwwY Message-ID: From: mdf@FreeBSD.org To: Alexander Kabaev Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r212478 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Sep 2010 00:03:39 -0000 On Sat, Sep 11, 2010 at 7:42 PM, Alexander Kabaev wrote: > Author: kan > Date: Sat Sep 11 19:42:50 2010 > New Revision: 212478 > URL: http://svn.freebsd.org/changeset/base/212478 > > Log: > =A0Add missing pointer increment to sbuf_cat. > > Modified: > =A0head/sys/kern/subr_sbuf.c > > Modified: head/sys/kern/subr_sbuf.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/kern/subr_sbuf.c =A0 Sat Sep 11 18:55:00 2010 =A0 =A0 =A0 = =A0(r212477) > +++ head/sys/kern/subr_sbuf.c =A0 Sat Sep 11 19:42:50 2010 =A0 =A0 =A0 = =A0(r212478) > @@ -441,7 +441,7 @@ sbuf_cat(struct sbuf *s, const char *str > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return (-1); > > =A0 =A0 =A0 =A0while (*str !=3D '\0') { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 sbuf_put_byte(*str, s); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 sbuf_put_byte(*str++, s); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (s->s_error !=3D 0) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return (-1); > =A0 =A0 =A0 =A0} D'oh! Yeah, this looks right. I guess the sbuf functions that ran when I tested didn't use sbuf_cat. Sorry, matthew From owner-svn-src-head@FreeBSD.ORG Sun Sep 12 00:41:25 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 466EA106566B; Sun, 12 Sep 2010 00:41:25 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from esa-jnhn.mail.uoguelph.ca (esa-jnhn.mail.uoguelph.ca [131.104.91.44]) by mx1.freebsd.org (Postfix) with ESMTP id ACF0D8FC08; Sun, 12 Sep 2010 00:41:24 +0000 (UTC) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApwEALe+i0yDaFvO/2dsb2JhbACDGJ8hrRqRBoEigyd0BIog X-IronPort-AV: E=Sophos;i="4.56,353,1280721600"; d="scan'208";a="93571162" Received: from erie.cs.uoguelph.ca (HELO zcs3.mail.uoguelph.ca) ([131.104.91.206]) by esa-jnhn-pri.mail.uoguelph.ca with ESMTP; 11 Sep 2010 20:41:22 -0400 Received: from zcs3.mail.uoguelph.ca (localhost.localdomain [127.0.0.1]) by zcs3.mail.uoguelph.ca (Postfix) with ESMTP id 9F181B3EA8; Sat, 11 Sep 2010 20:41:22 -0400 (EDT) Date: Sat, 11 Sep 2010 20:41:22 -0400 (EDT) From: Rick Macklem To: Kostik Belousov Message-ID: <1300087421.776986.1284252082593.JavaMail.root@erie.cs.uoguelph.ca> In-Reply-To: <20100911060111.GT2465@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [24.65.230.102] X-Mailer: Zimbra 6.0.7_GA_2476.RHEL4 (ZimbraWebClient - SAF3 (Mac)/6.0.7_GA_2473.RHEL4_64) Cc: svn-src-head@freebsd.org, Rick Macklem , svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r212439 - head/sys/fs/nfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Sep 2010 00:41:25 -0000 > Then, fid_reserved is no more reserved ? Should we rename it ? > > Comment for fid_reserved about longword alignment is wrong. Well, it's actually more broken than that. fid_len - Most file systems set it to the size of their variant of the entire structure, including the Xfid_len field. ZFS sets it to the size of the structure - sizeof(uint16_t) { presumably subtracting out the size if Xfid_len? }. And xfs, well, it does weird stuff with it I can't figure out, but it is definitely not the size of the entire struct. As such, exposing fid_len above the VOP_xxx() doesn't make much sense. (After my commit yesterday, nothing above the VOP_VPTOFH() uses it.) Personally, I'd lean towards a generic struct fid like... struct fid { uint8_t fid_data[MAXFIDSZ]; }; with MAXFIDSZ increased appropriately, but this will require changes to xfs and zfs, since they both set the generic fid_len. If you go with... struct fid { uint16_t fid_len; uint8_t fid_data[MAXFIDSZ]; }; then the hash functions in the two NFS servers need to be changed (they assume 32bit alignment of fid_data), but they should be fixed anyhow, since they mostly hash to 0 for ZFS at this time. (From what I see ZFS file handles looking like.) Or, you could just rename fid_reserved to fid_pad and not worry about it. Maybe the ZFS folks could decide what they would prefer? rick From owner-svn-src-head@FreeBSD.ORG Sun Sep 12 03:04:25 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1D43B106564A; Sun, 12 Sep 2010 03:04:24 +0000 (UTC) (envelope-from mdf356@gmail.com) Received: from mail-iw0-f182.google.com (mail-iw0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id A9C5C8FC12; Sun, 12 Sep 2010 03:04:23 +0000 (UTC) Received: by iwn34 with SMTP id 34so4333155iwn.13 for ; Sat, 11 Sep 2010 20:04:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=CFLTq4cyofDKMZYgo8WYoidVABqWc6Jnp2TaakudrcA=; b=nLBI/eh6YAn3zBD/jUy1y4bDM5YXueKCmxYgeQSTXa9v0R2+NJzPZjQ5FVj5VuRQK5 ukmEY/BaqnBlO6uEgthXj8lgcZIT6YdlSRRRPC4Ul5TEkoQy+ZnOnLPoiDBXlTFV3HJJ UucuV4eyk4oZHRt3m0pxjLKJBySqdWFp1Upd4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=Owe4i4UvSapdSmvulpOlubH1OsuUwq+l+wmXwG84+8o8X5m/BrrjcIXQ8nUbHCXeN/ eXe1U8KDfvkIPhSZWOIUeOLHKU996qto7vZOFBRN9upkrtPgtCKhm07j0xVQceV/cVYg Y9s7EJEpvaoITTazvZ359yOCMgnWgI9AZyg+s= MIME-Version: 1.0 Received: by 10.231.162.2 with SMTP id t2mr3748164ibx.57.1284260662922; Sat, 11 Sep 2010 20:04:22 -0700 (PDT) Sender: mdf356@gmail.com Received: by 10.231.130.34 with HTTP; Sat, 11 Sep 2010 20:04:22 -0700 (PDT) In-Reply-To: <1300087421.776986.1284252082593.JavaMail.root@erie.cs.uoguelph.ca> References: <20100911060111.GT2465@deviant.kiev.zoral.com.ua> <1300087421.776986.1284252082593.JavaMail.root@erie.cs.uoguelph.ca> Date: Sun, 12 Sep 2010 03:04:22 +0000 X-Google-Sender-Auth: smkW1GnVZf6nUs70Q7PEyZJT9r4 Message-ID: From: mdf@FreeBSD.org To: Rick Macklem Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Kostik Belousov , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Rick Macklem Subject: Re: svn commit: r212439 - head/sys/fs/nfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Sep 2010 03:04:25 -0000 On Sun, Sep 12, 2010 at 12:41 AM, Rick Macklem wrote= : >> Then, fid_reserved is no more reserved ? Should we rename it ? >> >> Comment for fid_reserved about longword alignment is wrong. > > Well, it's actually more broken than that. > fid_len - Most file systems set it to the size of their variant > =A0 =A0 =A0 =A0 =A0of the entire structure, including the Xfid_len field. > =A0 =A0 =A0 =A0 =A0ZFS sets it to the size of the structure - sizeof(uint= 16_t) > =A0 =A0 =A0 =A0 =A0{ presumably subtracting out the size if Xfid_len? }. > =A0 =A0 =A0 =A0 =A0And xfs, well, it does weird stuff with it I can't fig= ure > =A0 =A0 =A0 =A0 =A0out, but it is definitely not the size of the entire s= truct. > > As such, exposing fid_len above the VOP_xxx() doesn't make much sense. > (After my commit yesterday, nothing above the VOP_VPTOFH() uses it.) > > Personally, I'd lean towards a generic struct fid like... > struct fid { > =A0 =A0 =A0 uint8_t fid_data[MAXFIDSZ]; > }; Isilon would love a generic struct like this, as to fit our filesystem we had to make such a change locally anyways. :-) Cheers, matthew > with MAXFIDSZ increased appropriately, but this will require changes > to xfs and zfs, since they both set the generic fid_len. > > If you go with... > struct fid { > =A0 =A0 =A0 uint16_t fid_len; > =A0 =A0 =A0 uint8_t fid_data[MAXFIDSZ]; > }; > then the hash functions in the two NFS servers need to be changed > (they assume 32bit alignment of fid_data), but they should be fixed > anyhow, since they mostly hash to 0 for ZFS at this time. (From what > I see ZFS file handles looking like.) > > Or, you could just rename fid_reserved to fid_pad and not worry about it. > > Maybe the ZFS folks could decide what they would prefer? rick > From owner-svn-src-head@FreeBSD.ORG Sun Sep 12 11:11:53 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 922A91065672; Sun, 12 Sep 2010 11:11:53 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 810B68FC13; Sun, 12 Sep 2010 11:11:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8CBBrpw025915; Sun, 12 Sep 2010 11:11:53 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8CBBrW0025912; Sun, 12 Sep 2010 11:11:53 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201009121111.o8CBBrW0025912@svn.freebsd.org> From: Alexander Motin Date: Sun, 12 Sep 2010 11:11:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212491 - head/sys/dev/acpica X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Sep 2010 11:11:53 -0000 Author: mav Date: Sun Sep 12 11:11:53 2010 New Revision: 212491 URL: http://svn.freebsd.org/changeset/base/212491 Log: Instead of storing last event timestamp, store the next event timestamp. It corrects handling of the first event offset in emulated periodic mode. Modified: head/sys/dev/acpica/acpi_hpet.c Modified: head/sys/dev/acpica/acpi_hpet.c ============================================================================== --- head/sys/dev/acpica/acpi_hpet.c Sun Sep 12 06:19:35 2010 (r212490) +++ head/sys/dev/acpica/acpi_hpet.c Sun Sep 12 11:11:53 2010 (r212491) @@ -98,7 +98,7 @@ struct hpet_softc { uint32_t caps; uint32_t vectors; uint32_t div; - uint32_t last; + uint32_t next; char name[8]; } t[32]; int num_timers; @@ -149,7 +149,7 @@ hpet_start(struct eventtimer *et, struct hpet_timer *mt = (struct hpet_timer *)et->et_priv; struct hpet_timer *t; struct hpet_softc *sc = mt->sc; - uint32_t fdiv, cmp; + uint32_t fdiv, now; t = (mt->pcpu_master < 0) ? mt : &sc->t[mt->pcpu_slaves[curcpu]]; if (period != NULL) { @@ -170,24 +170,28 @@ hpet_start(struct eventtimer *et, if (t->irq < 0) bus_write_4(sc->mem_res, HPET_ISR, 1 << t->num); t->caps |= HPET_TCNF_INT_ENB; - t->last = bus_read_4(sc->mem_res, HPET_MAIN_COUNTER); + now = bus_read_4(sc->mem_res, HPET_MAIN_COUNTER); restart: - cmp = t->last + fdiv; + t->next = now + fdiv; if (t->mode == 1 && (t->caps & HPET_TCAP_PER_INT)) { t->caps |= HPET_TCNF_TYPE; bus_write_4(sc->mem_res, HPET_TIMER_CAP_CNF(t->num), t->caps | HPET_TCNF_VAL_SET); - bus_write_4(sc->mem_res, HPET_TIMER_COMPARATOR(t->num), cmp); - bus_write_4(sc->mem_res, HPET_TIMER_COMPARATOR(t->num), t->div); + bus_write_4(sc->mem_res, HPET_TIMER_COMPARATOR(t->num), + t->next); + bus_write_4(sc->mem_res, HPET_TIMER_COMPARATOR(t->num), + t->div); } else { t->caps &= ~HPET_TCNF_TYPE; - bus_write_4(sc->mem_res, HPET_TIMER_CAP_CNF(t->num), t->caps); - bus_write_4(sc->mem_res, HPET_TIMER_COMPARATOR(t->num), cmp); + bus_write_4(sc->mem_res, HPET_TIMER_CAP_CNF(t->num), + t->caps); + bus_write_4(sc->mem_res, HPET_TIMER_COMPARATOR(t->num), + t->next); } if (fdiv < 5000) { bus_read_4(sc->mem_res, HPET_TIMER_COMPARATOR(t->num)); - t->last = bus_read_4(sc->mem_res, HPET_MAIN_COUNTER); - if ((int32_t)(t->last - cmp) >= 0) { + now = bus_read_4(sc->mem_res, HPET_MAIN_COUNTER); + if ((int32_t)(now - t->next) >= 0) { fdiv *= 2; goto restart; } @@ -217,6 +221,8 @@ hpet_intr_single(void *arg) struct hpet_softc *sc = t->sc; uint32_t now; + if (t->mode == 0) + return (FILTER_STRAY); /* Check that per-CPU timer interrupt reached right CPU. */ if (t->pcpu_cpu >= 0 && t->pcpu_cpu != curcpu) { if ((++t->pcpu_misrouted) % 32 == 0) { @@ -231,20 +237,21 @@ hpet_intr_single(void *arg) */ if ((t->mode == 1 && (t->caps & HPET_TCAP_PER_INT) == 0) || t->mode == 2) { - t->last = bus_read_4(sc->mem_res, HPET_MAIN_COUNTER); + t->next = bus_read_4(sc->mem_res, HPET_MAIN_COUNTER) + + sc->freq / 8; bus_write_4(sc->mem_res, HPET_TIMER_COMPARATOR(t->num), - t->last + sc->freq / 8); + t->next); } return (FILTER_HANDLED); } if (t->mode == 1 && (t->caps & HPET_TCAP_PER_INT) == 0) { - t->last += t->div; + t->next += t->div; now = bus_read_4(sc->mem_res, HPET_MAIN_COUNTER); - if ((int32_t)(now - (t->last + t->div / 2)) > 0) - t->last = now - t->div / 2; + if ((int32_t)((now + t->div / 2) - t->next) > 0) + t->next = now + t->div / 2; bus_write_4(sc->mem_res, - HPET_TIMER_COMPARATOR(t->num), t->last + t->div); + HPET_TIMER_COMPARATOR(t->num), t->next); } else if (t->mode == 2) t->mode = 0; mt = (t->pcpu_master < 0) ? t : &sc->t[t->pcpu_master]; @@ -713,19 +720,21 @@ hpet_resume(device_t dev) #endif if (t->mode == 0) continue; - t->last = bus_read_4(sc->mem_res, HPET_MAIN_COUNTER); + t->next = bus_read_4(sc->mem_res, HPET_MAIN_COUNTER); if (t->mode == 1 && (t->caps & HPET_TCAP_PER_INT)) { t->caps |= HPET_TCNF_TYPE; + t->next += t->div; bus_write_4(sc->mem_res, HPET_TIMER_CAP_CNF(t->num), t->caps | HPET_TCNF_VAL_SET); bus_write_4(sc->mem_res, HPET_TIMER_COMPARATOR(t->num), - t->last + t->div); + t->next); bus_read_4(sc->mem_res, HPET_TIMER_COMPARATOR(t->num)); bus_write_4(sc->mem_res, HPET_TIMER_COMPARATOR(t->num), t->div); } else { + t->next += sc->freq / 1024; bus_write_4(sc->mem_res, HPET_TIMER_COMPARATOR(t->num), - t->last + sc->freq / 1024); + t->next); } bus_write_4(sc->mem_res, HPET_ISR, 1 << t->num); bus_write_4(sc->mem_res, HPET_TIMER_CAP_CNF(t->num), t->caps); From owner-svn-src-head@FreeBSD.ORG Sun Sep 12 14:04:06 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3F9571065695; Sun, 12 Sep 2010 14:04:06 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2EA018FC1A; Sun, 12 Sep 2010 14:04:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8CE46lg049403; Sun, 12 Sep 2010 14:04:06 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8CE46o4049399; Sun, 12 Sep 2010 14:04:06 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201009121404.o8CE46o4049399@svn.freebsd.org> From: Glen Barber Date: Sun, 12 Sep 2010 14:04:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212492 - in head/lib/libc: db/man sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Sep 2010 14:04:06 -0000 Author: gjb (doc committer) Date: Sun Sep 12 14:04:05 2010 New Revision: 212492 URL: http://svn.freebsd.org/changeset/base/212492 Log: Bump dates in dbopen(3) and cpuset_getaffinity(2) from r212441 and r212438, repectively. Approved by: keramida (mentor) MFC after: 1 week Modified: head/lib/libc/db/man/dbopen.3 head/lib/libc/sys/cpuset_getaffinity.2 Modified: head/lib/libc/db/man/dbopen.3 ============================================================================== --- head/lib/libc/db/man/dbopen.3 Sun Sep 12 11:11:53 2010 (r212491) +++ head/lib/libc/db/man/dbopen.3 Sun Sep 12 14:04:05 2010 (r212492) @@ -28,7 +28,7 @@ .\" @(#)dbopen.3 8.5 (Berkeley) 1/2/94 .\" $FreeBSD$ .\" -.Dd January 2, 1994 +.Dd September 10, 2010 .Dt DBOPEN 3 .Os .Sh NAME Modified: head/lib/libc/sys/cpuset_getaffinity.2 ============================================================================== --- head/lib/libc/sys/cpuset_getaffinity.2 Sun Sep 12 11:11:53 2010 (r212491) +++ head/lib/libc/sys/cpuset_getaffinity.2 Sun Sep 12 14:04:05 2010 (r212492) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 8, 2010 +.Dd September 10, 2010 .Dt CPUSET 2 .Os .Sh NAME From owner-svn-src-head@FreeBSD.ORG Sun Sep 12 14:04:54 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 73C21106564A; Sun, 12 Sep 2010 14:04:54 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 633BA8FC15; Sun, 12 Sep 2010 14:04:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8CE4sG6049491; Sun, 12 Sep 2010 14:04:54 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8CE4sti049488; Sun, 12 Sep 2010 14:04:54 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201009121404.o8CE4sti049488@svn.freebsd.org> From: Glen Barber Date: Sun, 12 Sep 2010 14:04:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212493 - head/share/man/man9 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Sep 2010 14:04:54 -0000 Author: gjb (doc committer) Date: Sun Sep 12 14:04:54 2010 New Revision: 212493 URL: http://svn.freebsd.org/changeset/base/212493 Log: Bump date from r212440. Approved by: keramida (mentor) MFC after: 1 week Modified: head/share/man/man9/devclass_get_maxunit.9 Modified: head/share/man/man9/devclass_get_maxunit.9 ============================================================================== --- head/share/man/man9/devclass_get_maxunit.9 Sun Sep 12 14:04:05 2010 (r212492) +++ head/share/man/man9/devclass_get_maxunit.9 Sun Sep 12 14:04:54 2010 (r212493) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 3, 2005 +.Dd September 10, 2005 .Dt DEVCLASS_GET_MAXUNIT 9 .Os .Sh NAME From owner-svn-src-head@FreeBSD.ORG Sun Sep 12 14:12:17 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0B9A0106564A; Sun, 12 Sep 2010 14:12:16 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B6EE28FC19; Sun, 12 Sep 2010 14:12:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8CECG1e051008; Sun, 12 Sep 2010 14:12:16 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8CECG9U051005; Sun, 12 Sep 2010 14:12:16 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201009121412.o8CECG9U051005@svn.freebsd.org> From: Rui Paulo Date: Sun, 12 Sep 2010 14:12:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212494 - in head/sys/cddl/contrib/opensolaris/uts: common/dtrace intel/dtrace X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Sep 2010 14:12:17 -0000 Author: rpaulo Date: Sun Sep 12 14:12:16 2010 New Revision: 212494 URL: http://svn.freebsd.org/changeset/base/212494 Log: Revamp locking a bit. This fixes three problems: * processes now can't go away while we are inserting probes (fixes a panic) * if a trap happens, we won't be holding the process lock (fixes a hang) * fix a LOR between the process lock and the fasttrap bucket list lock Thanks to kib for pointing some problems. Sponsored by: The FreeBSD Foundation Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Sun Sep 12 14:04:54 2010 (r212493) +++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Sun Sep 12 14:12:16 2010 (r212494) @@ -460,11 +460,13 @@ fasttrap_fork(proc_t *p, proc_t *cp) /* * dtrace_helpers_duplicate() allocates memory. */ + _PHOLD(cp); PROC_UNLOCK(p); PROC_UNLOCK(cp); dtrace_helpers_duplicate(p, cp); PROC_LOCK(cp); PROC_LOCK(p); + _PRELE(cp); } /* * This check is purposely here instead of in kern_fork.c because, @@ -494,6 +496,8 @@ fasttrap_fork(proc_t *p, proc_t *cp) mtx_lock_spin(&cp->p_slock); sprlock_proc(cp); mtx_unlock_spin(&cp->p_slock); +#else + _PHOLD(cp); #endif /* @@ -527,6 +531,8 @@ fasttrap_fork(proc_t *p, proc_t *cp) #if defined(sun) mutex_enter(&cp->p_lock); sprunlock(cp); +#else + _PRELE(cp); #endif } @@ -542,6 +548,7 @@ fasttrap_exec_exit(proc_t *p) ASSERT(p == curproc); #endif PROC_LOCK_ASSERT(p, MA_OWNED); + _PHOLD(p); PROC_UNLOCK(p); /* @@ -554,6 +561,7 @@ fasttrap_exec_exit(proc_t *p) dtrace_helpers_destroy(p); #endif PROC_LOCK(p); + _PRELE(p); } @@ -591,9 +599,7 @@ fasttrap_tracepoint_enable(proc_t *p, fa * Before we make any modifications, make sure we've imposed a barrier * on the generation in which this probe was last modified. */ - PROC_UNLOCK(p); fasttrap_mod_barrier(probe->ftp_gen); - PROC_LOCK(p); bucket = &fasttrap_tpoints.fth_table[FASTTRAP_TPOINTS_INDEX(pid, pc)]; @@ -695,8 +701,6 @@ again: */ #if defined(sun) ASSERT(p->p_proc_flag & P_PR_LOCK); -#else - PROC_LOCK_ASSERT(p, MA_OWNED); #endif p->p_dtrace_count++; @@ -889,8 +893,6 @@ fasttrap_tracepoint_disable(proc_t *p, f */ #if defined(sun) ASSERT(p->p_proc_flag & P_PR_LOCK); -#else - PROC_LOCK_ASSERT(p, MA_OWNED); #endif p->p_dtrace_count--; } @@ -1044,9 +1046,14 @@ fasttrap_pid_enable(void *arg, dtrace_id * the chance to execute the trap instruction we're about to place * in their process's text. */ +#ifdef __FreeBSD__ + /* + * pfind() returns a locked process. + */ + _PHOLD(p); PROC_UNLOCK(p); +#endif fasttrap_enable_callbacks(); - PROC_LOCK(p); /* * Enable all the tracepoints and add this probe's id to each @@ -1077,7 +1084,7 @@ fasttrap_pid_enable(void *arg, dtrace_id mutex_enter(&p->p_lock); sprunlock(p); #else - PROC_UNLOCK(p); + PRELE(p); #endif /* @@ -1092,7 +1099,7 @@ fasttrap_pid_enable(void *arg, dtrace_id mutex_enter(&p->p_lock); sprunlock(p); #else - PROC_UNLOCK(p); + PRELE(p); #endif probe->ftp_enabled = 1; @@ -1121,6 +1128,10 @@ fasttrap_pid_disable(void *arg, dtrace_i mutex_exit(&provider->ftp_mtx); return; } +#ifdef __FreeBSD__ + _PHOLD(p); + PROC_UNLOCK(p); +#endif /* * Disable all the associated tracepoints (for fully enabled probes). @@ -1152,13 +1163,13 @@ fasttrap_pid_disable(void *arg, dtrace_i whack = provider->ftp_marked = 1; mutex_exit(&provider->ftp_mtx); } -#if !defined(sun) - PROC_UNLOCK(p); -#endif if (whack) fasttrap_pid_cleanup(); +#ifdef __FreeBSD__ + PRELE(p); +#endif if (!probe->ftp_enabled) return; Modified: head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Sun Sep 12 14:04:54 2010 (r212493) +++ head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Sun Sep 12 14:12:16 2010 (r212494) @@ -74,15 +74,12 @@ proc_ops(int op, proc_t *p, void *kaddr, uio.uio_segflg = UIO_SYSSPACE; uio.uio_td = curthread; uio.uio_rw = op; - _PHOLD(p); - PROC_UNLOCK(p); + PHOLD(p); if (proc_rwmem(p, &uio) < 0) { - PROC_LOCK(p); - _PRELE(p); + PRELE(p); return (-1); } - PROC_LOCK(p); - _PRELE(p); + PRELE(p); return (0); } From owner-svn-src-head@FreeBSD.ORG Sun Sep 12 14:34:11 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 091E5106566B for ; Sun, 12 Sep 2010 14:34:11 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from glenbarber.us (aries.glenbarber.us [204.109.63.207]) by mx1.freebsd.org (Postfix) with SMTP id 92B4E8FC0A for ; Sun, 12 Sep 2010 14:34:10 +0000 (UTC) Received: (qmail 47835 invoked by uid 0); 12 Sep 2010 10:07:28 -0400 Received: from unknown (HELO schism.local) (gjb@71.230.240.241) by 0 with SMTP; 12 Sep 2010 10:07:28 -0400 Message-ID: <4C8CDE9F.9030806@FreeBSD.org> Date: Sun, 12 Sep 2010 10:07:27 -0400 From: Glen Barber User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.9) Gecko/20100825 Thunderbird/3.1.3 MIME-Version: 1.0 To: src-committers@freebsd.org References: <201009121404.o8CE4sti049488@svn.freebsd.org> In-Reply-To: <201009121404.o8CE4sti049488@svn.freebsd.org> X-Enigmail-Version: 1.1.1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r212493 - head/share/man/man9 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Sep 2010 14:34:11 -0000 On 9/12/10 10:04 AM, Glen Barber wrote: > Author: gjb (doc committer) [snip] > -.Dd April 3, 2005 > +.Dd September 10, 2005 Bah! Fixing this now... :( -- Glen Barber FreeBSD Documentation Project From owner-svn-src-head@FreeBSD.ORG Sun Sep 12 15:59:14 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 77030106564A; Sun, 12 Sep 2010 15:59:14 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 65A078FC1A; Sun, 12 Sep 2010 15:59:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8CFxEU8070652; Sun, 12 Sep 2010 15:59:14 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8CFxEIx070650; Sun, 12 Sep 2010 15:59:14 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201009121559.o8CFxEIx070650@svn.freebsd.org> From: Rui Paulo Date: Sun, 12 Sep 2010 15:59:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212495 - head/cddl/contrib/opensolaris/lib/libdtrace/common X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Sep 2010 15:59:14 -0000 Author: rpaulo Date: Sun Sep 12 15:59:14 2010 New Revision: 212495 URL: http://svn.freebsd.org/changeset/base/212495 Log: Give a chance to the target binary to run the ctors by waiting until it has reached main(). This allows plockstat to work. Sponsored by: The FreeBSD Foundation Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c Sun Sep 12 14:12:16 2010 (r212494) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c Sun Sep 12 15:59:14 2010 (r212495) @@ -1103,7 +1103,7 @@ alloc: #if defined(sun) dtp->dt_prcmode = DT_PROC_STOP_PREINIT; #else - dtp->dt_prcmode = DT_PROC_STOP_POSTINIT; + dtp->dt_prcmode = DT_PROC_STOP_MAIN; #endif dtp->dt_linkmode = DT_LINK_KERNEL; dtp->dt_linktype = DT_LTYP_ELF; From owner-svn-src-head@FreeBSD.ORG Sun Sep 12 16:14:47 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0A5FE1065673; Sun, 12 Sep 2010 16:14:47 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 435F98FC14; Sun, 12 Sep 2010 16:14:45 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id o8CGEfI4095079 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 12 Sep 2010 19:14:41 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id o8CGEfe4006222; Sun, 12 Sep 2010 19:14:41 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id o8CGEfQc006221; Sun, 12 Sep 2010 19:14:41 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 12 Sep 2010 19:14:41 +0300 From: Kostik Belousov To: Rick Macklem Message-ID: <20100912161441.GC2465@deviant.kiev.zoral.com.ua> References: <20100911060111.GT2465@deviant.kiev.zoral.com.ua> <1300087421.776986.1284252082593.JavaMail.root@erie.cs.uoguelph.ca> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="YjUCIDG0UL7zSTfa" Content-Disposition: inline In-Reply-To: <1300087421.776986.1284252082593.JavaMail.root@erie.cs.uoguelph.ca> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-2.2 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_50, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, Rick Macklem , svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r212439 - head/sys/fs/nfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Sep 2010 16:14:47 -0000 --YjUCIDG0UL7zSTfa Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Sep 11, 2010 at 08:41:22PM -0400, Rick Macklem wrote: > > Then, fid_reserved is no more reserved ? Should we rename it ? > >=20 > > Comment for fid_reserved about longword alignment is wrong. >=20 > Well, it's actually more broken than that. > fid_len - Most file systems set it to the size of their variant > of the entire structure, including the Xfid_len field. > ZFS sets it to the size of the structure - sizeof(uint16_t) > { presumably subtracting out the size if Xfid_len? }. > And xfs, well, it does weird stuff with it I can't figure > out, but it is definitely not the size of the entire struct. >=20 > As such, exposing fid_len above the VOP_xxx() doesn't make much sense. > (After my commit yesterday, nothing above the VOP_VPTOFH() uses it.) >=20 > Personally, I'd lean towards a generic struct fid like... > struct fid { > uint8_t fid_data[MAXFIDSZ]; > }; > with MAXFIDSZ increased appropriately, but this will require changes > to xfs and zfs, since they both set the generic fid_len. >=20 > If you go with... > struct fid { > uint16_t fid_len; > uint8_t fid_data[MAXFIDSZ]; > }; > then the hash functions in the two NFS servers need to be changed > (they assume 32bit alignment of fid_data), but they should be fixed > anyhow, since they mostly hash to 0 for ZFS at this time. (From what > I see ZFS file handles looking like.) >=20 > Or, you could just rename fid_reserved to fid_pad and not worry about it. >=20 > Maybe the ZFS folks could decide what they would prefer? rick Let at least rename the field. And I propose the name like fid_data0 or similar, not the fid_pad, to signify that it is used. --YjUCIDG0UL7zSTfa Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkyM/HEACgkQC3+MBN1Mb4ia1wCghknTOCGYyrBGOXm2fpwRBI6b tfAAn3OnmFhDJgHNJg3q1dc117Wsx8f0 =4iR1 -----END PGP SIGNATURE----- --YjUCIDG0UL7zSTfa-- From owner-svn-src-head@FreeBSD.ORG Sun Sep 12 16:28:26 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A69CC1065694; Sun, 12 Sep 2010 16:28:26 +0000 (UTC) (envelope-from ivoras@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 95DE08FC0A; Sun, 12 Sep 2010 16:28:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8CGSQPX077591; Sun, 12 Sep 2010 16:28:26 GMT (envelope-from ivoras@svn.freebsd.org) Received: (from ivoras@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8CGSQog077589; Sun, 12 Sep 2010 16:28:26 GMT (envelope-from ivoras@svn.freebsd.org) Message-Id: <201009121628.o8CGSQog077589@svn.freebsd.org> From: Ivan Voras Date: Sun, 12 Sep 2010 16:28:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212496 - head/sys/modules/crypto X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Sep 2010 16:28:26 -0000 Author: ivoras Date: Sun Sep 12 16:28:26 2010 New Revision: 212496 URL: http://svn.freebsd.org/changeset/base/212496 Log: List low-level Blowfish ECB module in the SRCS. It looks like it was dropped by accident (and it would be inconvenient to implement it otherwise because it uses internal non-published headers). MFC after: 1 week Modified: head/sys/modules/crypto/Makefile Modified: head/sys/modules/crypto/Makefile ============================================================================== --- head/sys/modules/crypto/Makefile Sun Sep 12 15:59:14 2010 (r212495) +++ head/sys/modules/crypto/Makefile Sun Sep 12 16:28:26 2010 (r212496) @@ -12,7 +12,7 @@ KMOD = crypto SRCS = crypto.c cryptodev_if.c SRCS += criov.c cryptosoft.c xform.c SRCS += cast.c deflate.c rmd160.c rijndael-alg-fst.c rijndael-api.c -SRCS += skipjack.c bf_enc.c bf_skey.c +SRCS += skipjack.c bf_enc.c bf_ecb.c bf_skey.c SRCS += des_ecb.c des_enc.c des_setkey.c SRCS += sha1.c sha2.c SRCS += opt_param.h cryptodev_if.h bus_if.h device_if.h From owner-svn-src-head@FreeBSD.ORG Sun Sep 12 17:04:51 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A9DDC1065674; Sun, 12 Sep 2010 17:04:51 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7F66D8FC1E; Sun, 12 Sep 2010 17:04:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8CH4pnL081651; Sun, 12 Sep 2010 17:04:51 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8CH4pVT081646; Sun, 12 Sep 2010 17:04:51 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201009121704.o8CH4pVT081646@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 12 Sep 2010 17:04:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212497 - in head/libexec/rtld-elf: . powerpc64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Sep 2010 17:04:51 -0000 Author: nwhitehorn Date: Sun Sep 12 17:04:51 2010 New Revision: 212497 URL: http://svn.freebsd.org/changeset/base/212497 Log: Check for undefined weak symbols during PLT binding on powerpc64, and do not attempt to copy NULL function descriptors. This fixes LD_BIND_NOW on powerpc64 after r211706. Reviewed by: kib Modified: head/libexec/rtld-elf/powerpc64/reloc.c head/libexec/rtld-elf/rtld.c head/libexec/rtld-elf/rtld.h Modified: head/libexec/rtld-elf/powerpc64/reloc.c ============================================================================== --- head/libexec/rtld-elf/powerpc64/reloc.c Sun Sep 12 16:28:26 2010 (r212496) +++ head/libexec/rtld-elf/powerpc64/reloc.c Sun Sep 12 17:04:51 2010 (r212497) @@ -405,8 +405,13 @@ reloc_jmpslots(Obj_Entry *obj) (void *)target, basename(defobj->path)); #endif - reloc_jmpslot(where, target, defobj, obj, - (const Elf_Rel *) rela); + if (def == &sym_zero) { + /* Zero undefined weak symbols */ + bzero(where, sizeof(struct funcdesc)); + } else { + reloc_jmpslot(where, target, defobj, obj, + (const Elf_Rel *) rela); + } } obj->jmpslots_done = true; Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Sun Sep 12 16:28:26 2010 (r212496) +++ head/libexec/rtld-elf/rtld.c Sun Sep 12 17:04:51 2010 (r212497) @@ -183,7 +183,7 @@ static Objlist list_main = /* Objects lo static Objlist list_fini = /* Objects needing fini() calls */ STAILQ_HEAD_INITIALIZER(list_fini); -static Elf_Sym sym_zero; /* For resolving undefined weak refs. */ +Elf_Sym sym_zero; /* For resolving undefined weak refs. */ #define GDB_STATE(s,m) r_debug.r_state = s; r_debug_state(&r_debug,m); Modified: head/libexec/rtld-elf/rtld.h ============================================================================== --- head/libexec/rtld-elf/rtld.h Sun Sep 12 16:28:26 2010 (r212496) +++ head/libexec/rtld-elf/rtld.h Sun Sep 12 17:04:51 2010 (r212497) @@ -261,6 +261,7 @@ extern void *xcalloc(size_t); extern void *xmalloc(size_t); extern char *xstrdup(const char *); extern Elf_Addr _GLOBAL_OFFSET_TABLE_[]; +extern Elf_Sym sym_zero; /* For resolving undefined weak refs. */ extern void dump_relocations (Obj_Entry *); extern void dump_obj_relocations (Obj_Entry *); From owner-svn-src-head@FreeBSD.ORG Sun Sep 12 17:50:08 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 106F5106564A; Sun, 12 Sep 2010 17:50:08 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F40B58FC0C; Sun, 12 Sep 2010 17:50:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8CHo73R089683; Sun, 12 Sep 2010 17:50:07 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8CHo7ts089681; Sun, 12 Sep 2010 17:50:07 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201009121750.o8CHo7ts089681@svn.freebsd.org> From: Glen Barber Date: Sun, 12 Sep 2010 17:50:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212498 - head/sbin/newfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Sep 2010 17:50:08 -0000 Author: gjb (doc committer) Date: Sun Sep 12 17:50:07 2010 New Revision: 212498 URL: http://svn.freebsd.org/changeset/base/212498 Log: Rewording and typo fixes in newfs(8). PR: 150490 Submitted by: Eitan Adler Additional fixes by: Warren Block , keramida Approved by: keramida (mentor) MFC after: 1 week Modified: head/sbin/newfs/newfs.8 Modified: head/sbin/newfs/newfs.8 ============================================================================== --- head/sbin/newfs/newfs.8 Sun Sep 12 17:04:51 2010 (r212497) +++ head/sbin/newfs/newfs.8 Sun Sep 12 17:50:07 2010 (r212498) @@ -79,10 +79,10 @@ The following options define the general Erase the content of the disk before making the filesystem. The reserved area in front of the superblock (for bootcode) will not be erased. .Pp -This is a relevant option for flash based storage devices that use -wear levelling algorithms. +This option is only relevant for flash based storage devices that use +wear-leveling algorithms. .Pp -NB: Erasing may take as long time as writing every sector on the disk. +Erasing may take a long time as it writes to every sector on the disk. .It Fl J Enable journaling on the new file system via gjournal. See From owner-svn-src-head@FreeBSD.ORG Sun Sep 12 17:53:32 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 466AC10656B7; Sun, 12 Sep 2010 17:53:32 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 35FCA8FC17; Sun, 12 Sep 2010 17:53:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8CHrWM7090039; Sun, 12 Sep 2010 17:53:32 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8CHrWSq090037; Sun, 12 Sep 2010 17:53:32 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201009121753.o8CHrWSq090037@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 12 Sep 2010 17:53:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212499 - head/sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Sep 2010 17:53:32 -0000 Author: kib Date: Sun Sep 12 17:53:31 2010 New Revision: 212499 URL: http://svn.freebsd.org/changeset/base/212499 Log: Fix typo. MFC after: 3 days Modified: head/sys/sys/elf_common.h Modified: head/sys/sys/elf_common.h ============================================================================== --- head/sys/sys/elf_common.h Sun Sep 12 17:50:07 2010 (r212498) +++ head/sys/sys/elf_common.h Sun Sep 12 17:53:31 2010 (r212499) @@ -388,7 +388,7 @@ typedef struct { #define DT_ENCODING 32 /* Values greater than or equal to DT_ENCODING and less than DT_LOOS follow the rules for the interpretation of the d_un union - as follows: even == 'd_ptr', even == 'd_val' + as follows: even == 'd_ptr', odd == 'd_val' or none */ #define DT_PREINIT_ARRAY 32 /* Address of the array of pointers to pre-initialization functions. */ From owner-svn-src-head@FreeBSD.ORG Sun Sep 12 17:53:37 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3314310657D8; Sun, 12 Sep 2010 17:53:37 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 22C1F8FC1E; Sun, 12 Sep 2010 17:53:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8CHrbqr090080; Sun, 12 Sep 2010 17:53:37 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8CHrbXF090078; Sun, 12 Sep 2010 17:53:37 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201009121753.o8CHrbXF090078@svn.freebsd.org> From: Glen Barber Date: Sun, 12 Sep 2010 17:53:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212500 - head/share/man/man9 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Sep 2010 17:53:37 -0000 Author: gjb (doc committer) Date: Sun Sep 12 17:53:36 2010 New Revision: 212500 URL: http://svn.freebsd.org/changeset/base/212500 Log: I believe the majority of Gregorian calendars would agree the current year is 2010, not 2005. Approved by: keramida (mentor) Pointy hat to: gjb MFC after: 1 week Modified: head/share/man/man9/devclass_get_maxunit.9 Modified: head/share/man/man9/devclass_get_maxunit.9 ============================================================================== --- head/share/man/man9/devclass_get_maxunit.9 Sun Sep 12 17:53:31 2010 (r212499) +++ head/share/man/man9/devclass_get_maxunit.9 Sun Sep 12 17:53:36 2010 (r212500) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 10, 2005 +.Dd September 10, 2010 .Dt DEVCLASS_GET_MAXUNIT 9 .Os .Sh NAME From owner-svn-src-head@FreeBSD.ORG Sun Sep 12 17:55:56 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DD5931065675; Sun, 12 Sep 2010 17:55:56 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CD6418FC0C; Sun, 12 Sep 2010 17:55:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8CHtuG2090215; Sun, 12 Sep 2010 17:55:56 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8CHtu9L090213; Sun, 12 Sep 2010 17:55:56 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201009121755.o8CHtu9L090213@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 12 Sep 2010 17:55:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212501 - head/sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Sep 2010 17:55:57 -0000 Author: kib Date: Sun Sep 12 17:55:56 2010 New Revision: 212501 URL: http://svn.freebsd.org/changeset/base/212501 Log: Add DF_1_LOADFLTR. MFC after: 3 days Modified: head/sys/sys/elf_common.h Modified: head/sys/sys/elf_common.h ============================================================================== --- head/sys/sys/elf_common.h Sun Sep 12 17:53:36 2010 (r212500) +++ head/sys/sys/elf_common.h Sun Sep 12 17:55:56 2010 (r212501) @@ -471,6 +471,7 @@ typedef struct { #define DF_1_BIND_NOW 0x00000001 /* Same as DF_BIND_NOW */ #define DF_1_GLOBAL 0x00000002 /* Set the RTLD_GLOBAL for object */ #define DF_1_NODELETE 0x00000008 /* Set the RTLD_NODELETE for object */ +#define DF_1_LOADFLTR 0x00000010 /* Immediate loading of filtees */ #define DF_1_NOOPEN 0x00000040 /* Do not allow loading on dlopen() */ #define DF_1_ORIGIN 0x00000080 /* Process $ORIGIN */ From owner-svn-src-head@FreeBSD.ORG Sun Sep 12 18:04:47 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AAEC71065670; Sun, 12 Sep 2010 18:04:47 +0000 (UTC) (envelope-from qingli@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9ACA08FC14; Sun, 12 Sep 2010 18:04:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8CI4lMP090859; Sun, 12 Sep 2010 18:04:47 GMT (envelope-from qingli@svn.freebsd.org) Received: (from qingli@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8CI4lfN090857; Sun, 12 Sep 2010 18:04:47 GMT (envelope-from qingli@svn.freebsd.org) Message-Id: <201009121804.o8CI4lfN090857@svn.freebsd.org> From: Qing Li Date: Sun, 12 Sep 2010 18:04:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212502 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Sep 2010 18:04:47 -0000 Author: qingli Date: Sun Sep 12 18:04:47 2010 New Revision: 212502 URL: http://svn.freebsd.org/changeset/base/212502 Log: Adding an address on an interface also requires the loopback route to that address be installed. PR: kern/150481 Submitted by: Ingo Flaschberger MFC after: 5 days Modified: head/sys/netinet/raw_ip.c Modified: head/sys/netinet/raw_ip.c ============================================================================== --- head/sys/netinet/raw_ip.c Sun Sep 12 17:55:56 2010 (r212501) +++ head/sys/netinet/raw_ip.c Sun Sep 12 18:04:47 2010 (r212502) @@ -741,6 +741,8 @@ rip_ctlinput(int cmd, struct sockaddr *s if (err == 0) ia->ia_flags |= IFA_ROUTE; err = ifa_add_loopback_route((struct ifaddr *)ia, sa); + if (err == 0) + ia->ia_flags |= IFA_RTSELF; ifa_free(&ia->ia_ifa); break; } From owner-svn-src-head@FreeBSD.ORG Sun Sep 12 18:53:44 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 91D88106566C; Sun, 12 Sep 2010 18:53:44 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8185E8FC26; Sun, 12 Sep 2010 18:53:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8CIriw7099958; Sun, 12 Sep 2010 18:53:44 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8CIriSY099956; Sun, 12 Sep 2010 18:53:44 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201009121853.o8CIriSY099956@svn.freebsd.org> From: Jaakko Heinonen Date: Sun, 12 Sep 2010 18:53:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212505 - head/usr.sbin/freebsd-update X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Sep 2010 18:53:44 -0000 Author: jh Date: Sun Sep 12 18:53:44 2010 New Revision: 212505 URL: http://svn.freebsd.org/changeset/base/212505 Log: In backup_kernel(), support backing up subdirectories and handle files with spaces correctly. Approved by: cperciva MFC after: 1 month Modified: head/usr.sbin/freebsd-update/freebsd-update.sh Modified: head/usr.sbin/freebsd-update/freebsd-update.sh ============================================================================== --- head/usr.sbin/freebsd-update/freebsd-update.sh Sun Sep 12 18:50:57 2010 (r212504) +++ head/usr.sbin/freebsd-update/freebsd-update.sh Sun Sep 12 18:53:44 2010 (r212505) @@ -2638,11 +2638,13 @@ backup_kernel () { # "not ours", backup_kernel_finddir would have exited, so # deleting the directory content is as safe as we can make it. if [ -d $BACKUPKERNELDIR ]; then - rm -f $BACKUPKERNELDIR/* + rm -fr $BACKUPKERNELDIR fi - # Create directory for backup if it doesn't exist. + # Create directories for backup. mkdir -p $BACKUPKERNELDIR + mtree -cdn -p "${KERNELDIR}" | \ + mtree -Ue -p "${BACKUPKERNELDIR}" > /dev/null # Mark the directory as having been created by freebsd-update. touch $BACKUPKERNELDIR/.freebsd-update @@ -2663,9 +2665,8 @@ backup_kernel () { fi # Backup all the kernel files using hardlinks. - find $KERNELDIR -type f $FINDFILTER | \ - sed -Ee "s,($KERNELDIR)/?(.*),\1/\2 ${BACKUPKERNELDIR}/\2," | \ - xargs -n 2 cp -pl + (cd $KERNELDIR && find . -type f $FINDFILTER -exec \ + cp -pl '{}' ${BACKUPKERNELDIR}/'{}' \;) # Re-enable patchname expansion. set +f From owner-svn-src-head@FreeBSD.ORG Sun Sep 12 19:06:09 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 33F58106564A; Sun, 12 Sep 2010 19:06:09 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 22FB68FC16; Sun, 12 Sep 2010 19:06:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8CJ69SQ002604; Sun, 12 Sep 2010 19:06:09 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8CJ68vQ002600; Sun, 12 Sep 2010 19:06:08 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201009121906.o8CJ68vQ002600@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 12 Sep 2010 19:06:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212506 - head/sys/nfsclient X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Sep 2010 19:06:09 -0000 Author: kib Date: Sun Sep 12 19:06:08 2010 New Revision: 212506 URL: http://svn.freebsd.org/changeset/base/212506 Log: Do not fork nfsiod directly from the vop methods. This causes LORs between vnode lock and several locks needed during fork, like fd lock. Instead, schedule the task to be executed in the taskqueue context. We still waiting for the fork to finish, but the context of the thread executing the task does not make real LORs with our vnode lock. Submitted by: pluknet at gmail com Reviewed by: jhb Tested by: pho MFC after: 3 weeks Modified: head/sys/nfsclient/nfs.h head/sys/nfsclient/nfs_nfsiod.c head/sys/nfsclient/nfs_subs.c Modified: head/sys/nfsclient/nfs.h ============================================================================== --- head/sys/nfsclient/nfs.h Sun Sep 12 18:53:44 2010 (r212505) +++ head/sys/nfsclient/nfs.h Sun Sep 12 19:06:08 2010 (r212506) @@ -125,6 +125,7 @@ extern struct uma_zone *nfsmount_zone; extern struct nfsstats nfsstats; extern struct mtx nfs_iod_mtx; +extern struct task nfs_nfsiodnew_task; extern int nfs_numasync; extern unsigned int nfs_iodmax; @@ -253,6 +254,7 @@ int nfs_commit(struct vnode *vp, u_quad_ struct ucred *cred, struct thread *td); int nfs_readdirrpc(struct vnode *, struct uio *, struct ucred *); int nfs_nfsiodnew(int); +void nfs_nfsiodnew_tq(__unused void *, int); int nfs_asyncio(struct nfsmount *, struct buf *, struct ucred *, struct thread *); int nfs_doio(struct vnode *, struct buf *, struct ucred *, struct thread *); void nfs_doio_directwrite (struct buf *); Modified: head/sys/nfsclient/nfs_nfsiod.c ============================================================================== --- head/sys/nfsclient/nfs_nfsiod.c Sun Sep 12 18:53:44 2010 (r212505) +++ head/sys/nfsclient/nfs_nfsiod.c Sun Sep 12 19:06:08 2010 (r212506) @@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -75,6 +76,16 @@ static MALLOC_DEFINE(M_NFSSVC, "nfsclien static void nfssvc_iod(void *); +struct nfsiod_str { + STAILQ_ENTRY(nfsiod_str) ni_links; + int *ni_inst; + int ni_iod; + int ni_error; + int ni_done; +}; +static STAILQ_HEAD(, nfsiod_str) nfsiodhead = + STAILQ_HEAD_INITIALIZER(nfsiodhead); + static int nfs_asyncdaemon[NFS_MAXASYNCDAEMON]; SYSCTL_DECL(_vfs_nfs); @@ -159,11 +170,30 @@ SYSCTL_PROC(_vfs_nfs, OID_AUTO, iodmax, sizeof (nfs_iodmax), sysctl_iodmax, "IU", "Max number of nfsiod kthreads"); +void +nfs_nfsiodnew_tq(__unused void *arg, int pending) +{ + struct nfsiod_str *nip; + + mtx_lock(&nfs_iod_mtx); + while ((nip = STAILQ_FIRST(&nfsiodhead)) != NULL) { + STAILQ_REMOVE_HEAD(&nfsiodhead, ni_links); + mtx_unlock(&nfs_iod_mtx); + nip->ni_error = kproc_create(nfssvc_iod, nip->ni_inst, NULL, + RFHIGHPID, 0, "nfsiod %d", nip->ni_iod); + nip->ni_done = 1; + mtx_lock(&nfs_iod_mtx); + wakeup(nip); + } + mtx_unlock(&nfs_iod_mtx); +} + int nfs_nfsiodnew(int set_iodwant) { int error, i; int newiod; + struct nfsiod_str *nip; if (nfs_numasync >= nfs_iodmax) return (-1); @@ -179,9 +209,16 @@ nfs_nfsiodnew(int set_iodwant) if (set_iodwant > 0) nfs_iodwant[i] = NFSIOD_CREATED_FOR_NFS_ASYNCIO; mtx_unlock(&nfs_iod_mtx); - error = kproc_create(nfssvc_iod, nfs_asyncdaemon + i, NULL, RFHIGHPID, - 0, "nfsiod %d", newiod); + nip = malloc(sizeof(*nip), M_TEMP, M_WAITOK | M_ZERO); + nip->ni_inst = nfs_asyncdaemon + i; + nip->ni_iod = newiod; mtx_lock(&nfs_iod_mtx); + STAILQ_INSERT_TAIL(&nfsiodhead, nip, ni_links); + taskqueue_enqueue(taskqueue_thread, &nfs_nfsiodnew_task); + while (!nip->ni_done) + mtx_sleep(nip, &nfs_iod_mtx, 0, "niwt", 0); + error = nip->ni_error; + free(nip, M_TEMP); if (error) { if (set_iodwant > 0) nfs_iodwant[i] = NFSIOD_NOT_AVAILABLE; Modified: head/sys/nfsclient/nfs_subs.c ============================================================================== --- head/sys/nfsclient/nfs_subs.c Sun Sep 12 18:53:44 2010 (r212505) +++ head/sys/nfsclient/nfs_subs.c Sun Sep 12 19:06:08 2010 (r212506) @@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -117,6 +118,7 @@ int nfs_pbuf_freecnt = -1; /* start out struct nfs_bufq nfs_bufq; static struct mtx nfs_xid_mtx; +struct task nfs_nfsiodnew_task; /* * and the reverse mapping from generic to Version 2 procedure numbers @@ -354,6 +356,7 @@ nfs_init(struct vfsconf *vfsp) */ mtx_init(&nfs_iod_mtx, "NFS iod lock", NULL, MTX_DEF); mtx_init(&nfs_xid_mtx, "NFS xid lock", NULL, MTX_DEF); + TASK_INIT(&nfs_nfsiodnew_task, 0, nfs_nfsiodnew_tq, NULL); nfs_pbuf_freecnt = nswbuf / 2 + 1; @@ -368,9 +371,13 @@ nfs_uninit(struct vfsconf *vfsp) /* * Tell all nfsiod processes to exit. Clear nfs_iodmax, and wakeup * any sleeping nfsiods so they check nfs_iodmax and exit. + * Drain nfsiodnew task before we wait for them to finish. */ mtx_lock(&nfs_iod_mtx); nfs_iodmax = 0; + mtx_unlock(&nfs_iod_mtx); + taskqueue_drain(taskqueue_thread, &nfs_nfsiodnew_task); + mtx_lock(&nfs_iod_mtx); for (i = 0; i < nfs_numasync; i++) if (nfs_iodwant[i] == NFSIOD_AVAILABLE) wakeup(&nfs_iodwant[i]); From owner-svn-src-head@FreeBSD.ORG Sun Sep 12 20:41:47 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8A885106564A; Sun, 12 Sep 2010 20:41:47 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 622A98FC0C; Sun, 12 Sep 2010 20:41:47 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id E477946B8D; Sun, 12 Sep 2010 16:41:46 -0400 (EDT) Date: Sun, 12 Sep 2010 21:41:46 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Konstantin Belousov In-Reply-To: <201009121906.o8CJ68vQ002600@svn.freebsd.org> Message-ID: References: <201009121906.o8CJ68vQ002600@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r212506 - head/sys/nfsclient X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Sep 2010 20:41:47 -0000 On Sun, 12 Sep 2010, Konstantin Belousov wrote: > Do not fork nfsiod directly from the vop methods. This causes LORs between > vnode lock and several locks needed during fork, like fd lock. > > Instead, schedule the task to be executed in the taskqueue context. We > still waiting for the fork to finish, but the context of the thread > executing the task does not make real LORs with our vnode lock. Does this actually functionally improve things, or is all this complexity about suppressing the lock order reversal? If we're waiting synchronously for the other thread to launch from the task queue, then the lock order reversal still exists, it's just not visible to WITNESS... If we had a static analysis tool that could run on lock and sleep/wakeup traces, it would still show a deadlock opportunity. Robert From owner-svn-src-head@FreeBSD.ORG Sun Sep 12 20:46:32 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 65CAF106566B; Sun, 12 Sep 2010 20:46:32 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 558658FC27; Sun, 12 Sep 2010 20:46:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8CKkWlO015757; Sun, 12 Sep 2010 20:46:32 GMT (envelope-from cognet@svn.freebsd.org) Received: (from cognet@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8CKkWCM015755; Sun, 12 Sep 2010 20:46:32 GMT (envelope-from cognet@svn.freebsd.org) Message-Id: <201009122046.o8CKkWCM015755@svn.freebsd.org> From: Olivier Houchard Date: Sun, 12 Sep 2010 20:46:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212507 - head/sys/arm/arm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Sep 2010 20:46:32 -0000 Author: cognet Date: Sun Sep 12 20:46:32 2010 New Revision: 212507 URL: http://svn.freebsd.org/changeset/base/212507 Log: In pmap_remove_all(), do not decrease pm_stats.wired_count if the mapping was wired, as it's been done later in pmap_nuke_pv(). Submitted by: Mark Tinguely Modified: head/sys/arm/arm/pmap.c Modified: head/sys/arm/arm/pmap.c ============================================================================== --- head/sys/arm/arm/pmap.c Sun Sep 12 19:06:08 2010 (r212506) +++ head/sys/arm/arm/pmap.c Sun Sep 12 20:46:32 2010 (r212507) @@ -3158,8 +3158,6 @@ pmap_remove_all(vm_page_t m) *ptep = 0; PTE_SYNC_CURRENT(pv->pv_pmap, ptep); pmap_free_l2_bucket(pv->pv_pmap, l2b, 1); - if (pv->pv_flags & PVF_WIRED) - pv->pv_pmap->pm_stats.wired_count--; pv->pv_pmap->pm_stats.resident_count--; flags |= pv->pv_flags; } From owner-svn-src-head@FreeBSD.ORG Sun Sep 12 20:53:15 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C9B021065670; Sun, 12 Sep 2010 20:53:15 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 3C1D08FC13; Sun, 12 Sep 2010 20:53:14 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id o8CKrB0R013329 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 12 Sep 2010 23:53:11 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id o8CKrBmQ010695; Sun, 12 Sep 2010 23:53:11 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id o8CKrBcE010694; Sun, 12 Sep 2010 23:53:11 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 12 Sep 2010 23:53:11 +0300 From: Kostik Belousov To: Robert Watson Message-ID: <20100912205311.GG2465@deviant.kiev.zoral.com.ua> References: <201009121906.o8CJ68vQ002600@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="lqtP4FxvQo6hb6bg" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-2.1 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_50, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r212506 - head/sys/nfsclient X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Sep 2010 20:53:15 -0000 --lqtP4FxvQo6hb6bg Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Sep 12, 2010 at 09:41:46PM +0100, Robert Watson wrote: >=20 > On Sun, 12 Sep 2010, Konstantin Belousov wrote: >=20 > > Do not fork nfsiod directly from the vop methods. This causes LORs betw= een > > vnode lock and several locks needed during fork, like fd lock. > > > > Instead, schedule the task to be executed in the taskqueue context. We > > still waiting for the fork to finish, but the context of the thread > > executing the task does not make real LORs with our vnode lock. >=20 > Does this actually functionally improve things, or is all this complexity= =20 > about suppressing the lock order reversal? If we're waiting synchronousl= y=20 > for the other thread to launch from the task queue, then the lock order= =20 > reversal still exists, it's just not visible to WITNESS... If we had a= =20 > static analysis tool that could run on lock and sleep/wakeup traces, it= =20 > would still show a deadlock opportunity. As I said in commit message, the deadlock should be fixed, because the taskq thread is executed in the kernel process that should even not have file descriptors at all. --lqtP4FxvQo6hb6bg Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkyNPbYACgkQC3+MBN1Mb4horACdEfBPBECx7PKyITCdgySMJXtg i+8AoMowsZKPz3IJIAjmZin4Ba6dD3YN =Qiid -----END PGP SIGNATURE----- --lqtP4FxvQo6hb6bg-- From owner-svn-src-head@FreeBSD.ORG Sun Sep 12 21:02:24 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DAAC7106566B; Sun, 12 Sep 2010 21:02:24 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id B09848FC0A; Sun, 12 Sep 2010 21:02:24 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id 57F2346B0C; Sun, 12 Sep 2010 17:02:24 -0400 (EDT) Date: Sun, 12 Sep 2010 22:02:24 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Kostik Belousov In-Reply-To: <20100912205311.GG2465@deviant.kiev.zoral.com.ua> Message-ID: References: <201009121906.o8CJ68vQ002600@svn.freebsd.org> <20100912205311.GG2465@deviant.kiev.zoral.com.ua> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r212506 - head/sys/nfsclient X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Sep 2010 21:02:25 -0000 On Sun, 12 Sep 2010, Kostik Belousov wrote: > On Sun, Sep 12, 2010 at 09:41:46PM +0100, Robert Watson wrote: >> >> On Sun, 12 Sep 2010, Konstantin Belousov wrote: >> >>> Do not fork nfsiod directly from the vop methods. This causes LORs between >>> vnode lock and several locks needed during fork, like fd lock. >>> >>> Instead, schedule the task to be executed in the taskqueue context. We >>> still waiting for the fork to finish, but the context of the thread >>> executing the task does not make real LORs with our vnode lock. >> >> Does this actually functionally improve things, or is all this complexity >> about suppressing the lock order reversal? If we're waiting synchronously >> for the other thread to launch from the task queue, then the lock order >> reversal still exists, it's just not visible to WITNESS... If we had a >> static analysis tool that could run on lock and sleep/wakeup traces, it >> would still show a deadlock opportunity. > > As I said in commit message, the deadlock should be fixed, because the taskq > thread is executed in the kernel process that should even not have file > descriptors at all. Ah, I think I see where my misunderstanding arose: the behavior of kernel process fork is changed as a result of running in a different (specific) context, and hence never acquires the file descriptor lock class? Robert From owner-svn-src-head@FreeBSD.ORG Sun Sep 12 21:12:13 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 81F9E106566C; Sun, 12 Sep 2010 21:12:13 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 1C30D8FC15; Sun, 12 Sep 2010 21:12:12 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id o8CLC9Pj014641 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 13 Sep 2010 00:12:09 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id o8CLC9uV010838; Mon, 13 Sep 2010 00:12:09 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id o8CLC9NP010837; Mon, 13 Sep 2010 00:12:09 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 13 Sep 2010 00:12:09 +0300 From: Kostik Belousov To: Robert Watson Message-ID: <20100912211209.GH2465@deviant.kiev.zoral.com.ua> References: <201009121906.o8CJ68vQ002600@svn.freebsd.org> <20100912205311.GG2465@deviant.kiev.zoral.com.ua> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="sjel/IY1pyoUgMMX" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-2.1 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_50, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r212506 - head/sys/nfsclient X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Sep 2010 21:12:13 -0000 --sjel/IY1pyoUgMMX Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Sep 12, 2010 at 10:02:24PM +0100, Robert Watson wrote: >=20 > On Sun, 12 Sep 2010, Kostik Belousov wrote: >=20 > >On Sun, Sep 12, 2010 at 09:41:46PM +0100, Robert Watson wrote: > >> > >>On Sun, 12 Sep 2010, Konstantin Belousov wrote: > >> > >>>Do not fork nfsiod directly from the vop methods. This causes LORs=20 > >>>between vnode lock and several locks needed during fork, like fd lock. > >>> > >>>Instead, schedule the task to be executed in the taskqueue context. We= =20 > >>>still waiting for the fork to finish, but the context of the thread=20 > >>>executing the task does not make real LORs with our vnode lock. > >> > >>Does this actually functionally improve things, or is all this complexi= ty=20 > >>about suppressing the lock order reversal? If we're waiting=20 > >>synchronously for the other thread to launch from the task queue, then= =20 > >>the lock order reversal still exists, it's just not visible to WITNESS.= ..=20 > >>If we had a static analysis tool that could run on lock and sleep/wakeu= p=20 > >>traces, it would still show a deadlock opportunity. > > > >As I said in commit message, the deadlock should be fixed, because the= =20 > >taskq thread is executed in the kernel process that should even not have= =20 > >file descriptors at all. >=20 > Ah, I think I see where my misunderstanding arose: the behavior of kernel= =20 > process fork is changed as a result of running in a different (specific)= =20 > context, and hence never acquires the file descriptor lock class? The original code created nfsiod by forking inside the vop, that happens to execute in the context of whatever user process that initiated the operation. Taskqueue is executing in the intr process context, that should not have file descriptors allocated at all. Actually, even if the intr process had fd allocated, then it still should not lock the table. --sjel/IY1pyoUgMMX Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkyNQicACgkQC3+MBN1Mb4h+7wCgkHSYVd8gyeqpVPKMmgGMQHMK slMAnjF43/L7m0JmEhk3EDZmYurrEz8L =zw7A -----END PGP SIGNATURE----- --sjel/IY1pyoUgMMX-- From owner-svn-src-head@FreeBSD.ORG Sun Sep 12 22:00:31 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E43E8106566C; Sun, 12 Sep 2010 22:00:31 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D3EEE8FC15; Sun, 12 Sep 2010 22:00:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8CM0VRU026040; Sun, 12 Sep 2010 22:00:31 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8CM0VCV026038; Sun, 12 Sep 2010 22:00:31 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201009122200.o8CM0VCV026038@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 12 Sep 2010 22:00:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212508 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Sep 2010 22:00:32 -0000 Author: jilles Date: Sun Sep 12 22:00:31 2010 New Revision: 212508 URL: http://svn.freebsd.org/changeset/base/212508 Log: sh: Add __dead2 to two functions that do not return. Apart from helping static analyzers, this also appears to reduce the size of the binary slightly. Modified: head/bin/sh/parser.c Modified: head/bin/sh/parser.c ============================================================================== --- head/bin/sh/parser.c Sun Sep 12 20:46:32 2010 (r212507) +++ head/bin/sh/parser.c Sun Sep 12 22:00:31 2010 (r212508) @@ -118,8 +118,8 @@ STATIC int readtoken(void); STATIC int xxreadtoken(void); STATIC int readtoken1(int, char const *, char *, int); STATIC int noexpand(char *); -STATIC void synexpect(int); -STATIC void synerror(const char *); +STATIC void synexpect(int) __dead2; +STATIC void synerror(const char *) __dead2; STATIC void setprompt(int); From owner-svn-src-head@FreeBSD.ORG Mon Sep 13 00:57:48 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 576F8106564A; Mon, 13 Sep 2010 00:57:48 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 468198FC14; Mon, 13 Sep 2010 00:57:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8D0vmX3041782; Mon, 13 Sep 2010 00:57:48 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8D0vmtv041780; Mon, 13 Sep 2010 00:57:48 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201009130057.o8D0vmtv041780@svn.freebsd.org> From: Warner Losh Date: Mon, 13 Sep 2010 00:57:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212511 - head/usr.sbin/crunch/crunchide X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2010 00:57:48 -0000 Author: imp Date: Mon Sep 13 00:57:48 2010 New Revision: 212511 URL: http://svn.freebsd.org/changeset/base/212511 Log: Use TARGET_CPUARCH instead of TARGET_ARCH here. Define TARGET_CPUARCH based on TARGET_ARCH. Use TARGET_ARCH still for a powerpc64 test. Futureproof for coming mipsel/mipseb and arm/armeb rename. Modified: head/usr.sbin/crunch/crunchide/Makefile Modified: head/usr.sbin/crunch/crunchide/Makefile ============================================================================== --- head/usr.sbin/crunch/crunchide/Makefile Mon Sep 13 00:42:07 2010 (r212510) +++ head/usr.sbin/crunch/crunchide/Makefile Mon Sep 13 00:57:48 2010 (r212511) @@ -3,6 +3,14 @@ PROG= crunchide SRCS= crunchide.c +# These assignments duplicate much of the functionality of +# MACHINE_CPUARCH, but there's no easy way to export make functions... + +.if defined(TARGET_ARCH) +TARGET_CPUARCH=${TARGET_ARCH:C/mipse[bl]/mips/:C/armeb/arm/} +.else +TARGET_CPUARCH=${MACHINE_CPUARCH} +.endif TARGET_ARCH?= ${MACHINE_ARCH} .if ${TARGET_ARCH} == i386 && ${MACHINE_ARCH} == i386 @@ -10,8 +18,9 @@ CFLAGS+=-DNLIST_AOUT SRCS+= exec_aout.c .endif -.if ${TARGET_ARCH} == ia64 || ${TARGET_ARCH} == powerpc64 || \ - ${TARGET_ARCH} == sparc64 || ${TARGET_ARCH} == amd64 +# nb: TARGET_ARCH for powerpc64 is correct here +.if ${TARGET_CPUARCH} == ia64 || ${TARGET_ARCH} == powerpc64 || \ + ${TARGET_CPUARCH} == sparc64 || ${TARGET_CPUARCH} == amd64 CFLAGS+=-DNLIST_ELF64 SRCS+= exec_elf64.c exec_elf64.o: exec_elf32.c From owner-svn-src-head@FreeBSD.ORG Mon Sep 13 01:00:48 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F250B106566C; Mon, 13 Sep 2010 01:00:48 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E1A678FC0C; Mon, 13 Sep 2010 01:00:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8D10m0g042076; Mon, 13 Sep 2010 01:00:48 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8D10mQY042074; Mon, 13 Sep 2010 01:00:48 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201009130100.o8D10mQY042074@svn.freebsd.org> From: Warner Losh Date: Mon, 13 Sep 2010 01:00:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212512 - head/usr.bin/xlint X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2010 01:00:49 -0000 Author: imp Date: Mon Sep 13 01:00:48 2010 New Revision: 212512 URL: http://svn.freebsd.org/changeset/base/212512 Log: Move to using TARGET_CPUARCH instead of TARGET_ARCH. Modified: head/usr.bin/xlint/Makefile.inc Modified: head/usr.bin/xlint/Makefile.inc ============================================================================== --- head/usr.bin/xlint/Makefile.inc Mon Sep 13 00:57:48 2010 (r212511) +++ head/usr.bin/xlint/Makefile.inc Mon Sep 13 01:00:48 2010 (r212512) @@ -5,8 +5,16 @@ WARNS?= 0 .PATH: ${.CURDIR}/../common +# These assignments duplicate much of the functionality of +# MACHINE_CPUARCH, but there's no easy way to export make functions... + +.if defined(TARGET_ARCH) +TARGET_CPUARCH=${TARGET_ARCH:C/mipse[bl]/mips/:C/armeb/arm/} +.else +TARGET_CPUARCH=${MACHINE_CPUARCH} +.endif TARGET_ARCH?= ${MACHINE_ARCH} -CFLAGS+= -I${.CURDIR}/../arch/${TARGET_ARCH} +CFLAGS+= -I${.CURDIR}/../arch/${TARGET_CPUARCH} CFLAGS+= -I${.CURDIR}/../common OBJECT_FMT= ELF From owner-svn-src-head@FreeBSD.ORG Mon Sep 13 01:20:53 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DA9E61065673; Mon, 13 Sep 2010 01:20:53 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C987E8FC17; Mon, 13 Sep 2010 01:20:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8D1KrnN043446; Mon, 13 Sep 2010 01:20:53 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8D1KrJM043444; Mon, 13 Sep 2010 01:20:53 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201009130120.o8D1KrJM043444@svn.freebsd.org> From: Warner Losh Date: Mon, 13 Sep 2010 01:20:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212513 - in head/usr.bin/xlint/arch: powerpc powerpc64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2010 01:20:54 -0000 Author: imp Date: Mon Sep 13 01:20:53 2010 New Revision: 212513 URL: http://svn.freebsd.org/changeset/base/212513 Log: merge powerpc and powerpc64 now that we use TARGET_CPUARCH Deleted: head/usr.bin/xlint/arch/powerpc64/ Modified: head/usr.bin/xlint/arch/powerpc/targparam.h Modified: head/usr.bin/xlint/arch/powerpc/targparam.h ============================================================================== --- head/usr.bin/xlint/arch/powerpc/targparam.h Mon Sep 13 01:00:48 2010 (r212512) +++ head/usr.bin/xlint/arch/powerpc/targparam.h Mon Sep 13 01:20:53 2010 (r212513) @@ -29,13 +29,19 @@ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ */ /* * Machine-dependent target parameters for lint1. */ +#ifdef __powerpc64__ +#include "lp64.h" +#else #include "ilp32.h" +#endif /* * Should be set to 1 if the difference of two pointers is of type long @@ -43,8 +49,13 @@ * kept in sync with the compiler! */ +#ifdef __powerpc64__ +#define PTRDIFF_IS_LONG 1 +#define SIZEOF_IS_ULONG 1 +#else #define PTRDIFF_IS_LONG 0 #define SIZEOF_IS_ULONG 0 +#endif #define FLOAT_SIZE (4 * CHAR_BIT) #define DOUBLE_SIZE (8 * CHAR_BIT) From owner-svn-src-head@FreeBSD.ORG Mon Sep 13 01:29:51 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 88CBC106566B; Mon, 13 Sep 2010 01:29:51 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7858F8FC0C; Mon, 13 Sep 2010 01:29:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8D1Tpww044106; Mon, 13 Sep 2010 01:29:51 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8D1TpCL044104; Mon, 13 Sep 2010 01:29:51 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201009130129.o8D1TpCL044104@svn.freebsd.org> From: Warner Losh Date: Mon, 13 Sep 2010 01:29:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212515 - head/bin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2010 01:29:51 -0000 Author: imp Date: Mon Sep 13 01:29:51 2010 New Revision: 212515 URL: http://svn.freebsd.org/changeset/base/212515 Log: Merge from tbemd: Add directory names directly and sort at the end. Include bsd.arch.inc.mk so we can, in the future, more easily make arch dependent changes in /bin (unlikely, but is needed for symmetry). Modified: head/bin/Makefile Modified: head/bin/Makefile ============================================================================== --- head/bin/Makefile Mon Sep 13 01:27:54 2010 (r212514) +++ head/bin/Makefile Mon Sep 13 01:29:51 2010 (r212515) @@ -8,7 +8,6 @@ SUBDIR= cat \ chio \ chmod \ cp \ - ${_csh} \ date \ dd \ df \ @@ -29,10 +28,8 @@ SUBDIR= cat \ ps \ pwait \ pwd \ - ${_rcp} \ realpath \ rm \ - ${_rmail} \ rmdir \ setfacl \ sh \ @@ -43,15 +40,19 @@ SUBDIR= cat \ uuidgen .if ${MK_RCMDS} != "no" -_rcp= rcp +SUBDIR+= rcp .endif .if ${MK_SENDMAIL} != "no" -_rmail= rmail +SUBDIR+= rmail .endif .if ${MK_TCSH} != "no" -_csh= csh +SUBDIR+= csh .endif +.include + +SUBDIR:= ${SUBDIR:O} + .include From owner-svn-src-head@FreeBSD.ORG Mon Sep 13 01:43:11 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1ECA5106564A; Mon, 13 Sep 2010 01:43:11 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0C2F48FC08; Mon, 13 Sep 2010 01:43:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8D1hAYG045131; Mon, 13 Sep 2010 01:43:10 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8D1hAiU045121; Mon, 13 Sep 2010 01:43:10 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201009130143.o8D1hAiU045121@svn.freebsd.org> From: Warner Losh Date: Mon, 13 Sep 2010 01:43:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212516 - in head/lib/libthr: . arch/amd64 arch/arm arch/i386 arch/ia64 arch/mips arch/powerpc arch/sparc64 support X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2010 01:43:11 -0000 Author: imp Date: Mon Sep 13 01:43:10 2010 New Revision: 212516 URL: http://svn.freebsd.org/changeset/base/212516 Log: Merge from tbemd, with a small amount of rework: For all libthr contexts, use ${MACHINE_CPUARCH} for all libc contexts, use ${MACHINE_ARCH} if it exists, otherwise use ${MACHINE_CPUARCH} Move some common code up a layer (the .PATH statement was the same in all the arch submakefiles). # Hope she hasn't busted powerpc64 with this... Modified: head/lib/libthr/Makefile head/lib/libthr/arch/amd64/Makefile.inc head/lib/libthr/arch/arm/Makefile.inc head/lib/libthr/arch/i386/Makefile.inc head/lib/libthr/arch/ia64/Makefile.inc head/lib/libthr/arch/mips/Makefile.inc head/lib/libthr/arch/powerpc/Makefile.inc head/lib/libthr/arch/sparc64/Makefile.inc head/lib/libthr/support/Makefile.inc Modified: head/lib/libthr/Makefile ============================================================================== --- head/lib/libthr/Makefile Mon Sep 13 01:29:51 2010 (r212515) +++ head/lib/libthr/Makefile Mon Sep 13 01:43:10 2010 (r212516) @@ -22,7 +22,7 @@ CFLAGS+=-I${.CURDIR}/../libc/include -I$ CFLAGS+=-I${.CURDIR}/arch/${MACHINE_CPUARCH}/include CFLAGS+=-I${.CURDIR}/sys CFLAGS+=-I${.CURDIR}/../../libexec/rtld-elf -CFLAGS+=-I${.CURDIR}/../../libexec/rtld-elf/${MACHINE_ARCH} +CFLAGS+=-I${.CURDIR}/../../libexec/rtld-elf/${MACHINE_CPUARCH} CFLAGS+=-I${.CURDIR}/../libthread_db CFLAGS+=-Winline LDFLAGS+=-Wl,-znodelete @@ -38,6 +38,8 @@ CFLAGS+=-D_PTHREADS_INVARIANTS PRECIOUSLIB= +.PATH: ${.CURDIR}/arch/${MACHINE_CPUARCH}/${MACHINE_CPUARCH} + .include "${.CURDIR}/arch/${MACHINE_CPUARCH}/Makefile.inc" .include "${.CURDIR}/sys/Makefile.inc" .include "${.CURDIR}/thread/Makefile.inc" Modified: head/lib/libthr/arch/amd64/Makefile.inc ============================================================================== --- head/lib/libthr/arch/amd64/Makefile.inc Mon Sep 13 01:29:51 2010 (r212515) +++ head/lib/libthr/arch/amd64/Makefile.inc Mon Sep 13 01:43:10 2010 (r212516) @@ -1,5 +1,3 @@ #$FreeBSD$ -.PATH: ${.CURDIR}/arch/${MACHINE_ARCH}/${MACHINE_ARCH} - SRCS+= pthread_md.c _umtx_op_err.S Modified: head/lib/libthr/arch/arm/Makefile.inc ============================================================================== --- head/lib/libthr/arch/arm/Makefile.inc Mon Sep 13 01:29:51 2010 (r212515) +++ head/lib/libthr/arch/arm/Makefile.inc Mon Sep 13 01:43:10 2010 (r212516) @@ -1,5 +1,3 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/arch/${MACHINE_ARCH}/${MACHINE_ARCH} - SRCS+= pthread_md.c Modified: head/lib/libthr/arch/i386/Makefile.inc ============================================================================== --- head/lib/libthr/arch/i386/Makefile.inc Mon Sep 13 01:29:51 2010 (r212515) +++ head/lib/libthr/arch/i386/Makefile.inc Mon Sep 13 01:43:10 2010 (r212516) @@ -1,5 +1,3 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/arch/${MACHINE_ARCH}/${MACHINE_ARCH} - SRCS+= pthread_md.c _umtx_op_err.S Modified: head/lib/libthr/arch/ia64/Makefile.inc ============================================================================== --- head/lib/libthr/arch/ia64/Makefile.inc Mon Sep 13 01:29:51 2010 (r212515) +++ head/lib/libthr/arch/ia64/Makefile.inc Mon Sep 13 01:43:10 2010 (r212516) @@ -1,5 +1,3 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/arch/${MACHINE_ARCH}/${MACHINE_ARCH} - SRCS+= _umtx_op_err.S pthread_md.c Modified: head/lib/libthr/arch/mips/Makefile.inc ============================================================================== --- head/lib/libthr/arch/mips/Makefile.inc Mon Sep 13 01:29:51 2010 (r212515) +++ head/lib/libthr/arch/mips/Makefile.inc Mon Sep 13 01:43:10 2010 (r212516) @@ -1,5 +1,3 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/arch/${MACHINE_ARCH}/${MACHINE_ARCH} - SRCS+= pthread_md.c Modified: head/lib/libthr/arch/powerpc/Makefile.inc ============================================================================== --- head/lib/libthr/arch/powerpc/Makefile.inc Mon Sep 13 01:29:51 2010 (r212515) +++ head/lib/libthr/arch/powerpc/Makefile.inc Mon Sep 13 01:43:10 2010 (r212516) @@ -1,5 +1,3 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/arch/${MACHINE_CPUARCH}/${MACHINE_CPUARCH} - SRCS+= pthread_md.c Modified: head/lib/libthr/arch/sparc64/Makefile.inc ============================================================================== --- head/lib/libthr/arch/sparc64/Makefile.inc Mon Sep 13 01:29:51 2010 (r212515) +++ head/lib/libthr/arch/sparc64/Makefile.inc Mon Sep 13 01:43:10 2010 (r212516) @@ -1,5 +1,3 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/arch/${MACHINE_ARCH}/${MACHINE_ARCH} - SRCS+= pthread_md.c Modified: head/lib/libthr/support/Makefile.inc ============================================================================== --- head/lib/libthr/support/Makefile.inc Mon Sep 13 01:29:51 2010 (r212515) +++ head/lib/libthr/support/Makefile.inc Mon Sep 13 01:43:10 2010 (r212516) @@ -1,9 +1,16 @@ # $FreeBSD$ .PATH: ${.CURDIR}/support ${.CURDIR}/../libc/gen ${.CURDIR}/../libc/string -.PATH: ${.CURDIR}/../libc/${MACHINE_ARCH}/sys +# libc must search machine_arch, then machine_cpuarch, but libthr has all its +# code implemented in machine_cpuarch. Cope. +.if exists(${.CURDIR}/../libc/${MACHINE_ARCH}/sys) +.PATH: ${.CURDIR}/../libc/${MACHINE_ARCH}/sys CFLAGS+= -I${.CURDIR}/../libc/${MACHINE_ARCH} +.else +.PATH: ${.CURDIR}/../libc/${MACHINE_CPUARCH}/sys +CFLAGS+= -I${.CURDIR}/../libc/${MACHINE_CPUARCH} +.endif SYSCALLS= thr_new From owner-svn-src-head@FreeBSD.ORG Mon Sep 13 01:44:07 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7AAC91065670; Mon, 13 Sep 2010 01:44:07 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4FFB78FC1A; Mon, 13 Sep 2010 01:44:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8D1i7V2045220; Mon, 13 Sep 2010 01:44:07 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8D1i7jr045217; Mon, 13 Sep 2010 01:44:07 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201009130144.o8D1i7jr045217@svn.freebsd.org> From: Warner Losh Date: Mon, 13 Sep 2010 01:44:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212517 - head/lib/libz X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2010 01:44:07 -0000 Author: imp Date: Mon Sep 13 01:44:07 2010 New Revision: 212517 URL: http://svn.freebsd.org/changeset/base/212517 Log: Include FreeBSD svn tag Modified: head/lib/libz/minigzip.c Modified: head/lib/libz/minigzip.c ============================================================================== --- head/lib/libz/minigzip.c Mon Sep 13 01:43:10 2010 (r212516) +++ head/lib/libz/minigzip.c Mon Sep 13 01:44:07 2010 (r212517) @@ -13,6 +13,8 @@ * or in pipe mode. */ +#include +__FBSDID("$FreeBSD$"); /* @(#) $Id$ */ #include "zlib.h" From owner-svn-src-head@FreeBSD.ORG Mon Sep 13 01:44:56 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A04841065672; Mon, 13 Sep 2010 01:44:56 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 900478FC17; Mon, 13 Sep 2010 01:44:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8D1iu2T045292; Mon, 13 Sep 2010 01:44:56 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8D1iuDX045290; Mon, 13 Sep 2010 01:44:56 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201009130144.o8D1iuDX045290@svn.freebsd.org> From: Warner Losh Date: Mon, 13 Sep 2010 01:44:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212518 - head/lib/msun X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2010 01:44:56 -0000 Author: imp Date: Mon Sep 13 01:44:56 2010 New Revision: 212518 URL: http://svn.freebsd.org/changeset/base/212518 Log: MFtbemd: Move to using MACHINE_CPUARCH, now that it is safe. Modified: head/lib/msun/Makefile Modified: head/lib/msun/Makefile ============================================================================== --- head/lib/msun/Makefile Mon Sep 13 01:44:07 2010 (r212517) +++ head/lib/msun/Makefile Mon Sep 13 01:44:56 2010 (r212518) @@ -12,12 +12,12 @@ # # -.if ${MACHINE_ARCH} == "i386" +.if ${MACHINE_CPUARCH} == "i386" ARCH_SUBDIR= i387 .elif ${MACHINE_ARCH} == "powerpc64" ARCH_SUBDIR= powerpc .else -ARCH_SUBDIR= ${MACHINE_ARCH} +ARCH_SUBDIR= ${MACHINE_CPUARCH} .endif .include "${ARCH_SUBDIR}/Makefile.inc" From owner-svn-src-head@FreeBSD.ORG Mon Sep 13 02:02:21 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2C779106564A; Mon, 13 Sep 2010 02:02:21 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1BF028FC08; Mon, 13 Sep 2010 02:02:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8D22Ld6046881; Mon, 13 Sep 2010 02:02:21 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8D22K0b046879; Mon, 13 Sep 2010 02:02:20 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201009130202.o8D22K0b046879@svn.freebsd.org> From: Warner Losh Date: Mon, 13 Sep 2010 02:02:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212521 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2010 02:02:21 -0000 Author: imp Date: Mon Sep 13 02:02:20 2010 New Revision: 212521 URL: http://svn.freebsd.org/changeset/base/212521 Log: Use :T:Micc here like everywhere else we test icc Modified: head/sys/conf/kern.pre.mk Modified: head/sys/conf/kern.pre.mk ============================================================================== --- head/sys/conf/kern.pre.mk Mon Sep 13 02:01:29 2010 (r212520) +++ head/sys/conf/kern.pre.mk Mon Sep 13 02:02:20 2010 (r212521) @@ -42,7 +42,7 @@ COPTFLAGS+= -fno-strict-aliasing . endif .endif .if !defined(NO_CPU_COPTFLAGS) -. if ${CC} == "icc" +. if ${CC:T:Micc} == "icc" COPTFLAGS+= ${_ICC_CPUCFLAGS:C/(-x[^M^K^W]+)[MKW]+|-x[MKW]+/\1/} . else COPTFLAGS+= ${_CPUCFLAGS} From owner-svn-src-head@FreeBSD.ORG Mon Sep 13 02:05:42 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8D8CA1065675; Mon, 13 Sep 2010 02:05:42 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7CD058FC1B; Mon, 13 Sep 2010 02:05:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8D25gRj047233; Mon, 13 Sep 2010 02:05:42 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8D25gaM047230; Mon, 13 Sep 2010 02:05:42 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201009130205.o8D25gaM047230@svn.freebsd.org> From: Warner Losh Date: Mon, 13 Sep 2010 02:05:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212523 - in head/sys/modules: scc sound/sound X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2010 02:05:42 -0000 Author: imp Date: Mon Sep 13 02:05:42 2010 New Revision: 212523 URL: http://svn.freebsd.org/changeset/base/212523 Log: MFtbemd: use MACHINE_CPUARCH Modified: head/sys/modules/scc/Makefile head/sys/modules/sound/sound/Makefile Modified: head/sys/modules/scc/Makefile ============================================================================== --- head/sys/modules/scc/Makefile Mon Sep 13 02:04:02 2010 (r212522) +++ head/sys/modules/scc/Makefile Mon Sep 13 02:05:42 2010 (r212523) @@ -5,7 +5,7 @@ .if ${MACHINE} == "sparc64" scc_bfe= scc_bfe_ebus.c scc_bfe_sbus.c .endif -.if ${MACHINE_ARCH} == "powerpc" +.if ${MACHINE_CPUARCH} == "powerpc" scc_bfe= scc_bfe_macio.c scc_bfe_quicc.c .endif Modified: head/sys/modules/sound/sound/Makefile ============================================================================== --- head/sys/modules/sound/sound/Makefile Mon Sep 13 02:04:02 2010 (r212522) +++ head/sys/modules/sound/sound/Makefile Mon Sep 13 02:05:42 2010 (r212523) @@ -44,7 +44,7 @@ CLEANFILES+= feeder_eq_gen.h feeder_rate EXPORT_SYMS= YES # XXX evaluate -.if ${MACHINE_ARCH} == "sparc64" || ${MACHINE_ARCH} == "powerpc" +.if ${MACHINE_CPUARCH} == "sparc64" || ${MACHINE_CPUARCH} == "powerpc" # Create an empty opt_isa.h in order to keep kmod.mk from linking in an # existing one from KERNBUILDDIR which possibly has DEV_ISA defined so # sound.ko is always built without isadma support. From owner-svn-src-head@FreeBSD.ORG Mon Sep 13 02:21:07 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 692871065695; Mon, 13 Sep 2010 02:21:07 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 57B0E8FC08; Mon, 13 Sep 2010 02:21:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8D2L7gW048708; Mon, 13 Sep 2010 02:21:07 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8D2L7IY048699; Mon, 13 Sep 2010 02:21:07 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201009130221.o8D2L7IY048699@svn.freebsd.org> From: Warner Losh Date: Mon, 13 Sep 2010 02:21:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212525 - head/usr.sbin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2010 02:21:07 -0000 Author: imp Date: Mon Sep 13 02:21:07 2010 New Revision: 212525 URL: http://svn.freebsd.org/changeset/base/212525 Log: Merge from tbemd: use Makefile.arch to control building. Reviewed by: arch@ (many times, no objection) Added: head/usr.sbin/Makefile.amd64 (contents, props changed) head/usr.sbin/Makefile.arm (contents, props changed) head/usr.sbin/Makefile.i386 (contents, props changed) head/usr.sbin/Makefile.ia64 (contents, props changed) head/usr.sbin/Makefile.mips (contents, props changed) head/usr.sbin/Makefile.orig (contents, props changed) head/usr.sbin/Makefile.powerpc (contents, props changed) head/usr.sbin/Makefile.sparc64 (contents, props changed) Modified: head/usr.sbin/Makefile Modified: head/usr.sbin/Makefile ============================================================================== --- head/usr.sbin/Makefile Mon Sep 13 02:10:29 2010 (r212524) +++ head/usr.sbin/Makefile Mon Sep 13 02:21:07 2010 (r212525) @@ -3,27 +3,9 @@ .include -SUBDIR= ${_ac} \ - ${_accton} \ - ${_acpi} \ - adduser \ - ${_amd} \ - ${_ancontrol} \ - ${_apm} \ - ${_apmd} \ +SUBDIR= adduser \ arp \ - ${_asf} \ - ${_atm} \ - ${_audit} \ - ${_auditd} \ - ${_auditreduce} \ - ${_authpf} \ - ${_bluetooth} \ - ${_boot0cfg} \ - ${_boot98cfg} \ bootparamd \ - ${_bsnmpd} \ - ${_btxld} \ burncd \ cdcontrol \ chkgrp \ @@ -31,153 +13,71 @@ SUBDIR= ${_ac} \ chroot \ ckdist \ clear_locks \ - ${_config} \ - ${_cpucontrol} \ crashinfo \ cron \ - ${_crunch} \ - ${_ctm} \ daemon \ dconschat \ devinfo \ digictl \ diskinfo \ - ${_dnssec-dsfromkey} \ - ${_dnssec-keyfromlabel} \ - ${_dnssec-keygen} \ - ${_dnssec-signzone} \ dumpcis \ - ${_editmap} \ - ${_edquota} \ - ${_eeprom} \ extattr \ extattrctl \ - ${_faithd} \ - ${_fdcontrol} \ - ${_fdformat} \ - ${_fdread} \ - ${_fdwrite} \ fifolog \ - ${_flowctl} \ - ${_freebsd-update} \ - ${_ftp-proxy} \ fwcontrol \ getfmac \ getpmac \ gstat \ - ${_gssd} \ i2c \ ifmcstat \ inetd \ iostat \ - ${_ip6addrctl} \ - ${_ipfwpcap} \ - ${_IPXrouted} \ - ${_jail} \ - ${_jexec} \ - ${_jls} \ - ${_kbdcontrol} \ - ${_kbdmap} \ - ${_keyserv} \ - ${_kgmon} \ - ${_kgzip} \ kldxref \ lastlogin \ - ${_lmcconfig} \ - ${_lpr} \ - ${_lptcontrol} \ - ${_mailstats} \ mailwrapper \ makefs \ - ${_makemap} \ - ${_manctl} \ + manctl \ memcontrol \ mergemaster \ mfiutil \ mixer \ - ${_mld6query} \ mlxcontrol \ mountd \ - ${_mount_nwfs} \ mount_portalfs \ - ${_mount_smbfs} \ - ${_moused} \ - ${_mptable} \ mptutil \ mtest \ mtree \ - ${_named} \ - ${_named-checkconf} \ - ${_named-checkzone} \ - ${_named.reload} \ - ${_ndiscvt} \ - ${_ndp} \ newsyslog \ nfscbd \ nfsd \ nfsdumpstate \ nfsrevoke \ nfsuserd \ - ${_ngctl} \ - ${_nghook} \ nologin \ - ${_nscd} \ - ${_ntp} \ - ${_nvram} \ - ${_ofwdump} \ pc-sysinstall \ pciconf \ periodic \ - ${_pkg_install} \ - ${_pmcannotate} \ - ${_pmccontrol} \ - ${_pmcstat} \ - ${_pnpinfo} \ - ${_portsnap} \ powerd \ - ${_ppp} \ - ${_pppctl} \ - ${_praliases} \ - ${_praudit} \ procctl \ pstat \ pw \ pwd_mkdb \ quot \ - ${_quotaon} \ rarpd \ - ${_repquota} \ - ${_rip6query} \ rmt \ - ${_rndc} \ - ${_rndc-confgen} \ - ${_route6d} \ rpcbind \ rpc.lockd \ rpc.statd \ rpc.umntall \ - ${_rpc.yppasswdd} \ - ${_rpc.ypupdated} \ - ${_rpc.ypxfrd} \ - ${_rrenumd} \ - ${_rtadvd} \ rtprio \ - ${_rtsold} \ - ${_rwhod} \ - ${_sa} \ - ${_sade} \ - ${_sendmail} \ service \ services_mkdb \ setfib \ setfmac \ setpmac \ - ${_sicontrol} \ smbmsg \ snapinfo \ - ${_spkrtest} \ spray \ - ${_sysinstall} \ syslogd \ tcpdchk \ tcpdmatch \ @@ -185,344 +85,220 @@ SUBDIR= ${_ac} \ tcpdump \ timed \ traceroute \ - ${_traceroute6} \ trpt \ tzsetup \ - ${_uathload} \ ugidfw \ - ${_uhsoctl} \ - ${_usbdevs} \ - ${_usbconfig} \ - ${_vidcontrol} \ vipw \ wake \ watch \ watchdogd \ - ${_wlandebug} \ - ${_wlconfig} \ - ${_wpa} \ - ${_ypbind} \ - ${_yp_mkdb} \ - ${_yppoll} \ - ${_yppush} \ - ${_ypserv} \ - ${_ypset} \ - zic \ - ${_zzz} + zic # NB: keep these sorted by MK_* knobs .if ${MK_ACCT} != "no" -_ac= ac -_accton= accton -_sa= sa +SUBDIR+= ac +SUBDIR+= accton +SUBDIR+= sa .endif .if ${MK_AMD} != "no" -_amd= amd +SUBDIR+= amd .endif .if ${MK_AUDIT} != "no" -_audit= audit -_auditd= auditd -_auditreduce= auditreduce -_praudit= praudit +SUBDIR+= audit +SUBDIR+= auditd +SUBDIR+= auditreduce +SUBDIR+= praudit .endif .if ${MK_AUTHPF} != "no" -_authpf= authpf +SUBDIR+= authpf .endif .if ${MK_BIND_DNSSEC} != "no" && ${MK_OPENSSL} != "no" -_dnssec-dsfromkey= dnssec-dsfromkey -_dnssec-keyfromlabel= dnssec-keyfromlabel -_dnssec-keygen= dnssec-keygen -_dnssec-signzone= dnssec-signzone +SUBDIR+= dnssec-dsfromkey +SUBDIR+= dnssec-keyfromlabel +SUBDIR+= dnssec-keygen +SUBDIR+= dnssec-signzone .endif .if ${MK_BIND_NAMED} != "no" -_named= named -_named-checkconf= named-checkconf -_named-checkzone= named-checkzone -_named.reload= named.reload -_rndc= rndc -_rndc-confgen= rndc-confgen +SUBDIR+= named +SUBDIR+= named-checkconf +SUBDIR+= named-checkzone +SUBDIR+= named.reload +SUBDIR+= rndc +SUBDIR+= rndc-confgen .endif .if ${MK_BLUETOOTH} != "no" -_bluetooth= bluetooth +SUBDIR+= bluetooth .endif .if ${MK_BSNMP} != "no" -_bsnmpd= bsnmpd +SUBDIR+= bsnmpd .endif .if ${MK_CTM} != "no" -_ctm= ctm +SUBDIR+= ctm .endif .if ${MK_FLOPPY} != "no" -_fdcontrol= fdcontrol -_fdformat= fdformat -_fdread= fdread -_fdwrite= fdwrite +SUBDIR+= fdcontrol +SUBDIR+= fdformat +SUBDIR+= fdread +SUBDIR+= fdwrite .endif .if ${MK_FREEBSD_UPDATE} != "no" -_freebsd-update= freebsd-update +SUBDIR+= freebsd-update .endif .if ${MK_GSSAPI} != no -_gssd= gssd +SUBDIR+= gssd .endif .if ${MK_INET6} != "no" -_faithd= faithd -_ip6addrctl= ip6addrctl -_mld6query= mld6query -_ndp= ndp -_rip6query= rip6query -_route6d= route6d -_rrenumd= rrenumd -_rtadvd= rtadvd -_rtsold= rtsold -_traceroute6= traceroute6 +SUBDIR+= faithd +SUBDIR+= ip6addrctl +SUBDIR+= mld6query +SUBDIR+= ndp +SUBDIR+= rip6query +SUBDIR+= route6d +SUBDIR+= rrenumd +SUBDIR+= rtadvd +SUBDIR+= rtsold +SUBDIR+= traceroute6 .endif .if ${MK_IPFW} != "no" -_ipfwpcap= ipfwpcap +SUBDIR+= ipfwpcap .endif .if ${MK_IPX} != "no" -_IPXrouted= IPXrouted +SUBDIR+= IPXrouted .endif .if ${MK_JAIL} != "no" -_jail= jail -_jexec= jexec -_jls= jls +SUBDIR+= jail +SUBDIR+= jexec +SUBDIR+= jls .endif # XXX MK_SYSCONS .if ${MK_LEGACY_CONSOLE} != "no" -_kbdcontrol= kbdcontrol -_kbdmap= kbdmap -_moused= moused -_vidcontrol= vidcontrol +SUBDIR+= kbdcontrol +SUBDIR+= kbdmap +SUBDIR+= moused +SUBDIR+= vidcontrol .endif .if ${MK_LIBTHR} != "no" || ${MK_LIBPTHREAD} != "no" .if ${MK_PPP} != "no" -_pppctl= pppctl +SUBDIR+= pppctl .endif .if ${MK_NS_CACHING} != "no" -_nscd= nscd +SUBDIR+= nscd .endif .endif .if ${MK_LPR} != "no" -_lpr= lpr +SUBDIR+= lpr .endif .if ${MK_MAN_UTILS} != "no" -_manctl= manctl +SUBDIR+= manctl .endif .if ${MK_NETGRAPH} != "no" -_flowctl= flowctl -_lmcconfig= lmcconfig -_ngctl= ngctl -_nghook= nghook +SUBDIR+= flowctl +SUBDIR+= lmcconfig +SUBDIR+= ngctl +SUBDIR+= nghook .endif .if ${MK_NIS} != "no" -_rpc.yppasswdd= rpc.yppasswdd -_rpc.ypupdated= rpc.ypupdated -_rpc.ypxfrd= rpc.ypxfrd -_ypbind= ypbind -_yp_mkdb= yp_mkdb -_yppoll= yppoll -_yppush= yppush -_ypserv= ypserv -_ypset= ypset +SUBDIR+= rpc.yppasswdd +SUBDIR+= rpc.ypupdated +SUBDIR+= rpc.ypxfrd +SUBDIR+= ypbind +SUBDIR+= yp_mkdb +SUBDIR+= yppoll +SUBDIR+= yppush +SUBDIR+= ypserv +SUBDIR+= ypset .endif .if ${MK_NTP} != "no" -_ntp= ntp +SUBDIR+= ntp .endif .if ${MK_OPENSSL} != "no" -_keyserv= keyserv +SUBDIR+= keyserv .endif .if ${MK_PF} != "no" -_ftp-proxy= ftp-proxy +SUBDIR+= ftp-proxy .endif .if ${MK_PKGTOOLS} != "no" -_pkg_install= pkg_install +SUBDIR+= pkg_install .endif # XXX MK_TOOLCHAIN? .if ${MK_PMC} != "no" -_pmcannotate= pmcannotate -_pmccontrol= pmccontrol -_pmcstat= pmcstat +SUBDIR+= pmcannotate +SUBDIR+= pmccontrol +SUBDIR+= pmcstat .endif .if ${MK_PORTSNAP} != "no" -_portsnap= portsnap +SUBDIR+= portsnap .endif .if ${MK_PPP} != "no" -_ppp= ppp -#_pppctl handled below +SUBDIR+= ppp .endif .if ${MK_QUOTAS} != "no" -_edquota= edquota -_quotaon= quotaon -_repquota= repquota +SUBDIR+= edquota +SUBDIR+= quotaon +SUBDIR+= repquota .endif .if ${MK_RCMDS} != "no" -_rwhod= rwhod +SUBDIR+= rwhod .endif .if ${MK_SENDMAIL} != "no" -_editmap= editmap -_mailstats= mailstats -_makemap= makemap -_praliases= praliases -_sendmail= sendmail +SUBDIR+= editmap +SUBDIR+= mailstats +SUBDIR+= makemap +SUBDIR+= praliases +SUBDIR+= sendmail .endif -.if ${MK_SYSINSTALL} != "no" -.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" || \ - ${MACHINE_ARCH} == "sparc64" -_sade= sade -.endif -.if ${MACHINE_ARCH} != "arm" && ${MACHINE_ARCH} != "mips" -_sysinstall= sysinstall -.endif -.endif +SUBDIR+= sysinstall .if ${MK_TOOLCHAIN} != "no" -_config= config -_crunch= crunch +SUBDIR+= config +SUBDIR+= crunch .endif .if ${MK_USB} != "no" -.if ${MACHINE_ARCH} != "ia64" && \ - !(${MACHINE_ARCH} == "mips" && defined(TARGET_ABI) && ${TARGET_ABI} == "n64") -_uathload= uathload -.endif -_uhsoctl= uhsoctl -#_usbdevs= usbdevs -_usbconfig= usbconfig +SUBDIR+= uhsoctl +SUBDIR+= usbconfig .endif .if ${MK_WIRELESS} != "no" -_ancontrol= ancontrol -_wlandebug= wlandebug -_wpa= wpa +SUBDIR+= ancontrol +SUBDIR+= wlandebug +SUBDIR+= wpa .endif -.if ${MACHINE_ARCH} == "arm" -_kgmon= kgmon -.endif +.include -.if ${MACHINE_ARCH} == "i386" -.if ${MK_APM} != "no" -_apm= apm -_apmd= apmd -.endif -_asf= asf -.if ${MK_TOOLCHAIN} != "no" -_btxld= btxld -.endif -_cpucontrol= cpucontrol -_kgmon= kgmon -_kgzip= kgzip -_lptcontrol= lptcontrol -.if ${MK_NCP} != "no" -_mount_nwfs= mount_nwfs -.endif -_mount_smbfs= mount_smbfs -_mptable= mptable -.if ${MK_NDIS} != "no" -_ndiscvt= ndiscvt -.endif -_pnpinfo= pnpinfo -_sicontrol= sicontrol -_spkrtest= spkrtest -_zzz= zzz -.if ${MACHINE} == "i386" -.if ${MK_ACPI} != "no" -_acpi= acpi -.endif -_boot0cfg= boot0cfg -.if ${MK_WIRELESS} != "no" -_wlconfig= wlconfig -.endif -.elif ${MACHINE} == "pc98" -_boot98cfg= boot98cfg -.endif -.endif - -# kgzip: builds, but missing support files -# mptable: broken (not 64 bit clean) -# pnpinfo: crashes (not really useful anyway) -.if ${MACHINE_ARCH} == "amd64" -.if ${MK_ACPI} != "no" -_acpi= acpi -.endif -.if ${MK_APM} != "no" -_apm= apm -.endif -_asf= asf -_boot0cfg= boot0cfg -.if ${MK_TOOLCHAIN} != "no" -_btxld= btxld -.endif -_cpucontrol= cpucontrol -_kgmon= kgmon -_lptcontrol= lptcontrol -.if ${MK_NCP} != "no" -_mount_nwfs= mount_nwfs -.endif -_mount_smbfs= mount_smbfs -_mptable= mptable -.if ${MK_NDIS} != "no" -_ndiscvt= ndiscvt -.endif -_sicontrol= sicontrol -_spkrtest= spkrtest -_zzz= zzz -.endif - -.if ${MACHINE_ARCH} == "arm" -_ofwdump= ofwdump -.endif - -.if ${MACHINE_ARCH} == "ia64" -.if ${MK_ACPI} != "no" -_acpi= acpi -.endif -_kgmon= kgmon -_mount_smbfs= mount_smbfs -_zzz= zzz -.endif - -.if ${MACHINE_CPUARCH} == "powerpc" -_mount_smbfs= mount_smbfs -_nvram= nvram -_ofwdump= ofwdump -.endif - -.if ${MACHINE_ARCH} == "sparc64" -_eeprom= eeprom -_mount_smbfs= mount_smbfs -_ofwdump= ofwdump -.endif +SUBDIR:= ${SUBDIR:O} .include Added: head/usr.sbin/Makefile.amd64 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/Makefile.amd64 Mon Sep 13 02:21:07 2010 (r212525) @@ -0,0 +1,30 @@ +# $FreeBSD$ + +# kgzip: builds, but missing support files +# mptable: broken (not 64 bit clean) +# pnpinfo: crashes (not really useful anyway) +.if ${MK_ACPI} != "no" +SUBDIR+= acpi +.endif +.if ${MK_APM} != "no" +SUBDIR+= apm +.endif +SUBDIR+= asf +SUBDIR+= boot0cfg +.if ${MK_TOOLCHAIN} != "no" +SUBDIR+= btxld +.endif +SUBDIR+= cpucontrol +SUBDIR+= kgmon +SUBDIR+= lptcontrol +.if ${MK_NCP} != "no" +SUBDIR+= mount_nwfs +.endif +SUBDIR+= mount_smbfs +SUBDIR+= mptable +.if ${MK_NDIS} != "no" +SUBDIR+= ndiscvt +.endif +SUBDIR+= sicontrol +SUBDIR+= spkrtest +SUBDIR+= zzz Added: head/usr.sbin/Makefile.arm ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/Makefile.arm Mon Sep 13 02:21:07 2010 (r212525) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +SUBDIR+= ofwdump +SUBDIR+= kgmon +SUBDIR:= ${SUBDIR:Nsysinstall} Added: head/usr.sbin/Makefile.i386 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/Makefile.i386 Mon Sep 13 02:21:07 2010 (r212525) @@ -0,0 +1,42 @@ +# $FreeBSD$ + +.if ${MK_APM} != "no" +SUBDIR+= apm +SUBDIR+= apmd +.endif +SUBDIR+= asf +.if ${MK_TOOLCHAIN} != "no" +SUBDIR+= btxld +.endif +SUBDIR+= cpucontrol +SUBDIR+= kgmon +SUBDIR+= kgzip +SUBDIR+= lptcontrol +.if ${MK_NCP} != "no" +SUBDIR+= mount_nwfs +.endif +SUBDIR+= mount_smbfs +SUBDIR+= mptable +.if ${MK_NDIS} != "no" +SUBDIR+= ndiscvt +.endif +SUBDIR+= pnpinfo +.if ${MK_SYSINSTALL} != "no" +SUBDIR+= sade +.endif +SUBDIR+= sicontrol +SUBDIR+= spkrtest +SUBDIR+= zzz + +# Differentiate between FreeBSD/i386 and FreeBSD/pc98 +.if ${MACHINE} == "i386" +.if ${MK_ACPI} != "no" +SUBDIR+= acpi +.endif +SUBDIR+= boot0cfg +.if ${MK_WIRELESS} != "no" +SUBDIR+= wlconfig +.endif +.elif ${MACHINE} == "pc98" +SUBDIR+= boot98cfg +.endif Added: head/usr.sbin/Makefile.ia64 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/Makefile.ia64 Mon Sep 13 02:21:07 2010 (r212525) @@ -0,0 +1,9 @@ +# $FreeBSD$ + +.if ${MK_ACPI} != "no" +SUBDIR+= acpi +.endif +SUBDIR+= kgmon +SUBDIR+= mount_smbfs +SUBDIR:= ${SUBDIR:Nuathload} +SUBDIR+= zzz Added: head/usr.sbin/Makefile.mips ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/Makefile.mips Mon Sep 13 02:21:07 2010 (r212525) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +SUBDIR:= ${SUBDIR:Nsysinstall} +.if defined(TARGET_ABI) && ${TARGET_ABI} == "n64" +SUBDIR:= ${SUBDIR:Nuathload} +.endif Added: head/usr.sbin/Makefile.orig ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/Makefile.orig Mon Sep 13 02:21:07 2010 (r212525) @@ -0,0 +1,528 @@ +# From: @(#)Makefile 5.20 (Berkeley) 6/12/93 +# $FreeBSD$ + +.include + +SUBDIR= ${_ac} \ + ${_accton} \ + ${_acpi} \ + adduser \ + ${_amd} \ + ${_ancontrol} \ + ${_apm} \ + ${_apmd} \ + arp \ + ${_asf} \ + ${_atm} \ + ${_audit} \ + ${_auditd} \ + ${_auditreduce} \ + ${_authpf} \ + ${_bluetooth} \ + ${_boot0cfg} \ + ${_boot98cfg} \ + bootparamd \ + ${_bsnmpd} \ + ${_btxld} \ + burncd \ + cdcontrol \ + chkgrp \ + chown \ + chroot \ + ckdist \ + clear_locks \ + ${_config} \ + ${_cpucontrol} \ + crashinfo \ + cron \ + ${_crunch} \ + ${_ctm} \ + daemon \ + dconschat \ + devinfo \ + digictl \ + diskinfo \ + ${_dnssec-dsfromkey} \ + ${_dnssec-keyfromlabel} \ + ${_dnssec-keygen} \ + ${_dnssec-signzone} \ + dumpcis \ + ${_editmap} \ + ${_edquota} \ + ${_eeprom} \ + extattr \ + extattrctl \ + ${_faithd} \ + ${_fdcontrol} \ + ${_fdformat} \ + ${_fdread} \ + ${_fdwrite} \ + fifolog \ + ${_flowctl} \ + ${_freebsd-update} \ + ${_ftp-proxy} \ + fwcontrol \ + getfmac \ + getpmac \ + gstat \ + ${_gssd} \ + i2c \ + ifmcstat \ + inetd \ + iostat \ + ${_ip6addrctl} \ + ${_ipfwpcap} \ + ${_IPXrouted} \ + ${_jail} \ + ${_jexec} \ + ${_jls} \ + ${_kbdcontrol} \ + ${_kbdmap} \ + ${_keyserv} \ + ${_kgmon} \ + ${_kgzip} \ + kldxref \ + lastlogin \ + ${_lmcconfig} \ + ${_lpr} \ + ${_lptcontrol} \ + ${_mailstats} \ + mailwrapper \ + makefs \ + ${_makemap} \ + ${_manctl} \ + memcontrol \ + mergemaster \ + mfiutil \ + mixer \ + ${_mld6query} \ + mlxcontrol \ + mountd \ + ${_mount_nwfs} \ + mount_portalfs \ + ${_mount_smbfs} \ + ${_moused} \ + ${_mptable} \ + mptutil \ + mtest \ + mtree \ + ${_named} \ + ${_named-checkconf} \ + ${_named-checkzone} \ + ${_named.reload} \ + ${_ndiscvt} \ + ${_ndp} \ + newsyslog \ + nfscbd \ + nfsd \ + nfsdumpstate \ + nfsrevoke \ + nfsuserd \ + ${_ngctl} \ + ${_nghook} \ + nologin \ + ${_nscd} \ + ${_ntp} \ + ${_nvram} \ + ${_ofwdump} \ + pc-sysinstall \ + pciconf \ + periodic \ + ${_pkg_install} \ + ${_pmcannotate} \ + ${_pmccontrol} \ + ${_pmcstat} \ + ${_pnpinfo} \ + ${_portsnap} \ + powerd \ + ${_ppp} \ + ${_pppctl} \ + ${_praliases} \ + ${_praudit} \ + procctl \ + pstat \ + pw \ + pwd_mkdb \ + quot \ + ${_quotaon} \ + rarpd \ + ${_repquota} \ + ${_rip6query} \ + rmt \ + ${_rndc} \ + ${_rndc-confgen} \ + ${_route6d} \ + rpcbind \ + rpc.lockd \ + rpc.statd \ + rpc.umntall \ + ${_rpc.yppasswdd} \ + ${_rpc.ypupdated} \ + ${_rpc.ypxfrd} \ + ${_rrenumd} \ + ${_rtadvd} \ + rtprio \ + ${_rtsold} \ + ${_rwhod} \ + ${_sa} \ + ${_sade} \ + ${_sendmail} \ + service \ + services_mkdb \ + setfib \ + setfmac \ + setpmac \ + ${_sicontrol} \ + smbmsg \ + snapinfo \ + ${_spkrtest} \ + spray \ + ${_sysinstall} \ + syslogd \ + tcpdchk \ + tcpdmatch \ + tcpdrop \ + tcpdump \ + timed \ + traceroute \ + ${_traceroute6} \ + trpt \ + tzsetup \ + ${_uathload} \ + ugidfw \ + ${_uhsoctl} \ + ${_usbdevs} \ + ${_usbconfig} \ + ${_vidcontrol} \ + vipw \ + wake \ + watch \ + watchdogd \ + ${_wlandebug} \ + ${_wlconfig} \ + ${_wpa} \ + ${_ypbind} \ + ${_yp_mkdb} \ + ${_yppoll} \ + ${_yppush} \ + ${_ypserv} \ + ${_ypset} \ + zic \ + ${_zzz} + +# NB: keep these sorted by MK_* knobs + +.if ${MK_ACCT} != "no" +_ac= ac +_accton= accton +_sa= sa +.endif + +.if ${MK_AMD} != "no" +_amd= amd +.endif + +.if ${MK_AUDIT} != "no" +_audit= audit +_auditd= auditd +_auditreduce= auditreduce +_praudit= praudit +.endif + +.if ${MK_AUTHPF} != "no" +_authpf= authpf +.endif + +.if ${MK_BIND_DNSSEC} != "no" && ${MK_OPENSSL} != "no" +_dnssec-dsfromkey= dnssec-dsfromkey +_dnssec-keyfromlabel= dnssec-keyfromlabel +_dnssec-keygen= dnssec-keygen +_dnssec-signzone= dnssec-signzone +.endif +.if ${MK_BIND_NAMED} != "no" +_named= named +_named-checkconf= named-checkconf +_named-checkzone= named-checkzone +_named.reload= named.reload +_rndc= rndc +_rndc-confgen= rndc-confgen +.endif + +.if ${MK_BLUETOOTH} != "no" +_bluetooth= bluetooth +.endif + +.if ${MK_BSNMP} != "no" +_bsnmpd= bsnmpd +.endif + +.if ${MK_CTM} != "no" +_ctm= ctm +.endif + +.if ${MK_FLOPPY} != "no" +_fdcontrol= fdcontrol +_fdformat= fdformat +_fdread= fdread *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Mon Sep 13 02:23:03 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BFE0E106564A; Mon, 13 Sep 2010 02:23:03 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 952D78FC2A; Mon, 13 Sep 2010 02:23:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8D2N3hj048963; Mon, 13 Sep 2010 02:23:03 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8D2N3aH048957; Mon, 13 Sep 2010 02:23:03 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201009130223.o8D2N3aH048957@svn.freebsd.org> From: Warner Losh Date: Mon, 13 Sep 2010 02:23:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212526 - head/usr.bin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2010 02:23:03 -0000 Author: imp Date: Mon Sep 13 02:23:03 2010 New Revision: 212526 URL: http://svn.freebsd.org/changeset/base/212526 Log: Merge from tbemd: Move to using Makefile.arch to control what's build. Reviewed by: (arch@, no objection) Added: head/usr.bin/Makefile.amd64 (contents, props changed) head/usr.bin/Makefile.arm (contents, props changed) head/usr.bin/Makefile.i386 (contents, props changed) head/usr.bin/Makefile.ia64 (contents, props changed) head/usr.bin/Makefile.powerpc (contents, props changed) head/usr.bin/Makefile.sparc64 (contents, props changed) Added: head/usr.bin/Makefile.amd64 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/Makefile.amd64 Mon Sep 13 02:23:03 2010 (r212526) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +.if ${MK_NCP} != "no" +SUBDIR+= ncplist +SUBDIR+= ncplogin +.endif +SUBDIR+= smbutil Added: head/usr.bin/Makefile.arm ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/Makefile.arm Mon Sep 13 02:23:03 2010 (r212526) @@ -0,0 +1,3 @@ +# $FreeBSD$ + +SUBDIR:= ${SUBDIR:Ntruss} Added: head/usr.bin/Makefile.i386 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/Makefile.i386 Mon Sep 13 02:23:03 2010 (r212526) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +.if ${MK_NCP} != "no" +SUBDIR+= ncplist +SUBDIR+= ncplogin +.endif +SUBDIR+= smbutil Added: head/usr.bin/Makefile.ia64 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/Makefile.ia64 Mon Sep 13 02:23:03 2010 (r212526) @@ -0,0 +1,3 @@ +# $FreeBSD$ + +SUBDIR+= smbutil Added: head/usr.bin/Makefile.powerpc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/Makefile.powerpc Mon Sep 13 02:23:03 2010 (r212526) @@ -0,0 +1,3 @@ +# $FreeBSD$ + +SUBDIR+= smbutil Added: head/usr.bin/Makefile.sparc64 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/Makefile.sparc64 Mon Sep 13 02:23:03 2010 (r212526) @@ -0,0 +1,3 @@ +# $FreeBSD$ + +SUBDIR+= smbutil From owner-svn-src-head@FreeBSD.ORG Mon Sep 13 02:24:14 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EBB0F1065673; Mon, 13 Sep 2010 02:24:14 +0000 (UTC) (envelope-from andy@fud.org.nz) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id 19AE28FC17; Mon, 13 Sep 2010 02:24:13 +0000 (UTC) Received: by wwb18 with SMTP id 18so6694875wwb.31 for ; Sun, 12 Sep 2010 19:24:13 -0700 (PDT) MIME-Version: 1.0 Received: by 10.227.69.78 with SMTP id y14mr2373831wbi.212.1284344650539; Sun, 12 Sep 2010 19:24:10 -0700 (PDT) Sender: andy@fud.org.nz Received: by 10.227.147.76 with HTTP; Sun, 12 Sep 2010 19:24:10 -0700 (PDT) In-Reply-To: <201009130221.o8D2L7IY048699@svn.freebsd.org> References: <201009130221.o8D2L7IY048699@svn.freebsd.org> Date: Mon, 13 Sep 2010 14:24:10 +1200 X-Google-Sender-Auth: S0pjQEKQpl0cZXbVmUa6ejdx1ck Message-ID: From: Andrew Thompson To: Warner Losh Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r212525 - head/usr.sbin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2010 02:24:15 -0000 On 13 September 2010 14:21, Warner Losh wrote: > Author: imp > Date: Mon Sep 13 02:21:07 2010 > New Revision: 212525 > URL: http://svn.freebsd.org/changeset/base/212525 > > Log: > =A0Merge from tbemd: use Makefile.arch to control building. > > =A0Reviewed by: =A0arch@ (many times, no objection) > > Added: > =A0head/usr.sbin/Makefile.amd64 =A0 (contents, props changed) > =A0head/usr.sbin/Makefile.arm =A0 (contents, props changed) > =A0head/usr.sbin/Makefile.i386 =A0 (contents, props changed) > =A0head/usr.sbin/Makefile.ia64 =A0 (contents, props changed) > =A0head/usr.sbin/Makefile.mips =A0 (contents, props changed) > =A0head/usr.sbin/Makefile.orig =A0 (contents, props changed) ^^ oops. > =A0head/usr.sbin/Makefile.powerpc =A0 (contents, props changed) > =A0head/usr.sbin/Makefile.sparc64 =A0 (contents, props changed) > Modified: > =A0head/usr.sbin/Makefile From owner-svn-src-head@FreeBSD.ORG Mon Sep 13 02:25:21 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E844A106564A; Mon, 13 Sep 2010 02:25:21 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D75D98FC1B; Mon, 13 Sep 2010 02:25:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8D2PL6c049204; Mon, 13 Sep 2010 02:25:21 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8D2PL6A049195; Mon, 13 Sep 2010 02:25:21 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201009130225.o8D2PL6A049195@svn.freebsd.org> From: Warner Losh Date: Mon, 13 Sep 2010 02:25:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212527 - head/sbin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2010 02:25:22 -0000 Author: imp Date: Mon Sep 13 02:25:21 2010 New Revision: 212527 URL: http://svn.freebsd.org/changeset/base/212527 Log: MF tbemd: Move to using Makefile.arch to select what to build. Reviewed by: arch@ (no objection) Added: head/sbin/Makefile.amd64 (contents, props changed) head/sbin/Makefile.arm (contents, props changed) head/sbin/Makefile.i386 (contents, props changed) head/sbin/Makefile.ia64 (contents, props changed) head/sbin/Makefile.mips (contents, props changed) head/sbin/Makefile.pc98 (contents, props changed) head/sbin/Makefile.sparc64 (contents, props changed) Modified: head/sbin/Makefile Modified: head/sbin/Makefile ============================================================================== --- head/sbin/Makefile Mon Sep 13 02:23:03 2010 (r212526) +++ head/sbin/Makefile Mon Sep 13 02:25:21 2010 (r212527) @@ -5,26 +5,21 @@ # XXX MISSING: icheck ncheck -SUBDIR= adjkerntz \ +SUBDIR=adjkerntz \ atacontrol \ - ${_atm} \ badsect \ - ${_bsdlabel} \ camcontrol \ ccdconfig \ clri \ comcontrol \ conscontrol \ ddb \ - ${_devd} \ devfs \ dhclient \ dmesg \ dump \ dumpfs \ dumpon \ - ${_fdisk} \ - ${_fdisk_pc98} \ ffsinfo \ fsck \ fsck_ffs \ @@ -40,15 +35,12 @@ SUBDIR= adjkerntz \ hastd \ ifconfig \ init \ - ${_ipf} \ - ${_ipfw} \ iscontrol \ kldconfig \ kldload \ kldstat \ kldunload \ ldconfig \ - ${_mca} \ md5 \ mdconfig \ mdmfs \ @@ -62,96 +54,62 @@ SUBDIR= adjkerntz \ mount_nullfs \ mount_udf \ mount_unionfs \ - ${_natd} \ newfs \ newfs_msdos \ nfsiod \ nos-tun \ - ${_pfctl} \ - ${_pflogd} \ ping \ - ${_ping6} \ - ${_quotacheck} \ rcorder \ reboot \ recoverdisk \ restore \ route \ - ${_routed} \ - ${_rtsol} \ savecore \ - ${_sconfig} \ setkey \ shutdown \ spppcontrol \ - ${_sunlabel} \ swapon \ sysctl \ tunefs \ umount \ .if ${MK_ATM} != "no" -_atm= atm +SUBDIR+= atm .endif .if ${MK_CXX} != "no" -_devd= devd +SUBDIR+= devd .endif .if ${MK_IPFILTER} != "no" -_ipf= ipf +SUBDIR+= ipf .endif .if ${MK_IPFW} != "no" -_ipfw= ipfw -_natd= natd +SUBDIR+= ipfw +SUBDIR+= natd .endif .if ${MK_PF} != "no" -_pfctl= pfctl -_pflogd= pflogd +SUBDIR+= pfctl +SUBDIR+= pflogd .endif .if ${MK_INET6} != "no" -_ping6= ping6 -_rtsol= rtsol -.endif - -.if ${MACHINE_ARCH} != "ia64" && ${MACHINE_ARCH} != "powerpc" -_bsdlabel= bsdlabel +SUBDIR+= ping6 +SUBDIR+= rtsol .endif .if ${MK_QUOTAS} != "no" -_quotacheck= quotacheck +SUBDIR+= quotacheck .endif .if ${MK_ROUTED} != "no" -_routed= routed -.endif - -.if ${MACHINE_ARCH} == "i386" -.if ${MACHINE} == "i386" -_fdisk= fdisk -.elif ${MACHINE} == "pc98" -_fdisk_pc98= fdisk_pc98 -.endif -_sconfig= sconfig +SUBDIR+= routed .endif -.if ${MACHINE_ARCH} == "amd64" -_fdisk= fdisk -.endif +.include -.if ${MACHINE_ARCH} == "arm" -_fdisk= fdisk -.endif - -.if ${MACHINE_ARCH} == "ia64" -_mca= mca -.endif - -.if ${MACHINE_ARCH} == "sparc64" -_sunlabel= sunlabel -.endif +SUBDIR:= ${SUBDIR:O} .include Added: head/sbin/Makefile.amd64 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/Makefile.amd64 Mon Sep 13 02:25:21 2010 (r212527) @@ -0,0 +1,4 @@ +# $FreeBSD$ + +SUBDIR += bsdlabel +SUBDIR += fdisk Added: head/sbin/Makefile.arm ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/Makefile.arm Mon Sep 13 02:25:21 2010 (r212527) @@ -0,0 +1,4 @@ +# $FreeBSD$ + +SUBDIR += bsdlabel +SUBDIR += fdisk Added: head/sbin/Makefile.i386 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/Makefile.i386 Mon Sep 13 02:25:21 2010 (r212527) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +SUBDIR += bsdlabel +SUBDIR += fdisk +SUBDIR += sconfig Added: head/sbin/Makefile.ia64 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/Makefile.ia64 Mon Sep 13 02:25:21 2010 (r212527) @@ -0,0 +1,3 @@ +# $FreeBSD$ + +SUBDIR += mca Added: head/sbin/Makefile.mips ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/Makefile.mips Mon Sep 13 02:25:21 2010 (r212527) @@ -0,0 +1,4 @@ +# $FreeBSD$ + +SUBDIR += bsdlabel +SUBDIR += fdisk Added: head/sbin/Makefile.pc98 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/Makefile.pc98 Mon Sep 13 02:25:21 2010 (r212527) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +SUBDIR += bsdlabel +SUBDIR += fdisk_pc98 +SUBDIR += sconfig Added: head/sbin/Makefile.sparc64 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/Makefile.sparc64 Mon Sep 13 02:25:21 2010 (r212527) @@ -0,0 +1,4 @@ +# $FreeBSD$ + +SUBDIR += bsdlabel +SUBDIR += sunlabel From owner-svn-src-head@FreeBSD.ORG Mon Sep 13 02:26:36 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DA587106564A; Mon, 13 Sep 2010 02:26:36 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B007B8FC1B; Mon, 13 Sep 2010 02:26:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8D2QaVr049348; Mon, 13 Sep 2010 02:26:36 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8D2QaMS049347; Mon, 13 Sep 2010 02:26:36 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201009130226.o8D2QaMS049347@svn.freebsd.org> From: Warner Losh Date: Mon, 13 Sep 2010 02:26:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212528 - head/usr.sbin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2010 02:26:36 -0000 Author: imp Date: Mon Sep 13 02:26:36 2010 New Revision: 212528 URL: http://svn.freebsd.org/changeset/base/212528 Log: Ooops! Shouldn't have committed this Deleted: head/usr.sbin/Makefile.orig From owner-svn-src-head@FreeBSD.ORG Mon Sep 13 02:32:52 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6EA101065673; Mon, 13 Sep 2010 02:32:52 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 2DC8D8FC0C; Mon, 13 Sep 2010 02:32:52 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o8D2Tfo8054414; Sun, 12 Sep 2010 20:29:41 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Sun, 12 Sep 2010 20:29:47 -0600 (MDT) Message-Id: <20100912.202947.503161978555406698.imp@bsdimp.com> To: thompsa@FreeBSD.ORG From: "M. Warner Losh" In-Reply-To: References: <201009130221.o8D2L7IY048699@svn.freebsd.org> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG Subject: Re: svn commit: r212525 - head/usr.sbin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2010 02:32:52 -0000 In message: Andrew Thompson writes: : On 13 September 2010 14:21, Warner Losh wrote: : > Author: imp : > Date: Mon Sep 13 02:21:07 2010 : > New Revision: 212525 : > URL: http://svn.freebsd.org/changeset/base/212525 : > : > Log: : > =A0Merge from tbemd: use Makefile.arch to control building. : > : > =A0Reviewed by: =A0arch@ (many times, no objection) : > : > Added: : > =A0head/usr.sbin/Makefile.amd64 =A0 (contents, props changed) : > =A0head/usr.sbin/Makefile.arm =A0 (contents, props changed) : > =A0head/usr.sbin/Makefile.i386 =A0 (contents, props changed) : > =A0head/usr.sbin/Makefile.ia64 =A0 (contents, props changed) : > =A0head/usr.sbin/Makefile.mips =A0 (contents, props changed) : > =A0head/usr.sbin/Makefile.orig =A0 (contents, props changed) : = : ^^ oops. Yea, noticed when I almost made the mistake again. Fixed. Thanks! Others? Warner From owner-svn-src-head@FreeBSD.ORG Mon Sep 13 04:23:23 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B9C30106564A; Mon, 13 Sep 2010 04:23:23 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8F4048FC08; Mon, 13 Sep 2010 04:23:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8D4NNb2059157; Mon, 13 Sep 2010 04:23:23 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8D4NNaW059155; Mon, 13 Sep 2010 04:23:23 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201009130423.o8D4NNaW059155@svn.freebsd.org> From: Warner Losh Date: Mon, 13 Sep 2010 04:23:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212531 - head/lib/msun X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2010 04:23:23 -0000 Author: imp Date: Mon Sep 13 04:23:23 2010 New Revision: 212531 URL: http://svn.freebsd.org/changeset/base/212531 Log: This is exactly the same as the .else, so remove it. Modified: head/lib/msun/Makefile Modified: head/lib/msun/Makefile ============================================================================== --- head/lib/msun/Makefile Mon Sep 13 02:35:48 2010 (r212530) +++ head/lib/msun/Makefile Mon Sep 13 04:23:23 2010 (r212531) @@ -14,8 +14,6 @@ .if ${MACHINE_CPUARCH} == "i386" ARCH_SUBDIR= i387 -.elif ${MACHINE_ARCH} == "powerpc64" -ARCH_SUBDIR= powerpc .else ARCH_SUBDIR= ${MACHINE_CPUARCH} .endif From owner-svn-src-head@FreeBSD.ORG Mon Sep 13 05:03:37 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F1751065675; Mon, 13 Sep 2010 05:03:37 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 53B438FC14; Mon, 13 Sep 2010 05:03:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8D53bbx062320; Mon, 13 Sep 2010 05:03:37 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8D53bxm062316; Mon, 13 Sep 2010 05:03:37 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201009130503.o8D53bxm062316@svn.freebsd.org> From: "Jayachandran C." Date: Mon, 13 Sep 2010 05:03:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212532 - in head/sys: conf mips/include mips/mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2010 05:03:37 -0000 Author: jchandra Date: Mon Sep 13 05:03:37 2010 New Revision: 212532 URL: http://svn.freebsd.org/changeset/base/212532 Log: The functions in sys/mips/mips/psraccess.S can be implemented with mips_rd_status/mips_wr_status. Implement them in mips/include/cpufunc.h, and remove psraccess.S. Reviewed by: neel, imp Deleted: head/sys/mips/mips/psraccess.S Modified: head/sys/conf/files.mips head/sys/mips/include/cpufunc.h head/sys/mips/include/md_var.h Modified: head/sys/conf/files.mips ============================================================================== --- head/sys/conf/files.mips Mon Sep 13 04:23:23 2010 (r212531) +++ head/sys/conf/files.mips Mon Sep 13 05:03:37 2010 (r212532) @@ -22,7 +22,6 @@ mips/mips/machdep.c standard mips/mips/mp_machdep.c optional smp mips/mips/mpboot.S optional smp -mips/mips/psraccess.S standard # ---------------------------------------------------------------------- # Phase 3 # ---------------------------------------------------------------------- Modified: head/sys/mips/include/cpufunc.h ============================================================================== --- head/sys/mips/include/cpufunc.h Mon Sep 13 04:23:23 2010 (r212531) +++ head/sys/mips/include/cpufunc.h Mon Sep 13 05:03:37 2010 (r212532) @@ -266,6 +266,24 @@ intr_restore(register_t ie) } } +static __inline uint32_t +set_intr_mask(uint32_t mask) +{ + uint32_t ostatus; + + ostatus = mips_rd_status(); + mask = (ostatus & ~MIPS_SR_INT_MASK) | (~mask & MIPS_SR_INT_MASK); + mips_wr_status(mask); + return (ostatus); +} + +static __inline uint32_t +get_intr_mask(void) +{ + + return (mips_rd_status() & MIPS_SR_INT_MASK); +} + static __inline void breakpoint(void) { Modified: head/sys/mips/include/md_var.h ============================================================================== --- head/sys/mips/include/md_var.h Mon Sep 13 04:23:23 2010 (r212531) +++ head/sys/mips/include/md_var.h Mon Sep 13 05:03:37 2010 (r212532) @@ -75,9 +75,5 @@ void mips_postboot_fixup(void); void platform_identify(void); extern int busdma_swi_pending; -void busdma_swi(void); - -u_int32_t set_intr_mask(u_int32_t); -u_int32_t get_intr_mask(void); - +void busdma_swi(void); #endif /* !_MACHINE_MD_VAR_H_ */ From owner-svn-src-head@FreeBSD.ORG Mon Sep 13 06:32:56 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BB993106566C; Mon, 13 Sep 2010 06:32:56 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AB1FD8FC0C; Mon, 13 Sep 2010 06:32:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8D6Wu6j068980; Mon, 13 Sep 2010 06:32:56 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8D6WuWr068978; Mon, 13 Sep 2010 06:32:56 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201009130632.o8D6WuWr068978@svn.freebsd.org> From: Alexander Motin Date: Mon, 13 Sep 2010 06:32:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212533 - head/sys/dev/acpica X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2010 06:32:56 -0000 Author: mav Date: Mon Sep 13 06:32:56 2010 New Revision: 212533 URL: http://svn.freebsd.org/changeset/base/212533 Log: Add tunable 'hint.hpet.X.per_cpu' to specify how much per-CPU timers driver should provide if there is sufficient hardware. Default is 1. Modified: head/sys/dev/acpica/acpi_hpet.c Modified: head/sys/dev/acpica/acpi_hpet.c ============================================================================== --- head/sys/dev/acpica/acpi_hpet.c Mon Sep 13 05:03:37 2010 (r212532) +++ head/sys/dev/acpica/acpi_hpet.c Mon Sep 13 06:32:56 2010 (r212533) @@ -74,6 +74,7 @@ struct hpet_softc { int irq; int useirq; int legacy_route; + int per_cpu; uint32_t allowed_irqs; struct resource *mem_res; struct resource *intr_res; @@ -501,6 +502,11 @@ hpet_attach(device_t dev) resource_int_value(device_get_name(dev), device_get_unit(dev), "allowed_irqs", &sc->allowed_irqs); + /* Get how much per-CPU timers we should try to provide. */ + sc->per_cpu = 1; + resource_int_value(device_get_name(dev), device_get_unit(dev), + "per_cpu", &sc->per_cpu); + num_msi = 0; sc->useirq = 0; /* Find IRQ vectors for all timers. */ @@ -556,7 +562,7 @@ hpet_attach(device_t dev) if (sc->legacy_route) hpet_enable(sc); /* Group timers for per-CPU operation. */ - num_percpu_et = min(num_msi / mp_ncpus, 1); + num_percpu_et = min(num_msi / mp_ncpus, sc->per_cpu); num_percpu_t = num_percpu_et * mp_ncpus; pcpu_master = 0; cur_cpu = CPU_FIRST(); From owner-svn-src-head@FreeBSD.ORG Mon Sep 13 06:35:35 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 73179106566B; Mon, 13 Sep 2010 06:35:35 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 47C918FC17; Mon, 13 Sep 2010 06:35:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8D6ZZL1069206; Mon, 13 Sep 2010 06:35:35 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8D6ZZIl069203; Mon, 13 Sep 2010 06:35:35 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201009130635.o8D6ZZIl069203@svn.freebsd.org> From: Warner Losh Date: Mon, 13 Sep 2010 06:35:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212534 - in head/usr.bin/xlint: . arch/powerpc arch/powerpc64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2010 06:35:35 -0000 Author: imp Date: Mon Sep 13 06:35:35 2010 New Revision: 212534 URL: http://svn.freebsd.org/changeset/base/212534 Log: Revert r212513 and reimplement the search order to be ARCH, CPUARCH Added: head/usr.bin/xlint/arch/powerpc64/ - copied from r212512, head/usr.bin/xlint/arch/powerpc64/ Modified: head/usr.bin/xlint/Makefile.inc head/usr.bin/xlint/arch/powerpc/targparam.h Modified: head/usr.bin/xlint/Makefile.inc ============================================================================== --- head/usr.bin/xlint/Makefile.inc Mon Sep 13 06:32:56 2010 (r212533) +++ head/usr.bin/xlint/Makefile.inc Mon Sep 13 06:35:35 2010 (r212534) @@ -7,14 +7,17 @@ WARNS?= 0 # These assignments duplicate much of the functionality of # MACHINE_CPUARCH, but there's no easy way to export make functions... - .if defined(TARGET_ARCH) -TARGET_CPUARCH=${TARGET_ARCH:C/mipse[bl]/mips/:C/armeb/arm/} +TARGET_CPUARCH= ${TARGET_ARCH:C/mipse[bl]/mips/:C/armeb/arm/} .else -TARGET_CPUARCH=${MACHINE_CPUARCH} +TARGET_CPUARCH= ${MACHINE_CPUARCH} +TARGET_ARCH= ${MACHINE_ARCH} .endif -TARGET_ARCH?= ${MACHINE_ARCH} +.if exists(${.CURDIR}/../arch/${TARGET_ARCH} +CFLAGS+= -I${.CURDIR}/../arch/${TARGET_ARCH} +.else CFLAGS+= -I${.CURDIR}/../arch/${TARGET_CPUARCH} +.enidf CFLAGS+= -I${.CURDIR}/../common OBJECT_FMT= ELF Modified: head/usr.bin/xlint/arch/powerpc/targparam.h ============================================================================== --- head/usr.bin/xlint/arch/powerpc/targparam.h Mon Sep 13 06:32:56 2010 (r212533) +++ head/usr.bin/xlint/arch/powerpc/targparam.h Mon Sep 13 06:35:35 2010 (r212534) @@ -37,11 +37,7 @@ * Machine-dependent target parameters for lint1. */ -#ifdef __powerpc64__ -#include "lp64.h" -#else #include "ilp32.h" -#endif /* * Should be set to 1 if the difference of two pointers is of type long @@ -49,13 +45,8 @@ * kept in sync with the compiler! */ -#ifdef __powerpc64__ -#define PTRDIFF_IS_LONG 1 -#define SIZEOF_IS_ULONG 1 -#else #define PTRDIFF_IS_LONG 0 #define SIZEOF_IS_ULONG 0 -#endif #define FLOAT_SIZE (4 * CHAR_BIT) #define DOUBLE_SIZE (8 * CHAR_BIT) From owner-svn-src-head@FreeBSD.ORG Mon Sep 13 06:50:07 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AFF32106566B; Mon, 13 Sep 2010 06:50:07 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9F9D28FC25; Mon, 13 Sep 2010 06:50:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8D6o7qH070201; Mon, 13 Sep 2010 06:50:07 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8D6o7Jx070199; Mon, 13 Sep 2010 06:50:07 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201009130650.o8D6o7Jx070199@svn.freebsd.org> From: Warner Losh Date: Mon, 13 Sep 2010 06:50:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212535 - head/usr.bin/xlint X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2010 06:50:07 -0000 Author: imp Date: Mon Sep 13 06:50:07 2010 New Revision: 212535 URL: http://svn.freebsd.org/changeset/base/212535 Log: Doh! two last second refactoring typos crept in. Fix. Modified: head/usr.bin/xlint/Makefile.inc Modified: head/usr.bin/xlint/Makefile.inc ============================================================================== --- head/usr.bin/xlint/Makefile.inc Mon Sep 13 06:35:35 2010 (r212534) +++ head/usr.bin/xlint/Makefile.inc Mon Sep 13 06:50:07 2010 (r212535) @@ -13,11 +13,11 @@ TARGET_CPUARCH= ${TARGET_ARCH:C/mipse[bl TARGET_CPUARCH= ${MACHINE_CPUARCH} TARGET_ARCH= ${MACHINE_ARCH} .endif -.if exists(${.CURDIR}/../arch/${TARGET_ARCH} +.if exists(${.CURDIR}/../arch/${TARGET_ARCH}) CFLAGS+= -I${.CURDIR}/../arch/${TARGET_ARCH} .else CFLAGS+= -I${.CURDIR}/../arch/${TARGET_CPUARCH} -.enidf +.endif CFLAGS+= -I${.CURDIR}/../common OBJECT_FMT= ELF From owner-svn-src-head@FreeBSD.ORG Mon Sep 13 07:03:01 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9DC32106566B; Mon, 13 Sep 2010 07:03:01 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8BFB18FC08; Mon, 13 Sep 2010 07:03:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8D731s9071304; Mon, 13 Sep 2010 07:03:01 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8D731Tm071288; Mon, 13 Sep 2010 07:03:01 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201009130703.o8D731Tm071288@svn.freebsd.org> From: David Xu Date: Mon, 13 Sep 2010 07:03:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212536 - head/lib/libthr/thread X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2010 07:03:01 -0000 Author: davidxu Date: Mon Sep 13 07:03:01 2010 New Revision: 212536 URL: http://svn.freebsd.org/changeset/base/212536 Log: Convert thread list lock from mutex to rwlock. Modified: head/lib/libthr/thread/thr_affinity.c head/lib/libthr/thread/thr_attr.c head/lib/libthr/thread/thr_cancel.c head/lib/libthr/thread/thr_create.c head/lib/libthr/thread/thr_detach.c head/lib/libthr/thread/thr_exit.c head/lib/libthr/thread/thr_fork.c head/lib/libthr/thread/thr_init.c head/lib/libthr/thread/thr_join.c head/lib/libthr/thread/thr_kill.c head/lib/libthr/thread/thr_list.c head/lib/libthr/thread/thr_private.h head/lib/libthr/thread/thr_resume_np.c head/lib/libthr/thread/thr_stack.c head/lib/libthr/thread/thr_suspend_np.c Modified: head/lib/libthr/thread/thr_affinity.c ============================================================================== --- head/lib/libthr/thread/thr_affinity.c Mon Sep 13 06:50:07 2010 (r212535) +++ head/lib/libthr/thread/thr_affinity.c Mon Sep 13 07:03:01 2010 (r212536) @@ -50,8 +50,7 @@ _pthread_setaffinity_np(pthread_t td, si -1, cpusetsize, cpusetp); if (error == -1) error = errno; - } else { - THR_THREAD_LOCK(curthread, td); + } else if ((error = _thr_find_thread(curthread, td, 0)) == 0) { if (td->state == PS_DEAD) { THR_THREAD_UNLOCK(curthread, td); return (EINVAL); @@ -73,10 +72,18 @@ _pthread_getaffinity_np(pthread_t td, si lwpid_t tid; int error; - tid = TID(td); - error = cpuset_getaffinity(CPU_LEVEL_WHICH, CPU_WHICH_TID, - (td == curthread) ? -1 : tid, cpusetsize, cpusetp); - if (error == -1) - error = errno; + if (td == curthread) { + error = cpuset_getaffinity(CPU_LEVEL_WHICH, CPU_WHICH_TID, + (td == curthread) ? -1 : tid, cpusetsize, cpusetp); + if (error == -1) + error = errno; + } else if ((error = _thr_find_thread(curthread, td, 0)) == 0) { + tid = TID(td); + error = cpuset_getaffinity(CPU_LEVEL_WHICH, CPU_WHICH_TID, + (td == curthread) ? -1 : tid, cpusetsize, cpusetp); + if (error == -1) + error = errno; + THR_THREAD_UNLOCK(curthread, td); + } return (error); } Modified: head/lib/libthr/thread/thr_attr.c ============================================================================== --- head/lib/libthr/thread/thr_attr.c Mon Sep 13 06:50:07 2010 (r212535) +++ head/lib/libthr/thread/thr_attr.c Mon Sep 13 07:03:01 2010 (r212536) @@ -132,22 +132,23 @@ _pthread_attr_destroy(pthread_attr_t *at __weak_reference(_pthread_attr_get_np, pthread_attr_get_np); int -_pthread_attr_get_np(pthread_t pid, pthread_attr_t *dst) +_pthread_attr_get_np(pthread_t pthread, pthread_attr_t *dst) { struct pthread *curthread; struct pthread_attr attr; int ret; - if (pid == NULL || dst == NULL || *dst == NULL) + if (pthread == NULL || dst == NULL || *dst == NULL) return (EINVAL); curthread = _get_curthread(); - if ((ret = _thr_ref_add(curthread, pid, /*include dead*/0)) != 0) + if ((ret = _thr_find_thread(curthread, pthread, /*include dead*/0)) != 0) return (ret); - attr = pid->attr; - if (pid->tlflags & TLFLAGS_DETACHED) + attr = pthread->attr; + if (pthread->flags & THR_FLAGS_DETACHED) attr.flags |= PTHREAD_DETACHED; - _thr_ref_delete(curthread, pid); + THR_THREAD_UNLOCK(curthread, pthread); + memcpy(*dst, &attr, sizeof(struct pthread_attr)); /* XXX */ (*dst)->cpuset = NULL; Modified: head/lib/libthr/thread/thr_cancel.c ============================================================================== --- head/lib/libthr/thread/thr_cancel.c Mon Sep 13 06:50:07 2010 (r212535) +++ head/lib/libthr/thread/thr_cancel.c Mon Sep 13 07:03:01 2010 (r212536) @@ -60,18 +60,16 @@ _pthread_cancel(pthread_t pthread) /* * POSIX says _pthread_cancel should be async cancellation safe. - * _thr_ref_add and _thr_ref_delete will enter and leave critical + * _thr_find_thread and THR_THREAD_UNLOCK will enter and leave critical * region automatically. */ - if ((ret = _thr_ref_add(curthread, pthread, 0)) == 0) { - THR_THREAD_LOCK(curthread, pthread); + if ((ret = _thr_find_thread(curthread, pthread, 0)) == 0) { if (!pthread->cancel_pending) { pthread->cancel_pending = 1; if (pthread->state != PS_DEAD) _thr_send_sig(pthread, SIGCANCEL); } THR_THREAD_UNLOCK(curthread, pthread); - _thr_ref_delete(curthread, pthread); } return (ret); } Modified: head/lib/libthr/thread/thr_create.c ============================================================================== --- head/lib/libthr/thread/thr_create.c Mon Sep 13 06:50:07 2010 (r212535) +++ head/lib/libthr/thread/thr_create.c Mon Sep 13 07:03:01 2010 (r212536) @@ -125,7 +125,7 @@ _pthread_create(pthread_t * thread, cons new_thread->state = PS_RUNNING; if (new_thread->attr.flags & PTHREAD_CREATE_DETACHED) - new_thread->tlflags |= TLFLAGS_DETACHED; + new_thread->flags |= THR_FLAGS_DETACHED; /* Add the new thread. */ new_thread->refcount = 1; @@ -185,16 +185,14 @@ _pthread_create(pthread_t * thread, cons THR_THREAD_LOCK(curthread, new_thread); new_thread->state = PS_DEAD; new_thread->tid = TID_TERMINATED; + new_thread->flags |= THR_FLAGS_DETACHED; + new_thread->refcount--; if (new_thread->flags & THR_FLAGS_NEED_SUSPEND) { new_thread->cycle++; _thr_umtx_wake(&new_thread->cycle, INT_MAX, 0); } - THR_THREAD_UNLOCK(curthread, new_thread); - THREAD_LIST_LOCK(curthread); - _thread_active_threads--; - new_thread->tlflags |= TLFLAGS_DETACHED; - _thr_ref_delete_unlocked(curthread, new_thread); - THREAD_LIST_UNLOCK(curthread); + _thr_try_gc(curthread, new_thread); /* thread lock released */ + atomic_add_int(&_thread_active_threads, -1); } else if (locked) { if (cpusetp != NULL) { if (cpuset_setaffinity(CPU_LEVEL_WHICH, CPU_WHICH_TID, @@ -202,22 +200,17 @@ _pthread_create(pthread_t * thread, cons ret = errno; /* kill the new thread */ new_thread->force_exit = 1; - THR_THREAD_UNLOCK(curthread, new_thread); + new_thread->flags |= THR_FLAGS_DETACHED; + _thr_try_gc(curthread, new_thread); + /* thread lock released */ goto out; } } _thr_report_creation(curthread, new_thread); THR_THREAD_UNLOCK(curthread, new_thread); -out: - if (ret) { - THREAD_LIST_LOCK(curthread); - new_thread->tlflags |= TLFLAGS_DETACHED; - THR_GCLIST_ADD(new_thread); - THREAD_LIST_UNLOCK(curthread); - } } - +out: if (ret) (*thread) = 0; return (ret); Modified: head/lib/libthr/thread/thr_detach.c ============================================================================== --- head/lib/libthr/thread/thr_detach.c Mon Sep 13 06:50:07 2010 (r212535) +++ head/lib/libthr/thread/thr_detach.c Mon Sep 13 07:03:01 2010 (r212536) @@ -47,25 +47,21 @@ _pthread_detach(pthread_t pthread) if (pthread == NULL) return (EINVAL); - THREAD_LIST_LOCK(curthread); if ((rval = _thr_find_thread(curthread, pthread, /*include dead*/1)) != 0) { - THREAD_LIST_UNLOCK(curthread); return (rval); } /* Check if the thread is already detached or has a joiner. */ - if ((pthread->tlflags & TLFLAGS_DETACHED) != 0 || + if ((pthread->flags & THR_FLAGS_DETACHED) != 0 || (pthread->joiner != NULL)) { - THREAD_LIST_UNLOCK(curthread); + THR_THREAD_UNLOCK(curthread, pthread); return (EINVAL); } /* Flag the thread as detached. */ - pthread->tlflags |= TLFLAGS_DETACHED; - if (pthread->state == PS_DEAD) - THR_GCLIST_ADD(pthread); - THREAD_LIST_UNLOCK(curthread); + pthread->flags |= THR_FLAGS_DETACHED; + _thr_try_gc(curthread, pthread); /* thread lock released */ return (0); } Modified: head/lib/libthr/thread/thr_exit.c ============================================================================== --- head/lib/libthr/thread/thr_exit.c Mon Sep 13 06:50:07 2010 (r212535) +++ head/lib/libthr/thread/thr_exit.c Mon Sep 13 07:03:01 2010 (r212536) @@ -108,37 +108,34 @@ _pthread_exit_mask(void *status, sigset_ if (!_thr_isthreaded()) exit(0); - THREAD_LIST_LOCK(curthread); - _thread_active_threads--; - if (_thread_active_threads == 0) { - THREAD_LIST_UNLOCK(curthread); + if (atomic_fetchadd_int(&_thread_active_threads, -1) == 1) { exit(0); /* Never reach! */ } - THREAD_LIST_UNLOCK(curthread); /* Tell malloc that the thread is exiting. */ _malloc_thread_cleanup(); - THREAD_LIST_LOCK(curthread); THR_LOCK(curthread); curthread->state = PS_DEAD; if (curthread->flags & THR_FLAGS_NEED_SUSPEND) { curthread->cycle++; _thr_umtx_wake(&curthread->cycle, INT_MAX, 0); } - THR_UNLOCK(curthread); /* * Thread was created with initial refcount 1, we drop the * reference count to allow it to be garbage collected. */ curthread->refcount--; - if (curthread->tlflags & TLFLAGS_DETACHED) - THR_GCLIST_ADD(curthread); - THREAD_LIST_UNLOCK(curthread); + _thr_try_gc(curthread, curthread); /* thread lock released */ + if (!curthread->force_exit && SHOULD_REPORT_EVENT(curthread, TD_DEATH)) _thr_report_death(curthread); +#if defined(_PTHREADS_INVARIANTS) + if (THR_IN_CRITICAL(curthread)) + PANIC("thread exits with resources held!"); +#endif /* * Kernel will do wakeup at the address, so joiner thread * will be resumed if it is sleeping at the address. Modified: head/lib/libthr/thread/thr_fork.c ============================================================================== --- head/lib/libthr/thread/thr_fork.c Mon Sep 13 06:50:07 2010 (r212535) +++ head/lib/libthr/thread/thr_fork.c Mon Sep 13 07:03:01 2010 (r212536) @@ -178,13 +178,13 @@ _fork(void) /* Child process */ errsave = errno; curthread->cancel_pending = 0; - curthread->flags &= ~THR_FLAGS_NEED_SUSPEND; + curthread->flags &= ~(THR_FLAGS_NEED_SUSPEND|THR_FLAGS_DETACHED); /* * Thread list will be reinitialized, and later we call * _libpthread_init(), it will add us back to list. */ - curthread->tlflags &= ~(TLFLAGS_IN_TDLIST | TLFLAGS_DETACHED); + curthread->tlflags &= ~TLFLAGS_IN_TDLIST; /* child is a new kernel thread. */ thr_self(&curthread->tid); Modified: head/lib/libthr/thread/thr_init.c ============================================================================== --- head/lib/libthr/thread/thr_init.c Mon Sep 13 06:50:07 2010 (r212535) +++ head/lib/libthr/thread/thr_init.c Mon Sep 13 07:03:01 2010 (r212536) @@ -111,7 +111,7 @@ struct umutex _mutex_static_lock = DEFAU struct umutex _cond_static_lock = DEFAULT_UMUTEX; struct umutex _rwlock_static_lock = DEFAULT_UMUTEX; struct umutex _keytable_lock = DEFAULT_UMUTEX; -struct umutex _thr_list_lock = DEFAULT_UMUTEX; +struct urwlock _thr_list_lock = DEFAULT_URWLOCK; struct umutex _thr_event_lock = DEFAULT_UMUTEX; int __pthread_cond_wait(pthread_cond_t *, pthread_mutex_t *); Modified: head/lib/libthr/thread/thr_join.c ============================================================================== --- head/lib/libthr/thread/thr_join.c Mon Sep 13 06:50:07 2010 (r212535) +++ head/lib/libthr/thread/thr_join.c Mon Sep 13 07:03:01 2010 (r212536) @@ -43,12 +43,12 @@ __weak_reference(_pthread_timedjoin_np, static void backout_join(void *arg) { - struct pthread *curthread = _get_curthread(); struct pthread *pthread = (struct pthread *)arg; + struct pthread *curthread = _get_curthread(); - THREAD_LIST_LOCK(curthread); + THR_THREAD_LOCK(curthread, pthread); pthread->joiner = NULL; - THREAD_LIST_UNLOCK(curthread); + THR_THREAD_LOCK(curthread, pthread); } int @@ -88,23 +88,23 @@ join_common(pthread_t pthread, void **th if (pthread == curthread) return (EDEADLK); - THREAD_LIST_LOCK(curthread); - if ((ret = _thr_find_thread(curthread, pthread, 1)) != 0) { - ret = ESRCH; - } else if ((pthread->tlflags & TLFLAGS_DETACHED) != 0) { + if ((ret = _thr_find_thread(curthread, pthread, 1)) != 0) + return (ESRCH); + + if ((pthread->flags & THR_FLAGS_DETACHED) != 0) { ret = EINVAL; } else if (pthread->joiner != NULL) { /* Multiple joiners are not supported. */ ret = ENOTSUP; } if (ret) { - THREAD_LIST_UNLOCK(curthread); + THR_THREAD_UNLOCK(curthread, pthread); return (ret); } /* Set the running thread to be the joiner: */ pthread->joiner = curthread; - THREAD_LIST_UNLOCK(curthread); + THR_THREAD_UNLOCK(curthread, pthread); THR_CLEANUP_PUSH(curthread, backout_join, pthread); _thr_cancel_enter(curthread); @@ -131,17 +131,16 @@ join_common(pthread_t pthread, void **th THR_CLEANUP_POP(curthread, 0); if (ret == ETIMEDOUT) { - THREAD_LIST_LOCK(curthread); + THR_THREAD_LOCK(curthread, pthread); pthread->joiner = NULL; - THREAD_LIST_UNLOCK(curthread); + THR_THREAD_UNLOCK(curthread, pthread); } else { ret = 0; tmp = pthread->ret; - THREAD_LIST_LOCK(curthread); - pthread->tlflags |= TLFLAGS_DETACHED; + THR_THREAD_LOCK(curthread, pthread); + pthread->flags |= THR_FLAGS_DETACHED; pthread->joiner = NULL; - THR_GCLIST_ADD(pthread); - THREAD_LIST_UNLOCK(curthread); + _thr_try_gc(curthread, pthread); /* thread lock released */ if (thread_return != NULL) *thread_return = tmp; Modified: head/lib/libthr/thread/thr_kill.c ============================================================================== --- head/lib/libthr/thread/thr_kill.c Mon Sep 13 06:50:07 2010 (r212535) +++ head/lib/libthr/thread/thr_kill.c Mon Sep 13 07:03:01 2010 (r212536) @@ -54,11 +54,15 @@ _pthread_kill(pthread_t pthread, int sig * signal is valid (signal 0 specifies error checking only) and * not being ignored: */ - else if ((ret = _thr_ref_add(curthread, pthread, /*include dead*/0)) + else if (curthread == pthread) { + if (sig > 0) + _thr_send_sig(pthread, sig); + ret = 0; + } if ((ret = _thr_find_thread(curthread, pthread, /*include dead*/0)) == 0) { if (sig > 0) _thr_send_sig(pthread, sig); - _thr_ref_delete(curthread, pthread); + THR_THREAD_UNLOCK(curthread, pthread); } /* Return the completion status: */ Modified: head/lib/libthr/thread/thr_list.c ============================================================================== --- head/lib/libthr/thread/thr_list.c Mon Sep 13 06:50:07 2010 (r212535) +++ head/lib/libthr/thread/thr_list.c Mon Sep 13 07:03:01 2010 (r212536) @@ -79,7 +79,7 @@ _thr_list_init(void) _gc_count = 0; total_threads = 1; - _thr_umutex_init(&_thr_list_lock); + _thr_urwlock_init(&_thr_list_lock); TAILQ_INIT(&_thread_list); TAILQ_INIT(&free_threadq); _thr_umutex_init(&free_thread_lock); @@ -98,7 +98,7 @@ _thr_gc(struct pthread *curthread) TAILQ_HEAD(, pthread) worklist; TAILQ_INIT(&worklist); - THREAD_LIST_LOCK(curthread); + THREAD_LIST_WRLOCK(curthread); /* Check the threads waiting for GC. */ TAILQ_FOREACH_SAFE(td, &_thread_gc_list, gcle, td_next) { @@ -107,17 +107,8 @@ _thr_gc(struct pthread *curthread) continue; } _thr_stack_free(&td->attr); - if (((td->tlflags & TLFLAGS_DETACHED) != 0) && - (td->refcount == 0)) { - THR_GCLIST_REMOVE(td); - /* - * The thread has detached and is no longer - * referenced. It is safe to remove all - * remnants of the thread. - */ - THR_LIST_REMOVE(td); - TAILQ_INSERT_HEAD(&worklist, td, gcle); - } + THR_GCLIST_REMOVE(td); + TAILQ_INSERT_HEAD(&worklist, td, gcle); } THREAD_LIST_UNLOCK(curthread); @@ -228,10 +219,10 @@ thr_destroy(struct pthread *curthread __ void _thr_link(struct pthread *curthread, struct pthread *thread) { - THREAD_LIST_LOCK(curthread); + THREAD_LIST_WRLOCK(curthread); THR_LIST_ADD(thread); - _thread_active_threads++; THREAD_LIST_UNLOCK(curthread); + atomic_add_int(&_thread_active_threads, 1); } /* @@ -240,10 +231,10 @@ _thr_link(struct pthread *curthread, str void _thr_unlink(struct pthread *curthread, struct pthread *thread) { - THREAD_LIST_LOCK(curthread); + THREAD_LIST_WRLOCK(curthread); THR_LIST_REMOVE(thread); - _thread_active_threads--; THREAD_LIST_UNLOCK(curthread); + atomic_add_int(&_thread_active_threads, -1); } void @@ -290,12 +281,11 @@ _thr_ref_add(struct pthread *curthread, /* Invalid thread: */ return (EINVAL); - THREAD_LIST_LOCK(curthread); if ((ret = _thr_find_thread(curthread, thread, include_dead)) == 0) { thread->refcount++; THR_CRITICAL_ENTER(curthread); + THR_THREAD_UNLOCK(curthread, thread); } - THREAD_LIST_UNLOCK(curthread); /* Return zero if the thread exists: */ return (ret); @@ -304,41 +294,56 @@ _thr_ref_add(struct pthread *curthread, void _thr_ref_delete(struct pthread *curthread, struct pthread *thread) { - THREAD_LIST_LOCK(curthread); - _thr_ref_delete_unlocked(curthread, thread); - THREAD_LIST_UNLOCK(curthread); + THR_THREAD_LOCK(curthread, thread); + thread->refcount--; + _thr_try_gc(curthread, thread); + THR_CRITICAL_LEAVE(curthread); } +/* entered with thread lock held, exit with thread lock released */ void -_thr_ref_delete_unlocked(struct pthread *curthread, - struct pthread *thread) +_thr_try_gc(struct pthread *curthread, struct pthread *thread) { - if (thread != NULL) { - thread->refcount--; - if ((thread->refcount == 0) && thread->state == PS_DEAD && - (thread->tlflags & TLFLAGS_DETACHED) != 0) + if (THR_SHOULD_GC(thread)) { + THR_REF_ADD(curthread, thread); + THR_THREAD_UNLOCK(curthread, thread); + THREAD_LIST_WRLOCK(curthread); + THR_THREAD_LOCK(curthread, thread); + THR_REF_DEL(curthread, thread); + if (THR_SHOULD_GC(thread)) { + THR_LIST_REMOVE(thread); THR_GCLIST_ADD(thread); - THR_CRITICAL_LEAVE(curthread); + } + THR_THREAD_UNLOCK(curthread, thread); + THREAD_LIST_UNLOCK(curthread); + } else { + THR_THREAD_UNLOCK(curthread, thread); } } +/* return with thread lock held if thread is found */ int -_thr_find_thread(struct pthread *curthread __unused, struct pthread *thread, +_thr_find_thread(struct pthread *curthread, struct pthread *thread, int include_dead) { struct pthread *pthread; + int ret; if (thread == NULL) - /* Invalid thread: */ return (EINVAL); + ret = 0; + THREAD_LIST_RDLOCK(curthread); pthread = _thr_hash_find(thread); if (pthread) { + THR_THREAD_LOCK(curthread, pthread); if (include_dead == 0 && pthread->state == PS_DEAD) { - pthread = NULL; - } + THR_THREAD_UNLOCK(curthread, pthread); + ret = ESRCH; + } + } else { + ret = ESRCH; } - - /* Return zero if the thread exists: */ - return ((pthread != NULL) ? 0 : ESRCH); + THREAD_LIST_UNLOCK(curthread); + return (ret); } Modified: head/lib/libthr/thread/thr_private.h ============================================================================== --- head/lib/libthr/thread/thr_private.h Mon Sep 13 06:50:07 2010 (r212535) +++ head/lib/libthr/thread/thr_private.h Mon Sep 13 07:03:01 2010 (r212536) @@ -415,13 +415,13 @@ struct pthread { #define THR_FLAGS_PRIVATE 0x0001 #define THR_FLAGS_NEED_SUSPEND 0x0002 /* thread should be suspended */ #define THR_FLAGS_SUSPENDED 0x0004 /* thread is suspended */ +#define THR_FLAGS_IN_GCLIST 0x0004 /* thread in gc list */ +#define THR_FLAGS_DETACHED 0x0008 /* thread is detached */ /* Thread list flags; only set with thread list lock held. */ int tlflags; #define TLFLAGS_GC_SAFE 0x0001 /* thread safe for cleaning */ #define TLFLAGS_IN_TDLIST 0x0002 /* thread in all thread list */ -#define TLFLAGS_IN_GCLIST 0x0004 /* thread in gc list */ -#define TLFLAGS_DETACHED 0x0008 /* thread is detached */ /* Queue of currently owned NORMAL or PRIO_INHERIT type mutexes. */ struct mutex_queue mutexq; @@ -463,6 +463,10 @@ struct pthread { td_event_msg_t event_buf; }; +#define THR_SHOULD_GC(thrd) \ + ((thrd)->refcount == 0 && (thrd)->state == PS_DEAD && \ + ((thrd)->flags & THR_FLAGS_DETACHED) != 0) + #define THR_IN_CRITICAL(thrd) \ (((thrd)->locklevel > 0) || \ ((thrd)->critical_count > 0)) @@ -517,14 +521,23 @@ do { \ #define THR_THREAD_LOCK(curthrd, thr) THR_LOCK_ACQUIRE(curthrd, &(thr)->lock) #define THR_THREAD_UNLOCK(curthrd, thr) THR_LOCK_RELEASE(curthrd, &(thr)->lock) -#define THREAD_LIST_LOCK(curthrd) \ +#define THREAD_LIST_RDLOCK(curthrd) \ +do { \ + (curthrd)->locklevel++; \ + _thr_rwl_rdlock(&_thr_list_lock); \ +} while (0) + +#define THREAD_LIST_WRLOCK(curthrd) \ do { \ - THR_LOCK_ACQUIRE((curthrd), &_thr_list_lock); \ + (curthrd)->locklevel++; \ + _thr_rwl_wrlock(&_thr_list_lock); \ } while (0) #define THREAD_LIST_UNLOCK(curthrd) \ do { \ - THR_LOCK_RELEASE((curthrd), &_thr_list_lock); \ + _thr_rwl_unlock(&_thr_list_lock); \ + (curthrd)->locklevel--; \ + _thr_ast(curthrd); \ } while (0) /* @@ -546,20 +559,30 @@ do { \ } \ } while (0) #define THR_GCLIST_ADD(thrd) do { \ - if (((thrd)->tlflags & TLFLAGS_IN_GCLIST) == 0) { \ + if (((thrd)->flags & THR_FLAGS_IN_GCLIST) == 0) { \ TAILQ_INSERT_HEAD(&_thread_gc_list, thrd, gcle);\ - (thrd)->tlflags |= TLFLAGS_IN_GCLIST; \ + (thrd)->flags |= THR_FLAGS_IN_GCLIST; \ _gc_count++; \ } \ } while (0) #define THR_GCLIST_REMOVE(thrd) do { \ - if (((thrd)->tlflags & TLFLAGS_IN_GCLIST) != 0) { \ + if (((thrd)->flags & THR_FLAGS_IN_GCLIST) != 0) { \ TAILQ_REMOVE(&_thread_gc_list, thrd, gcle); \ - (thrd)->tlflags &= ~TLFLAGS_IN_GCLIST; \ + (thrd)->flags &= ~THR_FLAGS_IN_GCLIST; \ _gc_count--; \ } \ } while (0) +#define THR_REF_ADD(curthread, pthread) { \ + THR_CRITICAL_ENTER(curthread); \ + pthread->refcount++; \ +} while (0) + +#define THR_REF_DEL(curthread, pthread) { \ + pthread->refcount--; \ + THR_CRITICAL_LEAVE(curthread); \ +} while (0) + #define GC_NEEDED() (_gc_count >= 5) #define SHOULD_REPORT_EVENT(curthr, e) \ @@ -618,7 +641,7 @@ extern struct umutex _mutex_static_lock extern struct umutex _cond_static_lock __hidden; extern struct umutex _rwlock_static_lock __hidden; extern struct umutex _keytable_lock __hidden; -extern struct umutex _thr_list_lock __hidden; +extern struct urwlock _thr_list_lock __hidden; extern struct umutex _thr_event_lock __hidden; /* @@ -673,6 +696,7 @@ int _thr_setscheduler(lwpid_t, int, cons void _thr_signal_prefork(void) __hidden; void _thr_signal_postfork(void) __hidden; void _thr_signal_postfork_child(void) __hidden; +void _thr_try_gc(struct pthread *, struct pthread *) __hidden; int _rtp_to_schedparam(const struct rtprio *rtp, int *policy, struct sched_param *param) __hidden; int _schedparam_to_rtp(int policy, const struct sched_param *param, Modified: head/lib/libthr/thread/thr_resume_np.c ============================================================================== --- head/lib/libthr/thread/thr_resume_np.c Mon Sep 13 06:50:07 2010 (r212535) +++ head/lib/libthr/thread/thr_resume_np.c Mon Sep 13 07:03:01 2010 (r212536) @@ -50,12 +50,10 @@ _pthread_resume_np(pthread_t thread) int ret; /* Add a reference to the thread: */ - if ((ret = _thr_ref_add(curthread, thread, /*include dead*/0)) == 0) { + if ((ret = _thr_find_thread(curthread, thread, /*include dead*/0)) == 0) { /* Lock the threads scheduling queue: */ - THR_THREAD_LOCK(curthread, thread); resume_common(thread); THR_THREAD_UNLOCK(curthread, thread); - _thr_ref_delete(curthread, thread); } return (ret); } @@ -67,7 +65,7 @@ _pthread_resume_all_np(void) struct pthread *thread; /* Take the thread list lock: */ - THREAD_LIST_LOCK(curthread); + THREAD_LIST_RDLOCK(curthread); TAILQ_FOREACH(thread, &_thread_list, tle) { if (thread != curthread) { Modified: head/lib/libthr/thread/thr_stack.c ============================================================================== --- head/lib/libthr/thread/thr_stack.c Mon Sep 13 06:50:07 2010 (r212535) +++ head/lib/libthr/thread/thr_stack.c Mon Sep 13 07:03:01 2010 (r212536) @@ -154,7 +154,7 @@ _thr_stack_alloc(struct pthread_attr *at * Use the garbage collector lock for synchronization of the * spare stack lists and allocations from usrstack. */ - THREAD_LIST_LOCK(curthread); + THREAD_LIST_WRLOCK(curthread); /* * If the stack and guard sizes are default, try to allocate a stack * from the default-size stack cache: Modified: head/lib/libthr/thread/thr_suspend_np.c ============================================================================== --- head/lib/libthr/thread/thr_suspend_np.c Mon Sep 13 06:50:07 2010 (r212535) +++ head/lib/libthr/thread/thr_suspend_np.c Mon Sep 13 07:03:01 2010 (r212536) @@ -76,7 +76,7 @@ _pthread_suspend_all_np(void) struct pthread *thread; int ret; - THREAD_LIST_LOCK(curthread); + THREAD_LIST_RDLOCK(curthread); TAILQ_FOREACH(thread, &_thread_list, tle) { if (thread != curthread) { @@ -96,13 +96,15 @@ restart: THR_THREAD_LOCK(curthread, thread); ret = suspend_common(curthread, thread, 0); if (ret == 0) { - /* Can not suspend, try to wait */ - thread->refcount++; THREAD_LIST_UNLOCK(curthread); + /* Can not suspend, try to wait */ + THR_REF_ADD(curthread, thread); suspend_common(curthread, thread, 1); - THR_THREAD_UNLOCK(curthread, thread); - THREAD_LIST_LOCK(curthread); - _thr_ref_delete_unlocked(curthread, thread); + THR_REF_DEL(curthread, thread); + _thr_try_gc(curthread, thread); + /* thread lock released */ + + THREAD_LIST_RDLOCK(curthread); /* * Because we were blocked, things may have * been changed, we have to restart the @@ -127,8 +129,8 @@ suspend_common(struct pthread *curthread !(thread->flags & THR_FLAGS_SUSPENDED)) { thread->flags |= THR_FLAGS_NEED_SUSPEND; tmp = thread->cycle; - THR_THREAD_UNLOCK(curthread, thread); _thr_send_sig(thread, SIGCANCEL); + THR_THREAD_UNLOCK(curthread, thread); if (waitok) { _thr_umtx_wait_uint(&thread->cycle, tmp, NULL, 0); THR_THREAD_LOCK(curthread, thread); From owner-svn-src-head@FreeBSD.ORG Mon Sep 13 07:15:01 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 64E37106564A; Mon, 13 Sep 2010 07:15:01 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 52F5C8FC14; Mon, 13 Sep 2010 07:15:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8D7F1mV072293; Mon, 13 Sep 2010 07:15:01 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8D7F1DU072292; Mon, 13 Sep 2010 07:15:01 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201009130715.o8D7F1DU072292@svn.freebsd.org> From: Warner Losh Date: Mon, 13 Sep 2010 07:15:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212537 - head/usr.sbin/crunch/crunchide X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2010 07:15:01 -0000 Author: imp Date: Mon Sep 13 07:15:01 2010 New Revision: 212537 URL: http://svn.freebsd.org/changeset/base/212537 Log: It turns out that TARGET_CPUARCH doesn't buy us much here, if anything, but costs us another copy of the transform. Revert it. # Maybe makefile.inc1 should set TARGET_CPUARCH for the cross-tools, but # it doesn't now. That would solve problems in other places too. Submitted by: jmallet@ Modified: head/usr.sbin/crunch/crunchide/Makefile Modified: head/usr.sbin/crunch/crunchide/Makefile ============================================================================== --- head/usr.sbin/crunch/crunchide/Makefile Mon Sep 13 07:03:01 2010 (r212536) +++ head/usr.sbin/crunch/crunchide/Makefile Mon Sep 13 07:15:01 2010 (r212537) @@ -3,14 +3,6 @@ PROG= crunchide SRCS= crunchide.c -# These assignments duplicate much of the functionality of -# MACHINE_CPUARCH, but there's no easy way to export make functions... - -.if defined(TARGET_ARCH) -TARGET_CPUARCH=${TARGET_ARCH:C/mipse[bl]/mips/:C/armeb/arm/} -.else -TARGET_CPUARCH=${MACHINE_CPUARCH} -.endif TARGET_ARCH?= ${MACHINE_ARCH} .if ${TARGET_ARCH} == i386 && ${MACHINE_ARCH} == i386 @@ -18,9 +10,8 @@ CFLAGS+=-DNLIST_AOUT SRCS+= exec_aout.c .endif -# nb: TARGET_ARCH for powerpc64 is correct here -.if ${TARGET_CPUARCH} == ia64 || ${TARGET_ARCH} == powerpc64 || \ - ${TARGET_CPUARCH} == sparc64 || ${TARGET_CPUARCH} == amd64 +.if ${TARGET_ARCH} == ia64 || ${TARGET_ARCH} == powerpc64 || \ + ${TARGET_ARCH} == sparc64 || ${TARGET_ARCH} == amd64 CFLAGS+=-DNLIST_ELF64 SRCS+= exec_elf64.c exec_elf64.o: exec_elf32.c From owner-svn-src-head@FreeBSD.ORG Mon Sep 13 07:16:48 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 990141065670; Mon, 13 Sep 2010 07:16:48 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6EA908FC27; Mon, 13 Sep 2010 07:16:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8D7GmIj072504; Mon, 13 Sep 2010 07:16:48 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8D7GmKP072502; Mon, 13 Sep 2010 07:16:48 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201009130716.o8D7GmKP072502@svn.freebsd.org> From: Warner Losh Date: Mon, 13 Sep 2010 07:16:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212538 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2010 07:16:48 -0000 Author: imp Date: Mon Sep 13 07:16:48 2010 New Revision: 212538 URL: http://svn.freebsd.org/changeset/base/212538 Log: Use MACHINE_CPUARCH as appropriate Define __KLD_SHARED to be yes or no depending on if the target uses shared binaries for klds or not (this also eliminates 4 uses of MACHINE_ARCH). Modified: head/sys/conf/kmod.mk Modified: head/sys/conf/kmod.mk ============================================================================== --- head/sys/conf/kmod.mk Mon Sep 13 07:15:01 2010 (r212537) +++ head/sys/conf/kmod.mk Mon Sep 13 07:16:48 2010 (r212538) @@ -81,6 +81,13 @@ OBJCOPY?= objcopy .SUFFIXES: .out .o .c .cc .cxx .C .y .l .s .S +# amd64 and mips use direct linking for kmod, all others use shared binaries +.if ${MACHINE_CPUARCH} != amd64 && ${MACHINE_CPUARCH} != mips +__KLD_SHARED=yes +.else +__KLD_SHARED=no +.endif + .if ${CC:T:Micc} == "icc" CFLAGS:= ${CFLAGS:C/(-x[^M^K^W]+)[MKW]+|-x[MKW]+/\1/} .else @@ -128,15 +135,15 @@ CFLAGS+= -fno-common LDFLAGS+= -d -warn-common CFLAGS+= ${DEBUG_FLAGS} -.if ${MACHINE_ARCH} == amd64 +.if ${MACHINE_CPUARCH} == amd64 CFLAGS+= -fno-omit-frame-pointer .endif -.if ${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "powerpc64" +.if ${MACHINE_CPUARCH} == powerpc CFLAGS+= -mlongcall -fno-omit-frame-pointer .endif -.if ${MACHINE_ARCH} == "mips" +.if ${MACHINE_CPUARCH} == mips CFLAGS+= -G0 -fno-pic -mno-abicalls -mlong-calls .endif @@ -190,7 +197,7 @@ ${PROG}.symbols: ${FULLPROG} ${OBJCOPY} --only-keep-debug ${FULLPROG} ${.TARGET} .endif -.if ${MACHINE_ARCH} != amd64 && ${MACHINE_ARCH} != mips +.if ${__KLD_SHARED} == yes ${FULLPROG}: ${KMOD}.kld ${LD} -Bshareable ${LDFLAGS} -o ${.TARGET} ${KMOD}.kld .if !defined(DEBUG_FLAGS) @@ -203,7 +210,7 @@ EXPORT_SYMS?= NO CLEANFILES+= export_syms .endif -.if ${MACHINE_ARCH} != amd64 && ${MACHINE_ARCH} != mips +.if ${__KLD_SHARED} == yes ${KMOD}.kld: ${OBJS} .else ${FULLPROG}: ${OBJS} @@ -223,8 +230,7 @@ ${FULLPROG}: ${OBJS} export_syms | xargs -J% ${OBJCOPY} % ${.TARGET} .endif .endif -.if !defined(DEBUG_FLAGS) && \ - (${MACHINE_ARCH} == amd64 || ${MACHINE_ARCH} == mips) +.if !defined(DEBUG_FLAGS) && ${__KLD_SHARED} == no ${OBJCOPY} --strip-debug ${.TARGET} .endif From owner-svn-src-head@FreeBSD.ORG Mon Sep 13 07:18:01 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3F703106564A; Mon, 13 Sep 2010 07:18:01 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2F1F08FC13; Mon, 13 Sep 2010 07:18:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8D7I1pe072629; Mon, 13 Sep 2010 07:18:01 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8D7I1jT072627; Mon, 13 Sep 2010 07:18:01 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201009130718.o8D7I1jT072627@svn.freebsd.org> From: David Xu Date: Mon, 13 Sep 2010 07:18:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212539 - head/lib/libthr/thread X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2010 07:18:01 -0000 Author: davidxu Date: Mon Sep 13 07:18:00 2010 New Revision: 212539 URL: http://svn.freebsd.org/changeset/base/212539 Log: PS_DEAD state needs not be checked because _thr_find_thread() has already checked it. Modified: head/lib/libthr/thread/thr_affinity.c Modified: head/lib/libthr/thread/thr_affinity.c ============================================================================== --- head/lib/libthr/thread/thr_affinity.c Mon Sep 13 07:16:48 2010 (r212538) +++ head/lib/libthr/thread/thr_affinity.c Mon Sep 13 07:18:00 2010 (r212539) @@ -51,10 +51,6 @@ _pthread_setaffinity_np(pthread_t td, si if (error == -1) error = errno; } else if ((error = _thr_find_thread(curthread, td, 0)) == 0) { - if (td->state == PS_DEAD) { - THR_THREAD_UNLOCK(curthread, td); - return (EINVAL); - } tid = TID(td); error = cpuset_setaffinity(CPU_LEVEL_WHICH, CPU_WHICH_TID, tid, cpusetsize, cpusetp); From owner-svn-src-head@FreeBSD.ORG Mon Sep 13 07:22:15 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1F2F11065695; Mon, 13 Sep 2010 07:22:15 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0EBED8FC15; Mon, 13 Sep 2010 07:22:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8D7ME7R073113; Mon, 13 Sep 2010 07:22:14 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8D7MEtu073111; Mon, 13 Sep 2010 07:22:14 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201009130722.o8D7MEtu073111@svn.freebsd.org> From: Warner Losh Date: Mon, 13 Sep 2010 07:22:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212540 - head/share/mk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2010 07:22:15 -0000 Author: imp Date: Mon Sep 13 07:22:14 2010 New Revision: 212540 URL: http://svn.freebsd.org/changeset/base/212540 Log: Prefer MACHINE_CPUARCH to MACHINE_ARCH unless there's a good reason... Modified: head/share/mk/bsd.cpu.mk Modified: head/share/mk/bsd.cpu.mk ============================================================================== --- head/share/mk/bsd.cpu.mk Mon Sep 13 07:18:00 2010 (r212539) +++ head/share/mk/bsd.cpu.mk Mon Sep 13 07:22:14 2010 (r212540) @@ -6,18 +6,18 @@ .if !defined(CPUTYPE) || empty(CPUTYPE) _CPUCFLAGS = -. if ${MACHINE_ARCH} == "i386" +. if ${MACHINE_CPUARCH} == "i386" MACHINE_CPU = i486 -. elif ${MACHINE_ARCH} == "amd64" +. elif ${MACHINE_CPUARCH} == "amd64" MACHINE_CPU = amd64 sse2 sse mmx -. elif ${MACHINE_ARCH} == "ia64" +. elif ${MACHINE_CPUARCH} == "ia64" MACHINE_CPU = itanium -. elif ${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "powerpc64" +. elif ${MACHINE_CPUARCH} == "powerpc" MACHINE_CPU = aim -. elif ${MACHINE_ARCH} == "sparc64" -. elif ${MACHINE_ARCH} == "arm" +. elif ${MACHINE_CPUARCH} == "sparc64" +. elif ${MACHINE_CPUARCH} == "arm" MACHINE_CPU = arm -. elif ${MACHINE_ARCH} == "mips" +. elif ${MACHINE_CPUARCH} == "mips" MACHINE_CPU = mips . endif .else @@ -25,7 +25,7 @@ MACHINE_CPU = mips # Handle aliases (not documented in make.conf to avoid user confusion # between e.g. i586 and pentium) -. if ${MACHINE_ARCH} == "i386" +. if ${MACHINE_CPUARCH} == "i386" . if ${CPUTYPE} == "nocona" CPUTYPE = prescott . elif ${CPUTYPE} == "core" || ${CPUTYPE} == "core2" @@ -54,7 +54,7 @@ CPUTYPE = athlon-mp . elif ${CPUTYPE} == "k7" CPUTYPE = athlon . endif -. elif ${MACHINE_ARCH} == "amd64" +. elif ${MACHINE_CPUARCH} == "amd64" . if ${CPUTYPE} == "prescott" || ${CPUTYPE} == "core2" CPUTYPE = nocona . endif @@ -71,7 +71,7 @@ CPUTYPE = nocona # http://gcc.gnu.org/onlinedocs/gcc/SPARC-Options.html # http://gcc.gnu.org/onlinedocs/gcc/i386-and-x86_002d64-Options.html -. if ${MACHINE_ARCH} == "i386" +. if ${MACHINE_CPUARCH} == "i386" . if ${CPUTYPE} == "crusoe" _CPUCFLAGS = -march=i686 -falign-functions=0 -falign-jumps=0 -falign-loops=0 . elif ${CPUTYPE} == "k5" @@ -104,9 +104,9 @@ _ICC_CPUCFLAGS = -tpp5 . else _ICC_CPUCFLAGS = . endif # ICC on 'i386' -. elif ${MACHINE_ARCH} == "amd64" +. elif ${MACHINE_CPUARCH} == "amd64" _CPUCFLAGS = -march=${CPUTYPE} -. elif ${MACHINE_ARCH} == "arm" +. elif ${MACHINE_CPUARCH} == "arm" . if ${CPUTYPE} == "xscale" #XXX: gcc doesn't seem to like -mcpu=xscale, and dies while rebuilding itself #_CPUCFLAGS = -mcpu=xscale @@ -123,7 +123,7 @@ _CPUCFLAGS = -mcpu=${CPUTYPE} -mno-power . endif . elif ${MACHINE_ARCH} == "powerpc64" _CPUCFLAGS = -mcpu=${CPUTYPE} -. elif ${MACHINE_ARCH} == "mips" +. elif ${MACHINE_CPUARCH} == "mips" . if ${CPUTYPE} == "mips32" _CPUCFLAGS = -march=mips32 . elif ${CPUTYPE} == "mips32r2" @@ -143,7 +143,7 @@ _CPUCFLAGS = -march=24kc # unordered list to make it easy for client makefiles to test for the # presence of a CPU feature. -. if ${MACHINE_ARCH} == "i386" +. if ${MACHINE_CPUARCH} == "i386" . if ${CPUTYPE} == "opteron" || ${CPUTYPE} == "athlon64" MACHINE_CPU = athlon-xp athlon k7 3dnow sse2 sse mmx k6 k5 i586 i486 i386 . elif ${CPUTYPE} == "athlon-mp" || ${CPUTYPE} == "athlon-xp" || \ @@ -182,27 +182,27 @@ MACHINE_CPU = i486 i386 . elif ${CPUTYPE} == "i386" MACHINE_CPU = i386 . endif -. elif ${MACHINE_ARCH} == "amd64" +. elif ${MACHINE_CPUARCH} == "amd64" . if ${CPUTYPE} == "opteron" || ${CPUTYPE} == "athlon64" || ${CPUTYPE} == "k8" MACHINE_CPU = k8 3dnow . elif ${CPUTYPE} == "nocona" MACHINE_CPU = sse3 . endif MACHINE_CPU += amd64 sse2 sse mmx -. elif ${MACHINE_ARCH} == "ia64" +. elif ${MACHINE_CPUARCH} == "ia64" . if ${CPUTYPE} == "itanium" MACHINE_CPU = itanium . endif . endif .endif -.if ${MACHINE_ARCH} == "arm" && defined(TARGET_BIG_ENDIAN) +.if ${MACHINE_CPUARCH} == "arm" && defined(TARGET_BIG_ENDIAN) CFLAGS += -mbig-endian LDFLAGS += -mbig-endian LD += -EB .endif -.if ${MACHINE_ARCH} == "mips" +.if ${MACHINE_CPUARCH} == "mips" CFLAGS += -G0 .endif From owner-svn-src-head@FreeBSD.ORG Mon Sep 13 07:25:36 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 33F811065673; Mon, 13 Sep 2010 07:25:36 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1FBE08FC17; Mon, 13 Sep 2010 07:25:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8D7Pa5K073410; Mon, 13 Sep 2010 07:25:36 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8D7PZX8073399; Mon, 13 Sep 2010 07:25:35 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201009130725.o8D7PZX8073399@svn.freebsd.org> From: Alexander Motin Date: Mon, 13 Sep 2010 07:25:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212541 - in head/sys: amd64/amd64 amd64/include dev/acpica i386/i386 i386/include kern mips/include mips/mips pc98/pc98 powerpc/aim powerpc/booke powerpc/include powerpc/powerpc sparc6... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2010 07:25:36 -0000 Author: mav Date: Mon Sep 13 07:25:35 2010 New Revision: 212541 URL: http://svn.freebsd.org/changeset/base/212541 Log: Refactor timer management code with priority to one-shot operation mode. The main goal of this is to generate timer interrupts only when there is some work to do. When CPU is busy interrupts are generating at full rate of hz + stathz to fullfill scheduler and timekeeping requirements. But when CPU is idle, only minimum set of interrupts (down to 8 interrupts per second per CPU now), needed to handle scheduled callouts is executed. This allows significantly increase idle CPU sleep time, increasing effect of static power-saving technologies. Also it should reduce host CPU load on virtualized systems, when guest system is idle. There is set of tunables, also available as writable sysctls, allowing to control wanted event timer subsystem behavior: kern.eventtimer.timer - allows to choose event timer hardware to use. On x86 there is up to 4 different kinds of timers. Depending on whether chosen timer is per-CPU, behavior of other options slightly differs. kern.eventtimer.periodic - allows to choose periodic and one-shot operation mode. In periodic mode, current timer hardware taken as the only source of time for time events. This mode is quite alike to previous kernel behavior. One-shot mode instead uses currently selected time counter hardware to schedule all needed events one by one and program timer to generate interrupt exactly in specified time. Default value depends of chosen timer capabilities, but one-shot mode is preferred, until other is forced by user or hardware. kern.eventtimer.singlemul - in periodic mode specifies how much times higher timer frequency should be, to not strictly alias hardclock() and statclock() events. Default values are 2 and 4, but could be reduced to 1 if extra interrupts are unwanted. kern.eventtimer.idletick - makes each CPU to receive every timer interrupt independently of whether they busy or not. By default this options is disabled. If chosen timer is per-CPU and runs in periodic mode, this option has no effect - all interrupts are generating. As soon as this patch modifies cpu_idle() on some platforms, I have also refactored one on x86. Now it makes use of MONITOR/MWAIT instrunctions (if supported) under high sleep/wakeup rate, as fast alternative to other methods. It allows SMP scheduler to wake up sleeping CPUs much faster without using IPI, significantly increasing performance on some highly task-switching loads. Tested by: many (on i386, amd64, sparc64 and powerc) H/W donated by: Gheorghe Ardelean Sponsored by: iXsystems, Inc. Modified: head/sys/amd64/amd64/machdep.c head/sys/amd64/amd64/mp_machdep.c head/sys/amd64/include/apicvar.h head/sys/dev/acpica/acpi_cpu.c head/sys/dev/acpica/acpi_hpet.c head/sys/i386/i386/machdep.c head/sys/i386/i386/mp_machdep.c head/sys/i386/include/apicvar.h head/sys/kern/kern_clock.c head/sys/kern/kern_clocksource.c head/sys/kern/kern_et.c head/sys/kern/kern_tc.c head/sys/kern/kern_timeout.c head/sys/kern/sched_4bsd.c head/sys/kern/sched_ule.c head/sys/mips/include/smp.h head/sys/mips/mips/mp_machdep.c head/sys/pc98/pc98/machdep.c head/sys/powerpc/aim/machdep.c head/sys/powerpc/booke/machdep.c head/sys/powerpc/include/smp.h head/sys/powerpc/powerpc/mp_machdep.c head/sys/sparc64/include/intr_machdep.h head/sys/sparc64/include/smp.h head/sys/sparc64/sparc64/intr_machdep.c head/sys/sparc64/sparc64/mp_machdep.c head/sys/sun4v/include/intr_machdep.h head/sys/sun4v/include/smp.h head/sys/sun4v/sun4v/intr_machdep.c head/sys/sun4v/sun4v/mp_machdep.c head/sys/sys/callout.h head/sys/sys/sched.h head/sys/sys/systm.h head/sys/sys/timeet.h head/sys/sys/timetc.h head/sys/x86/x86/local_apic.c Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Mon Sep 13 07:22:14 2010 (r212540) +++ head/sys/amd64/amd64/machdep.c Mon Sep 13 07:25:35 2010 (r212541) @@ -585,59 +585,89 @@ cpu_halt(void) } void (*cpu_idle_hook)(void) = NULL; /* ACPI idle hook. */ +static int cpu_ident_amdc1e = 0; /* AMD C1E supported. */ +static int idle_mwait = 1; /* Use MONITOR/MWAIT for short idle. */ +TUNABLE_INT("machdep.idle_mwait", &idle_mwait); +SYSCTL_INT(_machdep, OID_AUTO, idle_mwait, CTLFLAG_RW, &idle_mwait, + 0, "Use MONITOR/MWAIT for short idle"); + +#define STATE_RUNNING 0x0 +#define STATE_MWAIT 0x1 +#define STATE_SLEEPING 0x2 static void -cpu_idle_hlt(int busy) +cpu_idle_acpi(int busy) { - /* - * we must absolutely guarentee that hlt is the next instruction - * after sti or we introduce a timing window. - */ + int *state; + + state = (int *)PCPU_PTR(monitorbuf); + *state = STATE_SLEEPING; disable_intr(); - if (sched_runnable()) + if (sched_runnable()) enable_intr(); + else if (cpu_idle_hook) + cpu_idle_hook(); else __asm __volatile("sti; hlt"); + *state = STATE_RUNNING; } static void -cpu_idle_acpi(int busy) +cpu_idle_hlt(int busy) { + int *state; + + state = (int *)PCPU_PTR(monitorbuf); + *state = STATE_SLEEPING; + /* + * We must absolutely guarentee that hlt is the next instruction + * after sti or we introduce a timing window. + */ disable_intr(); - if (sched_runnable()) + if (sched_runnable()) enable_intr(); - else if (cpu_idle_hook) - cpu_idle_hook(); else __asm __volatile("sti; hlt"); + *state = STATE_RUNNING; } -static int cpu_ident_amdc1e = 0; +/* + * MWAIT cpu power states. Lower 4 bits are sub-states. + */ +#define MWAIT_C0 0xf0 +#define MWAIT_C1 0x00 +#define MWAIT_C2 0x10 +#define MWAIT_C3 0x20 +#define MWAIT_C4 0x30 -static int -cpu_probe_amdc1e(void) +static void +cpu_idle_mwait(int busy) { - int i; + int *state; - /* - * Forget it, if we're not using local APIC timer. - */ - if (resource_disabled("apic", 0) || - (resource_int_value("apic", 0, "clock", &i) == 0 && i == 0)) - return (0); - - /* - * Detect the presence of C1E capability mostly on latest - * dual-cores (or future) k8 family. - */ - if (cpu_vendor_id == CPU_VENDOR_AMD && - (cpu_id & 0x00000f00) == 0x00000f00 && - (cpu_id & 0x0fff0000) >= 0x00040000) { - cpu_ident_amdc1e = 1; - return (1); + state = (int *)PCPU_PTR(monitorbuf); + *state = STATE_MWAIT; + if (!sched_runnable()) { + cpu_monitor(state, 0, 0); + if (*state == STATE_MWAIT) + cpu_mwait(0, MWAIT_C1); } + *state = STATE_RUNNING; +} - return (0); +static void +cpu_idle_spin(int busy) +{ + int *state; + int i; + + state = (int *)PCPU_PTR(monitorbuf); + *state = STATE_RUNNING; + for (i = 0; i < 1000; i++) { + if (sched_runnable()) + return; + cpu_spinwait(); + } } /* @@ -655,110 +685,83 @@ cpu_probe_amdc1e(void) #define AMDK8_CMPHALT (AMDK8_SMIONCMPHALT | AMDK8_C1EONCMPHALT) static void -cpu_idle_amdc1e(int busy) +cpu_probe_amdc1e(void) { - disable_intr(); - if (sched_runnable()) - enable_intr(); - else { - uint64_t msr; - - msr = rdmsr(MSR_AMDK8_IPM); - if (msr & AMDK8_CMPHALT) - wrmsr(MSR_AMDK8_IPM, msr & ~AMDK8_CMPHALT); - - if (cpu_idle_hook) - cpu_idle_hook(); - else - __asm __volatile("sti; hlt"); + /* + * Detect the presence of C1E capability mostly on latest + * dual-cores (or future) k8 family. + */ + if (cpu_vendor_id == CPU_VENDOR_AMD && + (cpu_id & 0x00000f00) == 0x00000f00 && + (cpu_id & 0x0fff0000) >= 0x00040000) { + cpu_ident_amdc1e = 1; } } -static void -cpu_idle_spin(int busy) -{ - return; -} - void (*cpu_idle_fn)(int) = cpu_idle_acpi; void cpu_idle(int busy) { + uint64_t msr; + + CTR2(KTR_SPARE2, "cpu_idle(%d) at %d", + busy, curcpu); #ifdef SMP if (mp_grab_cpu_hlt()) return; #endif - cpu_idle_fn(busy); -} - -/* - * mwait cpu power states. Lower 4 bits are sub-states. - */ -#define MWAIT_C0 0xf0 -#define MWAIT_C1 0x00 -#define MWAIT_C2 0x10 -#define MWAIT_C3 0x20 -#define MWAIT_C4 0x30 - -#define MWAIT_DISABLED 0x0 -#define MWAIT_WOKEN 0x1 -#define MWAIT_WAITING 0x2 + /* If we are busy - try to use fast methods. */ + if (busy) { + if ((cpu_feature2 & CPUID2_MON) && idle_mwait) { + cpu_idle_mwait(busy); + goto out; + } + } -static void -cpu_idle_mwait(int busy) -{ - int *mwait; + /* If we have time - switch timers into idle mode. */ + if (!busy) { + critical_enter(); + cpu_idleclock(); + } - mwait = (int *)PCPU_PTR(monitorbuf); - *mwait = MWAIT_WAITING; - if (sched_runnable()) - return; - cpu_monitor(mwait, 0, 0); - if (*mwait == MWAIT_WAITING) - cpu_mwait(0, MWAIT_C1); -} + /* Apply AMD APIC timer C1E workaround. */ + if (cpu_ident_amdc1e && cpu_disable_deep_sleep) { + msr = rdmsr(MSR_AMDK8_IPM); + if (msr & AMDK8_CMPHALT) + wrmsr(MSR_AMDK8_IPM, msr & ~AMDK8_CMPHALT); + } -static void -cpu_idle_mwait_hlt(int busy) -{ - int *mwait; + /* Call main idle method. */ + cpu_idle_fn(busy); - mwait = (int *)PCPU_PTR(monitorbuf); - if (busy == 0) { - *mwait = MWAIT_DISABLED; - cpu_idle_hlt(busy); - return; - } - *mwait = MWAIT_WAITING; - if (sched_runnable()) - return; - cpu_monitor(mwait, 0, 0); - if (*mwait == MWAIT_WAITING) - cpu_mwait(0, MWAIT_C1); + /* Switch timers mack into active mode. */ + if (!busy) { + cpu_activeclock(); + critical_exit(); + } +out: + CTR2(KTR_SPARE2, "cpu_idle(%d) at %d done", + busy, curcpu); } int cpu_idle_wakeup(int cpu) { struct pcpu *pcpu; - int *mwait; + int *state; - if (cpu_idle_fn == cpu_idle_spin) - return (1); - if (cpu_idle_fn != cpu_idle_mwait && cpu_idle_fn != cpu_idle_mwait_hlt) - return (0); pcpu = pcpu_find(cpu); - mwait = (int *)pcpu->pc_monitorbuf; + state = (int *)pcpu->pc_monitorbuf; /* * This doesn't need to be atomic since missing the race will * simply result in unnecessary IPIs. */ - if (cpu_idle_fn == cpu_idle_mwait_hlt && *mwait == MWAIT_DISABLED) + if (*state == STATE_SLEEPING) return (0); - *mwait = MWAIT_WOKEN; - + if (*state == STATE_MWAIT) + *state = STATE_RUNNING; return (1); } @@ -771,8 +774,6 @@ struct { } idle_tbl[] = { { cpu_idle_spin, "spin" }, { cpu_idle_mwait, "mwait" }, - { cpu_idle_mwait_hlt, "mwait_hlt" }, - { cpu_idle_amdc1e, "amdc1e" }, { cpu_idle_hlt, "hlt" }, { cpu_idle_acpi, "acpi" }, { NULL, NULL } @@ -791,8 +792,8 @@ idle_sysctl_available(SYSCTL_HANDLER_ARG if (strstr(idle_tbl[i].id_name, "mwait") && (cpu_feature2 & CPUID2_MON) == 0) continue; - if (strcmp(idle_tbl[i].id_name, "amdc1e") == 0 && - cpu_ident_amdc1e == 0) + if (strcmp(idle_tbl[i].id_name, "acpi") == 0 && + cpu_idle_hook == NULL) continue; p += sprintf(p, "%s, ", idle_tbl[i].id_name); } @@ -801,6 +802,9 @@ idle_sysctl_available(SYSCTL_HANDLER_ARG return (error); } +SYSCTL_PROC(_machdep, OID_AUTO, idle_available, CTLTYPE_STRING | CTLFLAG_RD, + 0, 0, idle_sysctl_available, "A", "list of available idle functions"); + static int idle_sysctl(SYSCTL_HANDLER_ARGS) { @@ -824,8 +828,8 @@ idle_sysctl(SYSCTL_HANDLER_ARGS) if (strstr(idle_tbl[i].id_name, "mwait") && (cpu_feature2 & CPUID2_MON) == 0) continue; - if (strcmp(idle_tbl[i].id_name, "amdc1e") == 0 && - cpu_ident_amdc1e == 0) + if (strcmp(idle_tbl[i].id_name, "acpi") == 0 && + cpu_idle_hook == NULL) continue; if (strcmp(idle_tbl[i].id_name, buf)) continue; @@ -835,9 +839,6 @@ idle_sysctl(SYSCTL_HANDLER_ARGS) return (EINVAL); } -SYSCTL_PROC(_machdep, OID_AUTO, idle_available, CTLTYPE_STRING | CTLFLAG_RD, - 0, 0, idle_sysctl_available, "A", "list of available idle functions"); - SYSCTL_PROC(_machdep, OID_AUTO, idle, CTLTYPE_STRING | CTLFLAG_RW, 0, 0, idle_sysctl, "A", "currently selected idle function"); @@ -1743,8 +1744,7 @@ hammer_time(u_int64_t modulep, u_int64_t } #endif - if (cpu_probe_amdc1e()) - cpu_idle_fn = cpu_idle_amdc1e; + cpu_probe_amdc1e(); /* Location of kernel stack for locore */ return ((u_int64_t)thread0.td_pcb); Modified: head/sys/amd64/amd64/mp_machdep.c ============================================================================== --- head/sys/amd64/amd64/mp_machdep.c Mon Sep 13 07:22:14 2010 (r212540) +++ head/sys/amd64/amd64/mp_machdep.c Mon Sep 13 07:25:35 2010 (r212541) @@ -118,7 +118,6 @@ u_long *ipi_invlcache_counts[MAXCPU]; u_long *ipi_rendezvous_counts[MAXCPU]; u_long *ipi_lazypmap_counts[MAXCPU]; static u_long *ipi_hardclock_counts[MAXCPU]; -static u_long *ipi_statclock_counts[MAXCPU]; #endif extern inthand_t IDTVEC(fast_syscall), IDTVEC(fast_syscall32); @@ -1196,16 +1195,22 @@ smp_masked_invlpg_range(cpumask_t mask, void ipi_bitmap_handler(struct trapframe frame) { + struct trapframe *oldframe; + struct thread *td; int cpu = PCPU_GET(cpuid); u_int ipi_bitmap; + critical_enter(); + td = curthread; + td->td_intr_nesting_level++; + oldframe = td->td_intr_frame; + td->td_intr_frame = &frame; ipi_bitmap = atomic_readandclear_int(&cpu_ipi_pending[cpu]); - if (ipi_bitmap & (1 << IPI_PREEMPT)) { #ifdef COUNT_IPIS (*ipi_preempt_counts[cpu])++; #endif - sched_preempt(curthread); + sched_preempt(td); } if (ipi_bitmap & (1 << IPI_AST)) { #ifdef COUNT_IPIS @@ -1217,14 +1222,11 @@ ipi_bitmap_handler(struct trapframe fram #ifdef COUNT_IPIS (*ipi_hardclock_counts[cpu])++; #endif - hardclockintr(&frame); - } - if (ipi_bitmap & (1 << IPI_STATCLOCK)) { -#ifdef COUNT_IPIS - (*ipi_statclock_counts[cpu])++; -#endif - statclockintr(&frame); + hardclockintr(); } + td->td_intr_frame = oldframe; + td->td_intr_nesting_level--; + critical_exit(); } /* @@ -1579,8 +1581,6 @@ mp_ipi_intrcnt(void *dummy) intrcnt_add(buf, &ipi_lazypmap_counts[i]); snprintf(buf, sizeof(buf), "cpu%d:hardclock", i); intrcnt_add(buf, &ipi_hardclock_counts[i]); - snprintf(buf, sizeof(buf), "cpu%d:statclock", i); - intrcnt_add(buf, &ipi_statclock_counts[i]); } } SYSINIT(mp_ipi_intrcnt, SI_SUB_INTR, SI_ORDER_MIDDLE, mp_ipi_intrcnt, NULL); Modified: head/sys/amd64/include/apicvar.h ============================================================================== --- head/sys/amd64/include/apicvar.h Mon Sep 13 07:22:14 2010 (r212540) +++ head/sys/amd64/include/apicvar.h Mon Sep 13 07:25:35 2010 (r212541) @@ -123,8 +123,7 @@ #define IPI_AST 0 /* Generate software trap. */ #define IPI_PREEMPT 1 #define IPI_HARDCLOCK 2 -#define IPI_STATCLOCK 3 -#define IPI_BITMAP_LAST IPI_STATCLOCK +#define IPI_BITMAP_LAST IPI_HARDCLOCK #define IPI_IS_BITMAPED(x) ((x) <= IPI_BITMAP_LAST) #define IPI_STOP (APIC_IPI_INTS + 7) /* Stop CPU until restarted. */ Modified: head/sys/dev/acpica/acpi_cpu.c ============================================================================== --- head/sys/dev/acpica/acpi_cpu.c Mon Sep 13 07:22:14 2010 (r212540) +++ head/sys/dev/acpica/acpi_cpu.c Mon Sep 13 07:25:35 2010 (r212541) @@ -900,7 +900,13 @@ acpi_cpu_idle() /* Find the lowest state that has small enough latency. */ cx_next_idx = 0; - for (i = sc->cpu_cx_lowest; i >= 0; i--) { +#ifndef __ia64__ + if (cpu_disable_deep_sleep) + i = sc->cpu_non_c3; + else +#endif + i = sc->cpu_cx_lowest; + for (; i >= 0; i--) { if (sc->cpu_cx_states[i].trans_lat * 3 <= sc->cpu_prev_sleep) { cx_next_idx = i; break; @@ -929,15 +935,17 @@ acpi_cpu_idle() /* * Execute HLT (or equivalent) and wait for an interrupt. We can't * precisely calculate the time spent in C1 since the place we wake up - * is an ISR. Assume we slept no more then half of quantum. + * is an ISR. Assume we slept no more then half of quantum, unless + * we are called inside critical section, delaying context switch. */ if (cx_next->type == ACPI_STATE_C1) { AcpiHwRead(&start_time, &AcpiGbl_FADT.XPmTimerBlock); acpi_cpu_c1(); AcpiHwRead(&end_time, &AcpiGbl_FADT.XPmTimerBlock); - end_time = acpi_TimerDelta(end_time, start_time); - sc->cpu_prev_sleep = (sc->cpu_prev_sleep * 3 + - min(PM_USEC(end_time), 500000 / hz)) / 4; + end_time = PM_USEC(acpi_TimerDelta(end_time, start_time)); + if (curthread->td_critnest == 0) + end_time = min(end_time, 500000 / hz); + sc->cpu_prev_sleep = (sc->cpu_prev_sleep * 3 + end_time) / 4; return; } Modified: head/sys/dev/acpica/acpi_hpet.c ============================================================================== --- head/sys/dev/acpica/acpi_hpet.c Mon Sep 13 07:22:14 2010 (r212540) +++ head/sys/dev/acpica/acpi_hpet.c Mon Sep 13 07:25:35 2010 (r212541) @@ -683,15 +683,15 @@ hpet_detach(device_t dev) static int hpet_suspend(device_t dev) { - struct hpet_softc *sc; +// struct hpet_softc *sc; /* * Disable the timer during suspend. The timer will not lose * its state in S1 or S2, but we are required to disable * it. */ - sc = device_get_softc(dev); - hpet_disable(sc); +// sc = device_get_softc(dev); +// hpet_disable(sc); return (0); } Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Mon Sep 13 07:22:14 2010 (r212540) +++ head/sys/i386/i386/machdep.c Mon Sep 13 07:25:35 2010 (r212541) @@ -1175,9 +1175,6 @@ cpu_est_clockrate(int cpu_id, uint64_t * return (0); } - -void (*cpu_idle_hook)(void) = NULL; /* ACPI idle hook. */ - #ifdef XEN void @@ -1208,60 +1205,94 @@ cpu_halt(void) __asm__ ("hlt"); } +#endif + +void (*cpu_idle_hook)(void) = NULL; /* ACPI idle hook. */ +static int cpu_ident_amdc1e = 0; /* AMD C1E supported. */ +static int idle_mwait = 1; /* Use MONITOR/MWAIT for short idle. */ +TUNABLE_INT("machdep.idle_mwait", &idle_mwait); +SYSCTL_INT(_machdep, OID_AUTO, idle_mwait, CTLFLAG_RW, &idle_mwait, + 0, "Use MONITOR/MWAIT for short idle"); + +#define STATE_RUNNING 0x0 +#define STATE_MWAIT 0x1 +#define STATE_SLEEPING 0x2 + static void -cpu_idle_hlt(int busy) +cpu_idle_acpi(int busy) { - /* - * we must absolutely guarentee that hlt is the next instruction - * after sti or we introduce a timing window. - */ + int *state; + + state = (int *)PCPU_PTR(monitorbuf); + *state = STATE_SLEEPING; disable_intr(); - if (sched_runnable()) + if (sched_runnable()) enable_intr(); + else if (cpu_idle_hook) + cpu_idle_hook(); else __asm __volatile("sti; hlt"); + *state = STATE_RUNNING; } -#endif +#ifndef XEN static void -cpu_idle_acpi(int busy) +cpu_idle_hlt(int busy) { + int *state; + + state = (int *)PCPU_PTR(monitorbuf); + *state = STATE_SLEEPING; + /* + * We must absolutely guarentee that hlt is the next instruction + * after sti or we introduce a timing window. + */ disable_intr(); - if (sched_runnable()) + if (sched_runnable()) enable_intr(); - else if (cpu_idle_hook) - cpu_idle_hook(); else __asm __volatile("sti; hlt"); + *state = STATE_RUNNING; } +#endif -static int cpu_ident_amdc1e = 0; +/* + * MWAIT cpu power states. Lower 4 bits are sub-states. + */ +#define MWAIT_C0 0xf0 +#define MWAIT_C1 0x00 +#define MWAIT_C2 0x10 +#define MWAIT_C3 0x20 +#define MWAIT_C4 0x30 -static int -cpu_probe_amdc1e(void) -{ -#ifdef DEV_APIC - int i; +static void +cpu_idle_mwait(int busy) +{ + int *state; - /* - * Forget it, if we're not using local APIC timer. - */ - if (resource_disabled("apic", 0) || - (resource_int_value("apic", 0, "clock", &i) == 0 && i == 0)) - return (0); + state = (int *)PCPU_PTR(monitorbuf); + *state = STATE_MWAIT; + if (!sched_runnable()) { + cpu_monitor(state, 0, 0); + if (*state == STATE_MWAIT) + cpu_mwait(0, MWAIT_C1); + } + *state = STATE_RUNNING; +} - /* - * Detect the presence of C1E capability mostly on latest - * dual-cores (or future) k8 family. - */ - if (cpu_vendor_id == CPU_VENDOR_AMD && - (cpu_id & 0x00000f00) == 0x00000f00 && - (cpu_id & 0x0fff0000) >= 0x00040000) { - cpu_ident_amdc1e = 1; - return (1); +static void +cpu_idle_spin(int busy) +{ + int *state; + int i; + + state = (int *)PCPU_PTR(monitorbuf); + *state = STATE_RUNNING; + for (i = 0; i < 1000; i++) { + if (sched_runnable()) + return; + cpu_spinwait(); } -#endif - return (0); } /* @@ -1279,32 +1310,20 @@ cpu_probe_amdc1e(void) #define AMDK8_CMPHALT (AMDK8_SMIONCMPHALT | AMDK8_C1EONCMPHALT) static void -cpu_idle_amdc1e(int busy) +cpu_probe_amdc1e(void) { - disable_intr(); - if (sched_runnable()) - enable_intr(); - else { - uint64_t msr; - - msr = rdmsr(MSR_AMDK8_IPM); - if (msr & AMDK8_CMPHALT) - wrmsr(MSR_AMDK8_IPM, msr & ~AMDK8_CMPHALT); - - if (cpu_idle_hook) - cpu_idle_hook(); - else - __asm __volatile("sti; hlt"); + /* + * Detect the presence of C1E capability mostly on latest + * dual-cores (or future) k8 family. + */ + if (cpu_vendor_id == CPU_VENDOR_AMD && + (cpu_id & 0x00000f00) == 0x00000f00 && + (cpu_id & 0x0fff0000) >= 0x00040000) { + cpu_ident_amdc1e = 1; } } -static void -cpu_idle_spin(int busy) -{ - return; -} - #ifdef XEN void (*cpu_idle_fn)(int) = cpu_idle_hlt; #else @@ -1314,79 +1333,72 @@ void (*cpu_idle_fn)(int) = cpu_idle_acpi void cpu_idle(int busy) { + uint64_t msr; + + CTR2(KTR_SPARE2, "cpu_idle(%d) at %d", + busy, curcpu); #if defined(SMP) && !defined(XEN) if (mp_grab_cpu_hlt()) return; #endif - cpu_idle_fn(busy); -} - -/* - * mwait cpu power states. Lower 4 bits are sub-states. - */ -#define MWAIT_C0 0xf0 -#define MWAIT_C1 0x00 -#define MWAIT_C2 0x10 -#define MWAIT_C3 0x20 -#define MWAIT_C4 0x30 - -#define MWAIT_DISABLED 0x0 -#define MWAIT_WOKEN 0x1 -#define MWAIT_WAITING 0x2 + /* If we are busy - try to use fast methods. */ + if (busy) { + if ((cpu_feature2 & CPUID2_MON) && idle_mwait) { + cpu_idle_mwait(busy); + goto out; + } + } -static void -cpu_idle_mwait(int busy) -{ - int *mwait; +#ifndef XEN + /* If we have time - switch timers into idle mode. */ + if (!busy) { + critical_enter(); + cpu_idleclock(); + } +#endif - mwait = (int *)PCPU_PTR(monitorbuf); - *mwait = MWAIT_WAITING; - if (sched_runnable()) - return; - cpu_monitor(mwait, 0, 0); - if (*mwait == MWAIT_WAITING) - cpu_mwait(0, MWAIT_C1); -} + /* Apply AMD APIC timer C1E workaround. */ + if (cpu_ident_amdc1e +#ifndef XEN + && cpu_disable_deep_sleep +#endif + ) { + msr = rdmsr(MSR_AMDK8_IPM); + if (msr & AMDK8_CMPHALT) + wrmsr(MSR_AMDK8_IPM, msr & ~AMDK8_CMPHALT); + } -static void -cpu_idle_mwait_hlt(int busy) -{ - int *mwait; + /* Call main idle method. */ + cpu_idle_fn(busy); - mwait = (int *)PCPU_PTR(monitorbuf); - if (busy == 0) { - *mwait = MWAIT_DISABLED; - cpu_idle_hlt(busy); - return; +#ifndef XEN + /* Switch timers mack into active mode. */ + if (!busy) { + cpu_activeclock(); + critical_exit(); } - *mwait = MWAIT_WAITING; - if (sched_runnable()) - return; - cpu_monitor(mwait, 0, 0); - if (*mwait == MWAIT_WAITING) - cpu_mwait(0, MWAIT_C1); +#endif +out: + CTR2(KTR_SPARE2, "cpu_idle(%d) at %d done", + busy, curcpu); } int cpu_idle_wakeup(int cpu) { struct pcpu *pcpu; - int *mwait; + int *state; - if (cpu_idle_fn == cpu_idle_spin) - return (1); - if (cpu_idle_fn != cpu_idle_mwait && cpu_idle_fn != cpu_idle_mwait_hlt) - return (0); pcpu = pcpu_find(cpu); - mwait = (int *)pcpu->pc_monitorbuf; + state = (int *)pcpu->pc_monitorbuf; /* * This doesn't need to be atomic since missing the race will * simply result in unnecessary IPIs. */ - if (cpu_idle_fn == cpu_idle_mwait_hlt && *mwait == MWAIT_DISABLED) + if (*state == STATE_SLEEPING) return (0); - *mwait = MWAIT_WOKEN; - + if (*state == STATE_MWAIT) + *state = STATE_RUNNING; return (1); } @@ -1399,8 +1411,6 @@ struct { } idle_tbl[] = { { cpu_idle_spin, "spin" }, { cpu_idle_mwait, "mwait" }, - { cpu_idle_mwait_hlt, "mwait_hlt" }, - { cpu_idle_amdc1e, "amdc1e" }, { cpu_idle_hlt, "hlt" }, { cpu_idle_acpi, "acpi" }, { NULL, NULL } @@ -1419,8 +1429,8 @@ idle_sysctl_available(SYSCTL_HANDLER_ARG if (strstr(idle_tbl[i].id_name, "mwait") && (cpu_feature2 & CPUID2_MON) == 0) continue; - if (strcmp(idle_tbl[i].id_name, "amdc1e") == 0 && - cpu_ident_amdc1e == 0) + if (strcmp(idle_tbl[i].id_name, "acpi") == 0 && + cpu_idle_hook == NULL) continue; p += sprintf(p, "%s, ", idle_tbl[i].id_name); } @@ -1429,6 +1439,9 @@ idle_sysctl_available(SYSCTL_HANDLER_ARG return (error); } +SYSCTL_PROC(_machdep, OID_AUTO, idle_available, CTLTYPE_STRING | CTLFLAG_RD, + 0, 0, idle_sysctl_available, "A", "list of available idle functions"); + static int idle_sysctl(SYSCTL_HANDLER_ARGS) { @@ -1452,8 +1465,8 @@ idle_sysctl(SYSCTL_HANDLER_ARGS) if (strstr(idle_tbl[i].id_name, "mwait") && (cpu_feature2 & CPUID2_MON) == 0) continue; - if (strcmp(idle_tbl[i].id_name, "amdc1e") == 0 && - cpu_ident_amdc1e == 0) + if (strcmp(idle_tbl[i].id_name, "acpi") == 0 && + cpu_idle_hook == NULL) continue; if (strcmp(idle_tbl[i].id_name, buf)) continue; @@ -1463,9 +1476,6 @@ idle_sysctl(SYSCTL_HANDLER_ARGS) return (EINVAL); } -SYSCTL_PROC(_machdep, OID_AUTO, idle_available, CTLTYPE_STRING | CTLFLAG_RD, - 0, 0, idle_sysctl_available, "A", "list of available idle functions"); - SYSCTL_PROC(_machdep, OID_AUTO, idle, CTLTYPE_STRING | CTLFLAG_RW, 0, 0, idle_sysctl, "A", "currently selected idle function"); @@ -2695,8 +2705,7 @@ init386(first) thread0.td_pcb->pcb_fsd = PCPU_GET(fsgs_gdt)[0]; thread0.td_pcb->pcb_gsd = PCPU_GET(fsgs_gdt)[1]; - if (cpu_probe_amdc1e()) - cpu_idle_fn = cpu_idle_amdc1e; + cpu_probe_amdc1e(); } #else @@ -2970,8 +2979,7 @@ init386(first) thread0.td_pcb->pcb_ext = 0; thread0.td_frame = &proc0_tf; - if (cpu_probe_amdc1e()) - cpu_idle_fn = cpu_idle_amdc1e; + cpu_probe_amdc1e(); } #endif Modified: head/sys/i386/i386/mp_machdep.c ============================================================================== --- head/sys/i386/i386/mp_machdep.c Mon Sep 13 07:22:14 2010 (r212540) +++ head/sys/i386/i386/mp_machdep.c Mon Sep 13 07:25:35 2010 (r212541) @@ -167,7 +167,6 @@ u_long *ipi_invlcache_counts[MAXCPU]; u_long *ipi_rendezvous_counts[MAXCPU]; u_long *ipi_lazypmap_counts[MAXCPU]; static u_long *ipi_hardclock_counts[MAXCPU]; -static u_long *ipi_statclock_counts[MAXCPU]; #endif /* @@ -1284,16 +1283,22 @@ smp_masked_invlpg_range(cpumask_t mask, void ipi_bitmap_handler(struct trapframe frame) { + struct trapframe *oldframe; + struct thread *td; int cpu = PCPU_GET(cpuid); u_int ipi_bitmap; + critical_enter(); + td = curthread; + td->td_intr_nesting_level++; + oldframe = td->td_intr_frame; + td->td_intr_frame = &frame; ipi_bitmap = atomic_readandclear_int(&cpu_ipi_pending[cpu]); - if (ipi_bitmap & (1 << IPI_PREEMPT)) { #ifdef COUNT_IPIS (*ipi_preempt_counts[cpu])++; #endif - sched_preempt(curthread); + sched_preempt(td); } if (ipi_bitmap & (1 << IPI_AST)) { #ifdef COUNT_IPIS @@ -1305,14 +1310,11 @@ ipi_bitmap_handler(struct trapframe fram #ifdef COUNT_IPIS (*ipi_hardclock_counts[cpu])++; #endif - hardclockintr(&frame); - } - if (ipi_bitmap & (1 << IPI_STATCLOCK)) { -#ifdef COUNT_IPIS - (*ipi_statclock_counts[cpu])++; -#endif - statclockintr(&frame); + hardclockintr(); } + td->td_intr_frame = oldframe; + td->td_intr_nesting_level--; + critical_exit(); } /* @@ -1627,8 +1629,6 @@ mp_ipi_intrcnt(void *dummy) intrcnt_add(buf, &ipi_lazypmap_counts[i]); snprintf(buf, sizeof(buf), "cpu%d:hardclock", i); intrcnt_add(buf, &ipi_hardclock_counts[i]); - snprintf(buf, sizeof(buf), "cpu%d:statclock", i); - intrcnt_add(buf, &ipi_statclock_counts[i]); } } SYSINIT(mp_ipi_intrcnt, SI_SUB_INTR, SI_ORDER_MIDDLE, mp_ipi_intrcnt, NULL); Modified: head/sys/i386/include/apicvar.h ============================================================================== --- head/sys/i386/include/apicvar.h Mon Sep 13 07:22:14 2010 (r212540) +++ head/sys/i386/include/apicvar.h Mon Sep 13 07:25:35 2010 (r212541) @@ -124,8 +124,7 @@ #define IPI_AST 0 /* Generate software trap. */ #define IPI_PREEMPT 1 #define IPI_HARDCLOCK 2 -#define IPI_STATCLOCK 3 -#define IPI_BITMAP_LAST IPI_STATCLOCK +#define IPI_BITMAP_LAST IPI_HARDCLOCK #define IPI_IS_BITMAPED(x) ((x) <= IPI_BITMAP_LAST) #define IPI_STOP (APIC_IPI_INTS + 7) /* Stop CPU until restarted. */ @@ -152,8 +151,7 @@ #define IPI_AST 0 /* Generate software trap. */ #define IPI_PREEMPT 1 #define IPI_HARDCLOCK 2 -#define IPI_STATCLOCK 3 -#define IPI_BITMAP_LAST IPI_STATCLOCK +#define IPI_BITMAP_LAST IPI_HARDCLOCK #define IPI_IS_BITMAPED(x) ((x) <= IPI_BITMAP_LAST) #define IPI_STOP (APIC_IPI_INTS + 7) /* Stop CPU until restarted. */ Modified: head/sys/kern/kern_clock.c ============================================================================== --- head/sys/kern/kern_clock.c Mon Sep 13 07:22:14 2010 (r212540) +++ head/sys/kern/kern_clock.c Mon Sep 13 07:25:35 2010 (r212541) @@ -373,11 +373,9 @@ int profprocs; int ticks; int psratio; -int timer1hz; -int timer2hz; -static DPCPU_DEFINE(u_int, hard_cnt); -static DPCPU_DEFINE(u_int, stat_cnt); -static DPCPU_DEFINE(u_int, prof_cnt); +static DPCPU_DEFINE(int, pcputicks); /* Per-CPU version of ticks. */ +static struct mtx global_hardclock_mtx; +MTX_SYSINIT(global_hardclock_mtx, &global_hardclock_mtx, "ghc_mtx", MTX_SPIN); /* * Initialize clock frequencies and start both clocks running. @@ -408,52 +406,6 @@ initclocks(dummy) #endif } -void -timer1clock(int usermode, uintfptr_t pc) -{ - u_int *cnt; - - cnt = DPCPU_PTR(hard_cnt); - *cnt += hz; - if (*cnt >= timer1hz) { - *cnt -= timer1hz; - if (*cnt >= timer1hz) - *cnt = 0; - if (PCPU_GET(cpuid) == 0) - hardclock(usermode, pc); - else - hardclock_cpu(usermode); - } - if (timer2hz == 0) - timer2clock(usermode, pc); -} - -void -timer2clock(int usermode, uintfptr_t pc) -{ - u_int *cnt; - int t2hz = timer2hz ? timer2hz : timer1hz; - - cnt = DPCPU_PTR(stat_cnt); - *cnt += stathz; - if (*cnt >= t2hz) { - *cnt -= t2hz; - if (*cnt >= t2hz) - *cnt = 0; - statclock(usermode); - } - if (profprocs == 0) - return; - cnt = DPCPU_PTR(prof_cnt); - *cnt += profhz; - if (*cnt >= t2hz) { - *cnt -= t2hz; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Mon Sep 13 07:27:03 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C9AF81065673; Mon, 13 Sep 2010 07:27:03 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9FEFD8FC12; Mon, 13 Sep 2010 07:27:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8D7R3f3073554; Mon, 13 Sep 2010 07:27:03 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8D7R3WP073552; Mon, 13 Sep 2010 07:27:03 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201009130727.o8D7R3WP073552@svn.freebsd.org> From: Warner Losh Date: Mon, 13 Sep 2010 07:27:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212542 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2010 07:27:03 -0000 Author: imp Date: Mon Sep 13 07:27:03 2010 New Revision: 212542 URL: http://svn.freebsd.org/changeset/base/212542 Log: Prefer MACHINE_CPUARCH over MACHINE_ARCH Modified: head/sys/conf/kern.mk Modified: head/sys/conf/kern.mk ============================================================================== --- head/sys/conf/kern.mk Mon Sep 13 07:25:35 2010 (r212541) +++ head/sys/conf/kern.mk Mon Sep 13 07:27:03 2010 (r212542) @@ -29,7 +29,7 @@ CWARNFLAGS?= -Wall -Wredundant-decls -Wn # operations inside the kernel itself. These operations are exclusively # reserved for user applications. # -.if ${MACHINE_ARCH} == "i386" && ${CC:T:Micc} != "icc" +.if ${MACHINE_CPUARCH} == "i386" && ${CC:T:Micc} != "icc" .if ${CC:T:Mclang} != "clang" CFLAGS+= -mno-align-long-strings -mpreferred-stack-boundary=2 .endif @@ -37,14 +37,14 @@ CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -m INLINE_LIMIT?= 8000 .endif -.if ${MACHINE_ARCH} == "arm" +.if ${MACHINE_CPUARCH} == "arm" INLINE_LIMIT?= 8000 .endif # # For IA-64, we use r13 for the kernel globals pointer and we only use # a very small subset of float registers for integer divides. # -.if ${MACHINE_ARCH} == "ia64" +.if ${MACHINE_CPUARCH} == "ia64" CFLAGS+= -ffixed-r13 -mfixed-range=f32-f127 -fpic #-mno-sdata INLINE_LIMIT?= 15000 .endif @@ -54,7 +54,7 @@ INLINE_LIMIT?= 15000 # point emulation. This avoids using floating point registers for integer # operations which it has a tendency to do. # -.if ${MACHINE_ARCH} == "sparc64" +.if ${MACHINE_CPUARCH} == "sparc64" CFLAGS+= -mcmodel=medany -msoft-float INLINE_LIMIT?= 15000 .endif @@ -64,7 +64,7 @@ INLINE_LIMIT?= 15000 # operations inside the kernel itself. These operations are exclusively # reserved for user applications. # -.if ${MACHINE_ARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "amd64" CFLAGS+= -mcmodel=kernel -mno-red-zone \ -mfpmath=387 -mno-sse -mno-sse2 -mno-sse3 -mno-mmx -mno-3dnow \ -msoft-float -fno-asynchronous-unwind-tables @@ -76,7 +76,7 @@ INLINE_LIMIT?= 8000 # floating point registers for integer operations which it has a tendency to do. # Also explicitly disable Altivec instructions inside the kernel. # -.if ${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "powerpc64" +.if ${MACHINE_CPUARCH} == "powerpc" CFLAGS+= -msoft-float -mno-altivec INLINE_LIMIT?= 15000 .endif @@ -84,7 +84,7 @@ INLINE_LIMIT?= 15000 # # For MIPS we also tell gcc to use floating point emulation # -.if ${MACHINE_ARCH} == "mips" +.if ${MACHINE_CPUARCH} == "mips" CFLAGS+= -msoft-float INLINE_LIMIT?= 8000 .endif @@ -106,8 +106,9 @@ CFLAGS+= -restrict # # GCC SSP support. # -.if ${MK_SSP} != "no" && ${CC:T:Micc} != "icc" && ${MACHINE_ARCH} != "ia64" && \ - ${MACHINE_ARCH} != "arm" && ${MACHINE_ARCH} != "mips" +.if ${MK_SSP} != "no" && ${CC:T:Micc} != "icc" && \ + ${MACHINE_CPUARCH} != "ia64" && ${MACHINE_CPUARCH} != "arm" && \ + ${MACHINE_CPUARCH} != "mips" CFLAGS+= -fstack-protector .endif From owner-svn-src-head@FreeBSD.ORG Mon Sep 13 07:29:02 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 99D431065674; Mon, 13 Sep 2010 07:29:02 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6EF2F8FC1C; Mon, 13 Sep 2010 07:29:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8D7T2LC073717; Mon, 13 Sep 2010 07:29:02 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8D7T2WA073714; Mon, 13 Sep 2010 07:29:02 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201009130729.o8D7T2WA073714@svn.freebsd.org> From: Warner Losh Date: Mon, 13 Sep 2010 07:29:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212543 - in head/sys/modules: opensolaris zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2010 07:29:02 -0000 Author: imp Date: Mon Sep 13 07:29:02 2010 New Revision: 212543 URL: http://svn.freebsd.org/changeset/base/212543 Log: Simplify atomic selection Modified: head/sys/modules/opensolaris/Makefile head/sys/modules/zfs/Makefile Modified: head/sys/modules/opensolaris/Makefile ============================================================================== --- head/sys/modules/opensolaris/Makefile Mon Sep 13 07:27:03 2010 (r212542) +++ head/sys/modules/opensolaris/Makefile Mon Sep 13 07:29:02 2010 (r212543) @@ -8,8 +8,12 @@ SRCS= opensolaris.c \ opensolaris_kmem.c \ opensolaris_misc.c -.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "ia64" || ${MACHINE_ARCH} == "sparc64" || ${MACHINE_ARCH} == "powerpc64" -.PATH: ${.CURDIR}/../../cddl/contrib/opensolaris/common/atomic/${MACHINE_ARCH} +_A=${.CURDIR}/../../cddl/contrib/opensolaris/common/atomic +.if exists(${_A}/${MACHINE_CPUARCH}/opensolaris_atomic.S) +.PATH: ${_A}/${MACHINE_CPUARCH} +SRCS+= opensolaris_atomic.S +.elif exists(${_A}/${MACHINE_ARCH}/opensolaris_atomic.S) +.PATH: ${_A}/${MACHINE_ARCH} SRCS+= opensolaris_atomic.S .else SRCS+= opensolaris_atomic.c Modified: head/sys/modules/zfs/Makefile ============================================================================== --- head/sys/modules/zfs/Makefile Mon Sep 13 07:27:03 2010 (r212542) +++ head/sys/modules/zfs/Makefile Mon Sep 13 07:29:02 2010 (r212543) @@ -27,12 +27,15 @@ SRCS+= opensolaris_uio.c SRCS+= opensolaris_vfs.c SRCS+= opensolaris_zone.c -.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "ia64" || ${MACHINE_ARCH} == "sparc64" || ${MACHINE_ARCH} == "powerpc64" -.PATH: ${SUNW}/common/atomic/${MACHINE_ARCH} -SRCS+= opensolaris_atomic.S +_A=${.CURDIR}/../../cddl/contrib/opensolaris/common/atomic +.if exists(${_A}/${MACHINE_CPUARCH}/opensolaris_atomic.S) +.PATH: ${_A}/${MACHINE_CPUARCH} +SRCS+= opensolaris_atomic.S +.elif exists(${_A}/${MACHINE_ARCH}/opensolaris_atomic.S) +.PATH: ${_A}/${MACHINE_ARCH} +SRCS+= opensolaris_atomic.S .else -.PATH: ${.CURDIR}/../../cddl/compat/opensolaris/kern -SRCS+= opensolaris_atomic.c +SRCS+= opensolaris_atomic.c .endif .PATH: ${SUNW}/uts/common/fs From owner-svn-src-head@FreeBSD.ORG Mon Sep 13 08:34:21 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 555BD1065670; Mon, 13 Sep 2010 08:34:21 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 145AA8FC0C; Mon, 13 Sep 2010 08:34:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8D8YKoA079018; Mon, 13 Sep 2010 08:34:20 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8D8YKTr079016; Mon, 13 Sep 2010 08:34:20 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201009130834.o8D8YKTr079016@svn.freebsd.org> From: Andriy Gapon Date: Mon, 13 Sep 2010 08:34:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212544 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2010 08:34:21 -0000 Author: avg Date: Mon Sep 13 08:34:20 2010 New Revision: 212544 URL: http://svn.freebsd.org/changeset/base/212544 Log: bus_add_child: add specialized default implementation that calls panic If a kobj method doesn't have any explicitly provided default implementation, then it is auto-assigned kobj_error_method. kobj_error_method is proper only for methods that return error code, because it just returns ENXIO. So, in the case of unimplemented bus_add_child caller would get (device_t)ENXIO as a return value, which would cause the mistake to go unnoticed, because return value is typically checked for NULL. Thus, a specialized null_add_child is added. It would have sufficied for correctness to return NULL, but this type of mistake was deemed to be rare and serious enough to call panic instead. Watch out for this kind of problem with other kobj methods. Suggested by: jhb, imp MFC after: 2 weeks Modified: head/sys/kern/bus_if.m Modified: head/sys/kern/bus_if.m ============================================================================== --- head/sys/kern/bus_if.m Mon Sep 13 07:29:02 2010 (r212543) +++ head/sys/kern/bus_if.m Mon Sep 13 08:34:20 2010 (r212544) @@ -26,6 +26,8 @@ # $FreeBSD$ # +#include +#include #include /** @@ -56,6 +58,14 @@ CODE { return (BUS_REMAP_INTR(dev, NULL, irq)); return (ENXIO); } + + static device_t + null_add_child(device_t bus, int order, const char *name, + int unit) + { + + panic("bus_add_child is not implemented"); + } }; /** @@ -203,7 +213,7 @@ METHOD device_t add_child { u_int _order; const char *_name; int _unit; -}; +} DEFAULT null_add_child; /** * @brief Allocate a system resource From owner-svn-src-head@FreeBSD.ORG Mon Sep 13 08:56:07 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 65FBA106566C; Mon, 13 Sep 2010 08:56:07 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 51C218FC18; Mon, 13 Sep 2010 08:56:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8D8u7qe080934; Mon, 13 Sep 2010 08:56:07 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8D8u7iB080925; Mon, 13 Sep 2010 08:56:07 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201009130856.o8D8u7iB080925@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Mon, 13 Sep 2010 08:56:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212547 - in head: sbin/geom/class/eli sbin/geom/class/mirror sbin/geom/class/part sbin/geom/class/sched sbin/geom/core sys/geom/eli sys/geom/mirror X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2010 08:56:07 -0000 Author: pjd Date: Mon Sep 13 08:56:07 2010 New Revision: 212547 URL: http://svn.freebsd.org/changeset/base/212547 Log: - Allow to specify value as const pointers. - Make optional string values always an empty string. Modified: head/sbin/geom/class/eli/geom_eli.c head/sbin/geom/class/mirror/geom_mirror.c head/sbin/geom/class/part/geom_part.c head/sbin/geom/class/sched/geom_sched.c head/sbin/geom/core/geom.c head/sbin/geom/core/geom.h head/sys/geom/eli/g_eli_ctl.c head/sys/geom/mirror/g_mirror_ctl.c Modified: head/sbin/geom/class/eli/geom_eli.c ============================================================================== --- head/sbin/geom/class/eli/geom_eli.c Mon Sep 13 08:49:51 2010 (r212546) +++ head/sbin/geom/class/eli/geom_eli.c Mon Sep 13 08:56:07 2010 (r212547) @@ -55,15 +55,12 @@ uint32_t lib_version = G_LIB_VERSION; uint32_t version = G_ELI_VERSION; #define GELI_BACKUP_DIR "/var/backups/" +#define GELI_ENC_ALGO "aes" -static char aalgo[] = "none"; -static char ealgo[] = "aes"; static intmax_t keylen = 0; static intmax_t keyno = -1; static intmax_t iterations = -1; static intmax_t sectorsize = 0; -static char keyfile[] = "", newkeyfile[] = ""; -static char backupfile[] = ""; static void eli_main(struct gctl_req *req, unsigned flags); static void eli_init(struct gctl_req *req); @@ -101,12 +98,12 @@ static int eli_backup_create(struct gctl struct g_command class_commands[] = { { "init", G_FLAG_VERBOSE, eli_main, { - { 'a', "aalgo", aalgo, G_TYPE_STRING }, + { 'a', "aalgo", "", G_TYPE_STRING }, { 'b', "boot", NULL, G_TYPE_BOOL }, - { 'B', "backupfile", backupfile, G_TYPE_STRING }, - { 'e', "ealgo", ealgo, G_TYPE_STRING }, + { 'B', "backupfile", "", G_TYPE_STRING }, + { 'e', "ealgo", GELI_ENC_ALGO, G_TYPE_STRING }, { 'i', "iterations", &iterations, G_TYPE_NUMBER }, - { 'K', "newkeyfile", newkeyfile, G_TYPE_STRING }, + { 'K', "newkeyfile", "", G_TYPE_STRING }, { 'l', "keylen", &keylen, G_TYPE_NUMBER }, { 'P', "nonewpassphrase", NULL, G_TYPE_BOOL }, { 's', "sectorsize", §orsize, G_TYPE_NUMBER }, @@ -116,12 +113,12 @@ struct g_command class_commands[] = { }, { "label", G_FLAG_VERBOSE, eli_main, { - { 'a', "aalgo", aalgo, G_TYPE_STRING }, + { 'a', "aalgo", "", G_TYPE_STRING }, { 'b', "boot", NULL, G_TYPE_BOOL }, - { 'B', "backupfile", backupfile, G_TYPE_STRING }, - { 'e', "ealgo", ealgo, G_TYPE_STRING }, + { 'B', "backupfile", "", G_TYPE_STRING }, + { 'e', "ealgo", GELI_ENC_ALGO, G_TYPE_STRING }, { 'i', "iterations", &iterations, G_TYPE_NUMBER }, - { 'K', "newkeyfile", newkeyfile, G_TYPE_STRING }, + { 'K', "newkeyfile", "", G_TYPE_STRING }, { 'l', "keylen", &keylen, G_TYPE_NUMBER }, { 'P', "nonewpassphrase", NULL, G_TYPE_BOOL }, { 's', "sectorsize", §orsize, G_TYPE_NUMBER }, @@ -132,7 +129,7 @@ struct g_command class_commands[] = { { "attach", G_FLAG_VERBOSE | G_FLAG_LOADKLD, eli_main, { { 'd', "detach", NULL, G_TYPE_BOOL }, - { 'k', "keyfile", keyfile, G_TYPE_STRING }, + { 'k', "keyfile", "", G_TYPE_STRING }, { 'p', "nopassphrase", NULL, G_TYPE_BOOL }, { 'r', "readonly", NULL, G_TYPE_BOOL }, G_OPT_SENTINEL @@ -157,9 +154,9 @@ struct g_command class_commands[] = { }, { "onetime", G_FLAG_VERBOSE | G_FLAG_LOADKLD, NULL, { - { 'a', "aalgo", aalgo, G_TYPE_STRING }, + { 'a', "aalgo", "", G_TYPE_STRING }, { 'd', "detach", NULL, G_TYPE_BOOL }, - { 'e', "ealgo", ealgo, G_TYPE_STRING }, + { 'e', "ealgo", GELI_ENC_ALGO, G_TYPE_STRING }, { 'l', "keylen", &keylen, G_TYPE_NUMBER }, { 's', "sectorsize", §orsize, G_TYPE_NUMBER }, G_OPT_SENTINEL @@ -177,8 +174,8 @@ struct g_command class_commands[] = { { "setkey", G_FLAG_VERBOSE, eli_main, { { 'i', "iterations", &iterations, G_TYPE_NUMBER }, - { 'k', "keyfile", keyfile, G_TYPE_STRING }, - { 'K', "newkeyfile", newkeyfile, G_TYPE_STRING }, + { 'k', "keyfile", "", G_TYPE_STRING }, + { 'K', "newkeyfile", "", G_TYPE_STRING }, { 'n', "keyno", &keyno, G_TYPE_NUMBER }, { 'p', "nopassphrase", NULL, G_TYPE_BOOL }, { 'P', "nonewpassphrase", NULL, G_TYPE_BOOL }, @@ -551,7 +548,7 @@ eli_init(struct gctl_req *req) md.md_flags |= G_ELI_FLAG_BOOT; md.md_ealgo = CRYPTO_ALGORITHM_MIN - 1; str = gctl_get_ascii(req, "aalgo"); - if (strcmp(str, "none") != 0) { + if (*str != '\0') { md.md_aalgo = g_eli_str2aalgo(str); if (md.md_aalgo >= CRYPTO_ALGORITHM_MIN && md.md_aalgo <= CRYPTO_ALGORITHM_MAX) { Modified: head/sbin/geom/class/mirror/geom_mirror.c ============================================================================== --- head/sbin/geom/class/mirror/geom_mirror.c Mon Sep 13 08:49:51 2010 (r212546) +++ head/sbin/geom/class/mirror/geom_mirror.c Mon Sep 13 08:56:07 2010 (r212547) @@ -44,7 +44,8 @@ __FBSDID("$FreeBSD$"); uint32_t lib_version = G_LIB_VERSION; uint32_t version = G_MIRROR_VERSION; -static char label_balance[] = "load", configure_balance[] = "none"; +#define GMIRROR_BALANCE "load" + static intmax_t label_slice = 4096, configure_slice = -1; static intmax_t insert_priority = 0, configure_priority = -1; @@ -64,7 +65,7 @@ struct g_command class_commands[] = { { "configure", G_FLAG_VERBOSE, NULL, { { 'a', "autosync", NULL, G_TYPE_BOOL }, - { 'b', "balance", configure_balance, G_TYPE_STRING }, + { 'b', "balance", "", G_TYPE_STRING }, { 'd', "dynamic", NULL, G_TYPE_BOOL }, { 'f', "failsync", NULL, G_TYPE_BOOL }, { 'F', "nofailsync", NULL, G_TYPE_BOOL }, @@ -88,7 +89,7 @@ struct g_command class_commands[] = { }, { "label", G_FLAG_VERBOSE, mirror_main, { - { 'b', "balance", label_balance, G_TYPE_STRING }, + { 'b', "balance", GMIRROR_BALANCE, G_TYPE_STRING }, { 'F', "nofailsync", NULL, G_TYPE_BOOL }, { 'h', "hardcode", NULL, G_TYPE_BOOL }, { 'n', "noautosync", NULL, G_TYPE_BOOL }, Modified: head/sbin/geom/class/part/geom_part.c ============================================================================== --- head/sbin/geom/class/part/geom_part.c Mon Sep 13 08:49:51 2010 (r212546) +++ head/sbin/geom/class/part/geom_part.c Mon Sep 13 08:56:07 2010 (r212547) @@ -59,7 +59,6 @@ uint32_t PUBSYM(lib_version) = G_LIB_VER uint32_t PUBSYM(version) = 0; static char autofill[] = "*"; -static char optional[] = ""; static char flags[] = "C"; static char sstart[32]; @@ -91,16 +90,16 @@ struct g_command PUBSYM(class_commands)[ { 'b', "start", autofill, G_TYPE_STRING }, { 's', "size", autofill, G_TYPE_STRING }, { 't', "type", NULL, G_TYPE_STRING }, - { 'i', index_param, optional, G_TYPE_ASCNUM }, - { 'l', "label", optional, G_TYPE_STRING }, + { 'i', index_param, "", G_TYPE_ASCNUM }, + { 'l', "label", "", G_TYPE_STRING }, { 'f', "flags", flags, G_TYPE_STRING }, G_OPT_SENTINEL }, "geom", NULL }, { "bootcode", 0, gpart_bootcode, { - { 'b', bootcode_param, optional, G_TYPE_STRING }, - { 'p', partcode_param, optional, G_TYPE_STRING }, - { 'i', index_param, optional, G_TYPE_ASCNUM }, + { 'b', bootcode_param, "", G_TYPE_STRING }, + { 'p', partcode_param, "", G_TYPE_STRING }, + { 'i', index_param, "", G_TYPE_ASCNUM }, { 'f', "flags", flags, G_TYPE_STRING }, G_OPT_SENTINEL }, "geom", NULL @@ -108,7 +107,7 @@ struct g_command PUBSYM(class_commands)[ { "commit", 0, gpart_issue, G_NULL_OPTS, "geom", NULL }, { "create", 0, gpart_issue, { { 's', "scheme", NULL, G_TYPE_STRING }, - { 'n', "entries", optional, G_TYPE_ASCNUM }, + { 'n', "entries", "", G_TYPE_ASCNUM }, { 'f', "flags", flags, G_TYPE_STRING }, G_OPT_SENTINEL }, "provider", NULL @@ -125,8 +124,8 @@ struct g_command PUBSYM(class_commands)[ "geom", NULL }, { "modify", 0, gpart_issue, { { 'i', index_param, NULL, G_TYPE_ASCNUM }, - { 'l', "label", optional, G_TYPE_STRING }, - { 't', "type", optional, G_TYPE_STRING }, + { 'l', "label", "", G_TYPE_STRING }, + { 't', "type", "", G_TYPE_STRING }, { 'f', "flags", flags, G_TYPE_STRING }, G_OPT_SENTINEL }, "geom", NULL Modified: head/sbin/geom/class/sched/geom_sched.c ============================================================================== --- head/sbin/geom/class/sched/geom_sched.c Mon Sep 13 08:49:51 2010 (r212546) +++ head/sbin/geom/class/sched/geom_sched.c Mon Sep 13 08:56:07 2010 (r212547) @@ -54,7 +54,7 @@ uint32_t version = G_SCHED_VERSION; * storage for parameters used by this geom class. * Right now only the scheduler name is used. */ -static char algo[] = "rr"; /* default scheduler */ +#define GSCHED_ALGO "rr" /* default scheduler */ /* * Adapt to differences in geom library. @@ -76,7 +76,7 @@ gcmd_createinsert(struct gctl_req *req, if (gctl_has_param(req, "algo")) reqalgo = gctl_get_ascii(req, "algo"); else - reqalgo = algo; + reqalgo = GSCHED_ALGO; snprintf(name, sizeof(name), "gsched_%s", reqalgo); /* @@ -91,21 +91,21 @@ gcmd_createinsert(struct gctl_req *req, struct g_command class_commands[] = { { "create", G_FLAG_VERBOSE | G_FLAG_LOADKLD, gcmd_createinsert, { - { 'a', "algo", algo, G_TYPE_STRING }, + { 'a', "algo", GSCHED_ALGO, G_TYPE_STRING }, G_OPT_SENTINEL }, G_ARGNAME "[-v] [-a algorithm_name] dev ..." }, { "insert", G_FLAG_VERBOSE | G_FLAG_LOADKLD, gcmd_createinsert, { - { 'a', "algo", algo, G_TYPE_STRING }, + { 'a', "algo", GSCHED_ALGO, G_TYPE_STRING }, G_OPT_SENTINEL }, G_ARGNAME "[-v] [-a algorithm_name] dev ..." }, { "configure", G_FLAG_VERBOSE, NULL, { - { 'a', "algo", algo, G_TYPE_STRING }, + { 'a', "algo", GSCHED_ALGO, G_TYPE_STRING }, G_OPT_SENTINEL }, G_ARGNAME "[-v] [-a algorithm_name] prov ..." Modified: head/sbin/geom/core/geom.c ============================================================================== --- head/sbin/geom/core/geom.c Mon Sep 13 08:49:51 2010 (r212546) +++ head/sbin/geom/core/geom.c Mon Sep 13 08:56:07 2010 (r212547) @@ -236,8 +236,8 @@ find_option(struct g_command *cmd, char static void set_option(struct gctl_req *req, struct g_option *opt, const char *val) { - char *s; uint64_t number; + void *ptr; if (G_OPT_TYPE(opt) == G_TYPE_NUMBER || G_OPT_TYPE(opt) == G_TYPE_ASCNUM) { @@ -245,27 +245,29 @@ set_option(struct gctl_req *req, struct err(EXIT_FAILURE, "Invalid value for '%c' argument.", opt->go_char); } - if (G_OPT_TYPE(opt) == G_TYPE_NUMBER) - opt->go_val = malloc(sizeof(intmax_t)); - else { - asprintf(&s, "%jd", number); - opt->go_val = s; - } - if (opt->go_val == NULL) - errx(EXIT_FAILURE, "No memory."); if (G_OPT_TYPE(opt) == G_TYPE_NUMBER) { - *(intmax_t *)opt->go_val = number; + ptr = malloc(sizeof(intmax_t)); + if (ptr == NULL) + errx(EXIT_FAILURE, "No memory."); + *(intmax_t *)ptr = number; + opt->go_val = ptr; gctl_ro_param(req, opt->go_name, sizeof(intmax_t), opt->go_val); - } else + } else { + asprintf((void *)(&ptr), "%jd", number); + if (ptr == NULL) + errx(EXIT_FAILURE, "No memory."); + opt->go_val = ptr; gctl_ro_param(req, opt->go_name, -1, opt->go_val); + } } else if (G_OPT_TYPE(opt) == G_TYPE_STRING) { gctl_ro_param(req, opt->go_name, -1, val); } else if (G_OPT_TYPE(opt) == G_TYPE_BOOL) { - opt->go_val = malloc(sizeof(int)); - if (opt->go_val == NULL) + ptr = malloc(sizeof(int)); + if (ptr == NULL) errx(EXIT_FAILURE, "No memory."); - *(int *)opt->go_val = *val - '0'; + *(int *)ptr = *val - '0'; + opt->go_val = ptr; gctl_ro_param(req, opt->go_name, sizeof(int), opt->go_val); } else { assert(!"Invalid type"); @@ -354,7 +356,7 @@ parse_arguments(struct g_command *cmd, s G_OPT_TYPE(opt) == G_TYPE_ASCNUM) { if (cmd->gc_argname == NULL || opt->go_val == NULL || - *(char *)opt->go_val != '\0') + *(const char *)opt->go_val != '\0') gctl_ro_param(req, opt->go_name, -1, opt->go_val); } else { Modified: head/sbin/geom/core/geom.h ============================================================================== --- head/sbin/geom/core/geom.h Mon Sep 13 08:49:51 2010 (r212546) +++ head/sbin/geom/core/geom.h Mon Sep 13 08:56:07 2010 (r212547) @@ -54,7 +54,7 @@ struct g_option { char go_char; const char *go_name; - void *go_val; + const void *go_val; unsigned go_type; }; Modified: head/sys/geom/eli/g_eli_ctl.c ============================================================================== --- head/sys/geom/eli/g_eli_ctl.c Mon Sep 13 08:49:51 2010 (r212546) +++ head/sys/geom/eli/g_eli_ctl.c Mon Sep 13 08:56:07 2010 (r212547) @@ -269,7 +269,7 @@ g_eli_ctl_onetime(struct gctl_req *req, gctl_error(req, "No '%s' argument.", "aalgo"); return; } - if (strcmp(name, "none") != 0) { + if (*name != '\0') { md.md_aalgo = g_eli_str2aalgo(name); if (md.md_aalgo >= CRYPTO_ALGORITHM_MIN && md.md_aalgo <= CRYPTO_ALGORITHM_MAX) { Modified: head/sys/geom/mirror/g_mirror_ctl.c ============================================================================== --- head/sys/geom/mirror/g_mirror_ctl.c Mon Sep 13 08:49:51 2010 (r212546) +++ head/sys/geom/mirror/g_mirror_ctl.c Mon Sep 13 08:56:07 2010 (r212547) @@ -192,7 +192,7 @@ g_mirror_ctl_configure(struct gctl_req * gctl_error(req, "No such device: %s.", name); return; } - if (strcmp(balancep, "none") == 0) + if (*balancep == '\0') balance = sc->sc_balance; else { if (balance_id(balancep) == -1) { @@ -215,7 +215,7 @@ g_mirror_ctl_configure(struct gctl_req * /* Enforce usage() of -p not allowing any other options. */ if (do_priority && (*autosync || *noautosync || *failsync || *nofailsync || *hardcode || *dynamic || *slicep != -1 || - strcmp(balancep, "none") != 0)) { + *balancep != '\0')) { sx_xunlock(&sc->sc_lock); gctl_error(req, "only -p accepted when setting priority"); return; From owner-svn-src-head@FreeBSD.ORG Mon Sep 13 09:23:38 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B78BD106564A; Mon, 13 Sep 2010 09:23:38 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A71498FC12; Mon, 13 Sep 2010 09:23:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8D9NcIL083035; Mon, 13 Sep 2010 09:23:38 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8D9Ncxw083033; Mon, 13 Sep 2010 09:23:38 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201009130923.o8D9Ncxw083033@svn.freebsd.org> From: David Xu Date: Mon, 13 Sep 2010 09:23:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212548 - head/lib/libthr X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2010 09:23:38 -0000 Author: davidxu Date: Mon Sep 13 09:23:38 2010 New Revision: 212548 URL: http://svn.freebsd.org/changeset/base/212548 Log: Update symbol. Modified: head/lib/libthr/pthread.map Modified: head/lib/libthr/pthread.map ============================================================================== --- head/lib/libthr/pthread.map Mon Sep 13 08:56:07 2010 (r212547) +++ head/lib/libthr/pthread.map Mon Sep 13 09:23:38 2010 (r212548) @@ -173,6 +173,7 @@ FBSDprivate_1.0 { ___creat; ___pause; ___pselect; + ___sigwait; ___sleep; ___system; ___tcdrain; @@ -206,7 +207,6 @@ FBSDprivate_1.0 { __sendto; __sigsuspend; __sigtimedwait; - __sigwait; __sigwaitinfo; __wait3; __wait4; From owner-svn-src-head@FreeBSD.ORG Mon Sep 13 09:25:55 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DA045106566C; Mon, 13 Sep 2010 09:25:55 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 7A2648FC15; Mon, 13 Sep 2010 09:25:55 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 0587745C9C; Mon, 13 Sep 2010 11:25:54 +0200 (CEST) Received: from localhost (pdawidek.whl [10.0.1.1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 32FD945683; Mon, 13 Sep 2010 11:25:49 +0200 (CEST) Date: Mon, 13 Sep 2010 11:25:36 +0200 From: Pawel Jakub Dawidek To: Warner Losh Message-ID: <20100913092536.GC2098@garage.freebsd.pl> References: <201009130729.o8D7T2WA073714@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="mvpLiMfbWzRoNl4x" Content-Disposition: inline In-Reply-To: <201009130729.o8D7T2WA073714@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 9.0-CURRENT amd64 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-5.9 required=4.5 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.0.4 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r212543 - in head/sys/modules: opensolaris zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2010 09:25:56 -0000 --mvpLiMfbWzRoNl4x Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Sep 13, 2010 at 07:29:02AM +0000, Warner Losh wrote: > Author: imp > Date: Mon Sep 13 07:29:02 2010 > New Revision: 212543 > URL: http://svn.freebsd.org/changeset/base/212543 >=20 > Log: > Simplify atomic selection Could you also update libzpool Makefile? --=20 Pawel Jakub Dawidek http://www.wheelsystems.com pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --mvpLiMfbWzRoNl4x Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkyN7g8ACgkQForvXbEpPzSTfACgrKCqtioGtnU68PK+wJoR7tsK 1OgAoK32dLI+EJF6qjAdozvao6WoLjjt =qX8T -----END PGP SIGNATURE----- --mvpLiMfbWzRoNl4x-- From owner-svn-src-head@FreeBSD.ORG Mon Sep 13 09:51:24 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A73CD106564A; Mon, 13 Sep 2010 09:51:24 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9696B8FC1F; Mon, 13 Sep 2010 09:51:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8D9pOWI085095; Mon, 13 Sep 2010 09:51:24 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8D9pOsr085093; Mon, 13 Sep 2010 09:51:24 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201009130951.o8D9pOsr085093@svn.freebsd.org> From: Andriy Gapon Date: Mon, 13 Sep 2010 09:51:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212549 - head/sys/dev/acpica X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2010 09:51:24 -0000 Author: avg Date: Mon Sep 13 09:51:24 2010 New Revision: 212549 URL: http://svn.freebsd.org/changeset/base/212549 Log: acpi_cpu: do not apply P_LVLx_LAT rules to latencies returned by _CST ACPI specification sates that if P_LVL2_LAT > 100, then a system doesn't support C2; if P_LVL3_LAT > 1000, then C3 is not supported. But there are no such rules for Cx state data returned by _CST. If a state is not supported it should not be included into the return package. In other words, any latency value returned by _CST is valid, it's up to the OS and/or user to decide whether to use it. Submitted by: nork Suggested by: mav MFC after: 1 week Modified: head/sys/dev/acpica/acpi_cpu.c Modified: head/sys/dev/acpica/acpi_cpu.c ============================================================================== --- head/sys/dev/acpica/acpi_cpu.c Mon Sep 13 09:23:38 2010 (r212548) +++ head/sys/dev/acpica/acpi_cpu.c Mon Sep 13 09:51:24 2010 (r212549) @@ -690,19 +690,11 @@ acpi_cpu_cx_cst(struct acpi_cpu_softc *s sc->cpu_cx_count++; continue; case ACPI_STATE_C2: - if (cx_ptr->trans_lat > 100) { - ACPI_DEBUG_PRINT((ACPI_DB_INFO, - "acpi_cpu%d: C2[%d] not available.\n", - device_get_unit(sc->cpu_dev), i)); - continue; - } sc->cpu_non_c3 = i; break; case ACPI_STATE_C3: default: - if (cx_ptr->trans_lat > 1000 || - (cpu_quirks & CPU_QUIRK_NO_C3) != 0) { - + if ((cpu_quirks & CPU_QUIRK_NO_C3) != 0) { ACPI_DEBUG_PRINT((ACPI_DB_INFO, "acpi_cpu%d: C3[%d] not available.\n", device_get_unit(sc->cpu_dev), i)); From owner-svn-src-head@FreeBSD.ORG Mon Sep 13 11:47:36 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2FB91106566C; Mon, 13 Sep 2010 11:47:36 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1E09C8FC17; Mon, 13 Sep 2010 11:47:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8DBlaxD095591; Mon, 13 Sep 2010 11:47:36 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8DBla8x095589; Mon, 13 Sep 2010 11:47:36 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201009131147.o8DBla8x095589@svn.freebsd.org> From: "Jayachandran C." Date: Mon, 13 Sep 2010 11:47:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212550 - head/sys/mips/rmi X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2010 11:47:36 -0000 Author: jchandra Date: Mon Sep 13 11:47:35 2010 New Revision: 212550 URL: http://svn.freebsd.org/changeset/base/212550 Log: bus_add_child method is needed now. Modified: head/sys/mips/rmi/iodi.c Modified: head/sys/mips/rmi/iodi.c ============================================================================== --- head/sys/mips/rmi/iodi.c Mon Sep 13 09:51:24 2010 (r212549) +++ head/sys/mips/rmi/iodi.c Mon Sep 13 11:47:35 2010 (r212550) @@ -305,6 +305,7 @@ static device_method_t iodi_methods[] = DEVMETHOD(device_identify, iodi_identify), DEVMETHOD(bus_alloc_resource, iodi_alloc_resource), DEVMETHOD(bus_activate_resource, iodi_activate_resource), + DEVMETHOD(bus_add_child, bus_generic_add_child), DEVMETHOD(bus_setup_intr, iodi_setup_intr), {0, 0}, }; From owner-svn-src-head@FreeBSD.ORG Mon Sep 13 11:57:46 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D9D2106564A; Mon, 13 Sep 2010 11:57:46 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4BFBB8FC24; Mon, 13 Sep 2010 11:57:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8DBvkjt096308; Mon, 13 Sep 2010 11:57:46 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8DBvk84096306; Mon, 13 Sep 2010 11:57:46 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201009131157.o8DBvk84096306@svn.freebsd.org> From: David Xu Date: Mon, 13 Sep 2010 11:57:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212551 - head/lib/libthr/thread X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2010 11:57:46 -0000 Author: davidxu Date: Mon Sep 13 11:57:46 2010 New Revision: 212551 URL: http://svn.freebsd.org/changeset/base/212551 Log: Fix copy&paste problem. Modified: head/lib/libthr/thread/thr_private.h Modified: head/lib/libthr/thread/thr_private.h ============================================================================== --- head/lib/libthr/thread/thr_private.h Mon Sep 13 11:47:35 2010 (r212550) +++ head/lib/libthr/thread/thr_private.h Mon Sep 13 11:57:46 2010 (r212551) @@ -415,8 +415,8 @@ struct pthread { #define THR_FLAGS_PRIVATE 0x0001 #define THR_FLAGS_NEED_SUSPEND 0x0002 /* thread should be suspended */ #define THR_FLAGS_SUSPENDED 0x0004 /* thread is suspended */ -#define THR_FLAGS_IN_GCLIST 0x0004 /* thread in gc list */ -#define THR_FLAGS_DETACHED 0x0008 /* thread is detached */ +#define THR_FLAGS_IN_GCLIST 0x0008 /* thread in gc list */ +#define THR_FLAGS_DETACHED 0x0010 /* thread is detached */ /* Thread list flags; only set with thread list lock held. */ int tlflags; From owner-svn-src-head@FreeBSD.ORG Mon Sep 13 11:58:42 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C34D5106564A; Mon, 13 Sep 2010 11:58:42 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B18F28FC0A; Mon, 13 Sep 2010 11:58:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8DBwgwh096399; Mon, 13 Sep 2010 11:58:42 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8DBwgSO096397; Mon, 13 Sep 2010 11:58:42 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201009131158.o8DBwgSO096397@svn.freebsd.org> From: David Xu Date: Mon, 13 Sep 2010 11:58:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212552 - head/lib/libthr/thread X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2010 11:58:42 -0000 Author: davidxu Date: Mon Sep 13 11:58:42 2010 New Revision: 212552 URL: http://svn.freebsd.org/changeset/base/212552 Log: Don't compare thread pointers again. Modified: head/lib/libthr/thread/thr_affinity.c Modified: head/lib/libthr/thread/thr_affinity.c ============================================================================== --- head/lib/libthr/thread/thr_affinity.c Mon Sep 13 11:57:46 2010 (r212551) +++ head/lib/libthr/thread/thr_affinity.c Mon Sep 13 11:58:42 2010 (r212552) @@ -70,13 +70,13 @@ _pthread_getaffinity_np(pthread_t td, si if (td == curthread) { error = cpuset_getaffinity(CPU_LEVEL_WHICH, CPU_WHICH_TID, - (td == curthread) ? -1 : tid, cpusetsize, cpusetp); + -1, cpusetsize, cpusetp); if (error == -1) error = errno; } else if ((error = _thr_find_thread(curthread, td, 0)) == 0) { tid = TID(td); - error = cpuset_getaffinity(CPU_LEVEL_WHICH, CPU_WHICH_TID, - (td == curthread) ? -1 : tid, cpusetsize, cpusetp); + error = cpuset_getaffinity(CPU_LEVEL_WHICH, CPU_WHICH_TID, tid, + cpusetsize, cpusetp); if (error == -1) error = errno; THR_THREAD_UNLOCK(curthread, td); From owner-svn-src-head@FreeBSD.ORG Mon Sep 13 12:08:47 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DF29F1065670; Mon, 13 Sep 2010 12:08:47 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 91D0C8FC08; Mon, 13 Sep 2010 12:08:46 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id PAA18190; Mon, 13 Sep 2010 15:08:45 +0300 (EEST) (envelope-from avg@freebsd.org) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1Ov7q0-000J3p-Rl; Mon, 13 Sep 2010 15:08:44 +0300 Message-ID: <4C8E144C.3030405@freebsd.org> Date: Mon, 13 Sep 2010 15:08:44 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.9) Gecko/20100912 Lightning/1.0b2 Thunderbird/3.1.3 MIME-Version: 1.0 To: "Jayachandran C." References: <201009131147.o8DBla8x095589@svn.freebsd.org> In-Reply-To: <201009131147.o8DBla8x095589@svn.freebsd.org> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r212550 - head/sys/mips/rmi X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2010 12:08:48 -0000 on 13/09/2010 14:47 Jayachandran C. said the following: > Author: jchandra > Date: Mon Sep 13 11:47:35 2010 > New Revision: 212550 > URL: http://svn.freebsd.org/changeset/base/212550 > > Log: > bus_add_child method is needed now. Just a note: bus_add_child method needs to be defined only if it's actually used, i.e. a device/bus has at least one child that calls BUS_ADD_CHILD. > Modified: > head/sys/mips/rmi/iodi.c > > Modified: head/sys/mips/rmi/iodi.c > ============================================================================== > --- head/sys/mips/rmi/iodi.c Mon Sep 13 09:51:24 2010 (r212549) > +++ head/sys/mips/rmi/iodi.c Mon Sep 13 11:47:35 2010 (r212550) > @@ -305,6 +305,7 @@ static device_method_t iodi_methods[] = > DEVMETHOD(device_identify, iodi_identify), > DEVMETHOD(bus_alloc_resource, iodi_alloc_resource), > DEVMETHOD(bus_activate_resource, iodi_activate_resource), > + DEVMETHOD(bus_add_child, bus_generic_add_child), > DEVMETHOD(bus_setup_intr, iodi_setup_intr), > {0, 0}, > }; -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Mon Sep 13 12:32:23 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id 2F15E1065670; Mon, 13 Sep 2010 12:32:23 +0000 (UTC) Date: Mon, 13 Sep 2010 12:32:23 +0000 From: Alexander Best To: Alexander Motin Message-ID: <20100913123223.GA99507@freebsd.org> References: <201009130725.o8D7PZX8073399@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201009130725.o8D7PZX8073399@svn.freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r212541 - in head/sys: amd64/amd64 amd64/include dev/acpica i386/i386 i386/include kern mips/include mips/mips pc98/pc98 powerpc/aim powerpc/booke powerpc/include powerpc/powerpc sparc6... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2010 12:32:23 -0000 On Mon Sep 13 10, Alexander Motin wrote: > [snip] > > There is set of tunables, also available as writable sysctls, allowing to > control wanted event timer subsystem behavior: > kern.eventtimer.timer - allows to choose event timer hardware to use. > On x86 there is up to 4 different kinds of timers. Depending on whether > chosen timer is per-CPU, behavior of other options slightly differs. > kern.eventtimer.periodic - allows to choose periodic and one-shot > operation mode. In periodic mode, current timer hardware taken as the only > source of time for time events. This mode is quite alike to previous kernel > behavior. One-shot mode instead uses currently selected time counter > hardware to schedule all needed events one by one and program timer to > generate interrupt exactly in specified time. Default value depends of > chosen timer capabilities, but one-shot mode is preferred, until other is > forced by user or hardware. > kern.eventtimer.singlemul - in periodic mode specifies how much times > higher timer frequency should be, to not strictly alias hardclock() and > statclock() events. Default values are 2 and 4, but could be reduced to 1 > if extra interrupts are unwanted. > kern.eventtimer.idletick - makes each CPU to receive every timer interrupt > independently of whether they busy or not. By default this options is > disabled. If chosen timer is per-CPU and runs in periodic mode, this option > has no effect - all interrupts are generating. > > [snip] great! :) would it be possible to document these tunables in a new manual or add them to an existing one? sorry if i missed this and they are already documented somewhere. -- a13x From owner-svn-src-head@FreeBSD.ORG Mon Sep 13 12:37:27 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id 3D6D1106566C; Mon, 13 Sep 2010 12:37:27 +0000 (UTC) Date: Mon, 13 Sep 2010 12:37:27 +0000 From: Alexander Best To: Glen Barber Message-ID: <20100913123727.GB99507@freebsd.org> References: <201009121750.o8CHo7ts089681@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201009121750.o8CHo7ts089681@svn.freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r212498 - head/sbin/newfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2010 12:37:27 -0000 On Sun Sep 12 10, Glen Barber wrote: > [snip] > > Modified: > head/sbin/newfs/newfs.8 > > [snip] could you also have a look at PR #61716? thanks. -- a13x From owner-svn-src-head@FreeBSD.ORG Mon Sep 13 12:59:27 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 284931065679 for ; Mon, 13 Sep 2010 12:59:27 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from glenbarber.us (aries.glenbarber.us [204.109.63.207]) by mx1.freebsd.org (Postfix) with SMTP id 85F828FC18 for ; Mon, 13 Sep 2010 12:59:26 +0000 (UTC) Received: (qmail 69336 invoked by uid 0); 13 Sep 2010 08:59:25 -0400 Received: from unknown (HELO schism.local) (gjb@173.161.130.225) by 0 with SMTP; 13 Sep 2010 08:59:25 -0400 Message-ID: <4C8E202D.1080407@FreeBSD.org> Date: Mon, 13 Sep 2010 08:59:25 -0400 From: Glen Barber User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.9) Gecko/20100825 Thunderbird/3.1.3 MIME-Version: 1.0 To: Alexander Best References: <201009121750.o8CHo7ts089681@svn.freebsd.org> <20100913123727.GB99507@freebsd.org> In-Reply-To: <20100913123727.GB99507@freebsd.org> X-Enigmail-Version: 1.1.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r212498 - head/sbin/newfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2010 12:59:27 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 9/13/10 8:37 AM, Alexander Best wrote: > On Sun Sep 12 10, Glen Barber wrote: >> [snip] >> >> Modified: >> head/sbin/newfs/newfs.8 >> >> [snip] > > could you also have a look at PR #61716? > thanks. > Sure will. Cheers, - -- Glen Barber FreeBSD Documentation Project -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (Darwin) iQEcBAEBAgAGBQJMjiAsAAoJEFJPDDeguUajOlwIAJh21AvsgRqtknz12ZrQwP7k mPAp+ymxUtL/38xv45x0m6KgpIePCtdUPoVki1VY6CO7Av/QxLbP6cDHGecvc2Dz qhAkKWVdkxmNKKaCBoMupr+LwVaUbhJL8O7ohbuUiBaTF72niYBDevx2NLiwMOtH GFG2cd5gOXYaxfuo6YZpLmwHARMYfH7yUfEnQZAAwH+Zay5LMDFhtnlfGXOvDGZh dBEQ+4xXZTp2mUhL3BD3jTOgbZ2KAT+wxSQtPRktrs/uFeTB/j2GREINX9l1aGlu 2gPUACCTnwsk6dxP/2LNYLVNrck5v17Tndpj3A9J7usHuaMN7kxOh+5XB0jeHzs= =e7wm -----END PGP SIGNATURE----- From owner-svn-src-head@FreeBSD.ORG Mon Sep 13 13:11:50 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D72B31065697; Mon, 13 Sep 2010 13:11:50 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C423D8FC1E; Mon, 13 Sep 2010 13:11:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8DDBoRc002103; Mon, 13 Sep 2010 13:11:50 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8DDBo3u002099; Mon, 13 Sep 2010 13:11:50 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201009131311.o8DDBo3u002099@svn.freebsd.org> From: "Jayachandran C." Date: Mon, 13 Sep 2010 13:11:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212553 - in head/sys/mips/rmi: . dev/nlge dev/xlr X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2010 13:11:50 -0000 Author: jchandra Date: Mon Sep 13 13:11:50 2010 New Revision: 212553 URL: http://svn.freebsd.org/changeset/base/212553 Log: sys/mips/rmi/msgring.h - fixes and clean up. - Remove sync from msgrng_send, sync needs to be called just once before sending. - Fix retry logic - don't reload registers when retrying in message_send, also fix check for send pending fail. - remove unused message_send_block_fast() - merge message_receive_fast() to message_receive - style(9) fixes, and comments - rge and nlge updated for the sys/mips/rmi/msgring.h changes Modified: head/sys/mips/rmi/dev/nlge/if_nlge.c head/sys/mips/rmi/dev/xlr/rge.c head/sys/mips/rmi/msgring.h Modified: head/sys/mips/rmi/dev/nlge/if_nlge.c ============================================================================== --- head/sys/mips/rmi/dev/nlge/if_nlge.c Mon Sep 13 11:58:42 2010 (r212552) +++ head/sys/mips/rmi/dev/nlge/if_nlge.c Mon Sep 13 13:11:50 2010 (r212553) @@ -1035,7 +1035,7 @@ nlna_submit_rx_free_desc(struct nlna_sof n = 0; do { msgrng_flags = msgrng_access_enable(); - ret = message_send_retry(1, code, stid, &msg); + ret = message_send(1, code, stid, &msg); msgrng_restore(msgrng_flags); KASSERT(n++ < 100000, ("Too many credit fails\n")); } while (ret != 0); @@ -1960,7 +1960,7 @@ send_fmn_msg_tx(struct nlge_softc *sc, s do { msgrng_flags = msgrng_access_enable(); - ret = message_send_retry(n_entries, MSGRNG_CODE_MAC, + ret = message_send(n_entries, MSGRNG_CODE_MAC, sc->tx_bucket_id, msg); msgrng_restore(msgrng_flags); KASSERT(i++ < 100000, ("Too many credit fails\n")); Modified: head/sys/mips/rmi/dev/xlr/rge.c ============================================================================== --- head/sys/mips/rmi/dev/xlr/rge.c Mon Sep 13 11:58:42 2010 (r212552) +++ head/sys/mips/rmi/dev/xlr/rge.c Mon Sep 13 13:11:50 2010 (r212553) @@ -731,7 +731,7 @@ xlr_mac_send_fr(struct driver_data *priv do { msgrng_flags = msgrng_access_enable(); - ret = message_send_retry(1, code, stid, &msg); + ret = message_send(1, code, stid, &msg); msgrng_restore(msgrng_flags); KASSERT(i++ < 100000, ("Too many credit fails\n")); } while (ret != 0); @@ -1468,7 +1468,7 @@ mac_xmit(struct mbuf *m, struct rge_soft else { mflags = msgrng_access_enable(); - if ((rv = message_send_retry(1, MSGRNG_CODE_MAC, stid, &msg)) != 0) { + if ((rv = message_send(1, MSGRNG_CODE_MAC, stid, &msg)) != 0) { msg_snd_failed++; msgrng_restore(mflags); release_tx_desc(&msg, 0); Modified: head/sys/mips/rmi/msgring.h ============================================================================== --- head/sys/mips/rmi/msgring.h Mon Sep 13 11:58:42 2010 (r212552) +++ head/sys/mips/rmi/msgring.h Mon Sep 13 13:11:50 2010 (r212553) @@ -46,16 +46,16 @@ #define MSGRNG_MSG_CONFIG_REG 3 #define MSGRNG_MSG_BUCKSIZE_REG 4 -#define MSGRNG_CC_0_REG 16 -#define MSGRNG_CC_1_REG 17 -#define MSGRNG_CC_2_REG 18 -#define MSGRNG_CC_3_REG 19 -#define MSGRNG_CC_4_REG 20 -#define MSGRNG_CC_5_REG 21 -#define MSGRNG_CC_6_REG 22 -#define MSGRNG_CC_7_REG 23 -#define MSGRNG_CC_8_REG 24 -#define MSGRNG_CC_9_REG 25 +#define MSGRNG_CC_0_REG 16 +#define MSGRNG_CC_1_REG 17 +#define MSGRNG_CC_2_REG 18 +#define MSGRNG_CC_3_REG 19 +#define MSGRNG_CC_4_REG 20 +#define MSGRNG_CC_5_REG 21 +#define MSGRNG_CC_6_REG 22 +#define MSGRNG_CC_7_REG 23 +#define MSGRNG_CC_8_REG 24 +#define MSGRNG_CC_9_REG 25 #define MSGRNG_CC_10_REG 26 #define MSGRNG_CC_11_REG 27 #define MSGRNG_CC_12_REG 28 @@ -64,173 +64,170 @@ #define MSGRNG_CC_15_REG 31 /* Station IDs */ -#define MSGRNG_STNID_CPU0 0x00 -#define MSGRNG_STNID_CPU1 0x08 -#define MSGRNG_STNID_CPU2 0x10 -#define MSGRNG_STNID_CPU3 0x18 -#define MSGRNG_STNID_CPU4 0x20 -#define MSGRNG_STNID_CPU5 0x28 -#define MSGRNG_STNID_CPU6 0x30 -#define MSGRNG_STNID_CPU7 0x38 -#define MSGRNG_STNID_XGS0_TX 64 -#define MSGRNG_STNID_XMAC0_00_TX 64 -#define MSGRNG_STNID_XMAC0_01_TX 65 -#define MSGRNG_STNID_XMAC0_02_TX 66 -#define MSGRNG_STNID_XMAC0_03_TX 67 -#define MSGRNG_STNID_XMAC0_04_TX 68 -#define MSGRNG_STNID_XMAC0_05_TX 69 -#define MSGRNG_STNID_XMAC0_06_TX 70 -#define MSGRNG_STNID_XMAC0_07_TX 71 -#define MSGRNG_STNID_XMAC0_08_TX 72 -#define MSGRNG_STNID_XMAC0_09_TX 73 -#define MSGRNG_STNID_XMAC0_10_TX 74 -#define MSGRNG_STNID_XMAC0_11_TX 75 -#define MSGRNG_STNID_XMAC0_12_TX 76 -#define MSGRNG_STNID_XMAC0_13_TX 77 -#define MSGRNG_STNID_XMAC0_14_TX 78 -#define MSGRNG_STNID_XMAC0_15_TX 79 - -#define MSGRNG_STNID_XGS1_TX 80 -#define MSGRNG_STNID_XMAC1_00_TX 80 -#define MSGRNG_STNID_XMAC1_01_TX 81 -#define MSGRNG_STNID_XMAC1_02_TX 82 -#define MSGRNG_STNID_XMAC1_03_TX 83 -#define MSGRNG_STNID_XMAC1_04_TX 84 -#define MSGRNG_STNID_XMAC1_05_TX 85 -#define MSGRNG_STNID_XMAC1_06_TX 86 -#define MSGRNG_STNID_XMAC1_07_TX 87 -#define MSGRNG_STNID_XMAC1_08_TX 88 -#define MSGRNG_STNID_XMAC1_09_TX 89 -#define MSGRNG_STNID_XMAC1_10_TX 90 -#define MSGRNG_STNID_XMAC1_11_TX 91 -#define MSGRNG_STNID_XMAC1_12_TX 92 -#define MSGRNG_STNID_XMAC1_13_TX 93 -#define MSGRNG_STNID_XMAC1_14_TX 94 -#define MSGRNG_STNID_XMAC1_15_TX 95 - -#define MSGRNG_STNID_GMAC 96 -#define MSGRNG_STNID_GMACJFR_0 96 -#define MSGRNG_STNID_GMACRFR_0 97 -#define MSGRNG_STNID_GMACTX0 98 -#define MSGRNG_STNID_GMACTX1 99 -#define MSGRNG_STNID_GMACTX2 100 -#define MSGRNG_STNID_GMACTX3 101 -#define MSGRNG_STNID_GMACJFR_1 102 -#define MSGRNG_STNID_GMACRFR_1 103 - -#define MSGRNG_STNID_DMA 104 -#define MSGRNG_STNID_DMA_0 104 -#define MSGRNG_STNID_DMA_1 105 -#define MSGRNG_STNID_DMA_2 106 -#define MSGRNG_STNID_DMA_3 107 - -#define MSGRNG_STNID_XGS0FR 112 -#define MSGRNG_STNID_XMAC0JFR 112 -#define MSGRNG_STNID_XMAC0RFR 113 - -#define MSGRNG_STNID_XGS1FR 114 -#define MSGRNG_STNID_XMAC1JFR 114 -#define MSGRNG_STNID_XMAC1RFR 115 -#define MSGRNG_STNID_SEC 120 -#define MSGRNG_STNID_SEC0 120 -#define MSGRNG_STNID_SEC1 121 -#define MSGRNG_STNID_SEC2 122 -#define MSGRNG_STNID_SEC3 123 -#define MSGRNG_STNID_PK0 124 -#define MSGRNG_STNID_SEC_RSA 124 -#define MSGRNG_STNID_SEC_RSVD0 125 -#define MSGRNG_STNID_SEC_RSVD1 126 -#define MSGRNG_STNID_SEC_RSVD2 127 - -#define MSGRNG_STNID_GMAC1 80 -#define MSGRNG_STNID_GMAC1_FR_0 81 -#define MSGRNG_STNID_GMAC1_TX0 82 -#define MSGRNG_STNID_GMAC1_TX1 83 -#define MSGRNG_STNID_GMAC1_TX2 84 -#define MSGRNG_STNID_GMAC1_TX3 85 -#define MSGRNG_STNID_GMAC1_FR_1 87 -#define MSGRNG_STNID_GMAC0 96 -#define MSGRNG_STNID_GMAC0_FR_0 97 -#define MSGRNG_STNID_GMAC0_TX0 98 -#define MSGRNG_STNID_GMAC0_TX1 99 -#define MSGRNG_STNID_GMAC0_TX2 100 -#define MSGRNG_STNID_GMAC0_TX3 101 -#define MSGRNG_STNID_GMAC0_FR_1 103 -#define MSGRNG_STNID_CMP_0 108 -#define MSGRNG_STNID_CMP_1 109 -#define MSGRNG_STNID_CMP_2 110 -#define MSGRNG_STNID_CMP_3 111 -#define MSGRNG_STNID_PCIE_0 116 -#define MSGRNG_STNID_PCIE_1 117 -#define MSGRNG_STNID_PCIE_2 118 -#define MSGRNG_STNID_PCIE_3 119 -#define MSGRNG_STNID_XLS_PK0 121 - -#define MSGRNG_CODE_MAC 0 -#define MSGRNG_CODE_XGMAC 2 -#define MSGRNG_CODE_SEC 0 -#define MSGRNG_CODE_BOOT_WAKEUP 200 -#define MSGRNG_CODE_SPI4 3 -#define msgrng_read_status() read_c2_register32(MSGRNG_MSG_STATUS_REG, 0) - -#define msgrng_read_config() read_c2_register32(MSGRNG_MSG_CONFIG_REG, 0) -#define msgrng_write_config(value) write_c2_register32(MSGRNG_MSG_CONFIG_REG, 0, value) - -#define msgrng_read_bucksize(bucket) read_c2_register32(MSGRNG_MSG_BUCKSIZE_REG, bucket) -#define msgrng_write_bucksize(bucket, value) write_c2_register32(MSGRNG_MSG_BUCKSIZE_REG, bucket, value) - -#define msgrng_read_cc(reg, pri) read_c2_register32(reg, pri) -#define msgrng_write_cc(reg, value, pri) write_c2_register32(reg, pri, value) - -#define msgrng_load_rx_msg0() read_c2_register64(MSGRNG_RX_BUF_REG, 0) -#define msgrng_load_rx_msg1() read_c2_register64(MSGRNG_RX_BUF_REG, 1) -#define msgrng_load_rx_msg2() read_c2_register64(MSGRNG_RX_BUF_REG, 2) -#define msgrng_load_rx_msg3() read_c2_register64(MSGRNG_RX_BUF_REG, 3) - -#define msgrng_load_tx_msg0(value) write_c2_register64(MSGRNG_TX_BUF_REG, 0, value) -#define msgrng_load_tx_msg1(value) write_c2_register64(MSGRNG_TX_BUF_REG, 1, value) -#define msgrng_load_tx_msg2(value) write_c2_register64(MSGRNG_TX_BUF_REG, 2, value) -#define msgrng_load_tx_msg3(value) write_c2_register64(MSGRNG_TX_BUF_REG, 3, value) +#define MSGRNG_STNID_CPU0 0x00 +#define MSGRNG_STNID_CPU1 0x08 +#define MSGRNG_STNID_CPU2 0x10 +#define MSGRNG_STNID_CPU3 0x18 +#define MSGRNG_STNID_CPU4 0x20 +#define MSGRNG_STNID_CPU5 0x28 +#define MSGRNG_STNID_CPU6 0x30 +#define MSGRNG_STNID_CPU7 0x38 +#define MSGRNG_STNID_XGS0_TX 64 +#define MSGRNG_STNID_XMAC0_00_TX 64 +#define MSGRNG_STNID_XMAC0_01_TX 65 +#define MSGRNG_STNID_XMAC0_02_TX 66 +#define MSGRNG_STNID_XMAC0_03_TX 67 +#define MSGRNG_STNID_XMAC0_04_TX 68 +#define MSGRNG_STNID_XMAC0_05_TX 69 +#define MSGRNG_STNID_XMAC0_06_TX 70 +#define MSGRNG_STNID_XMAC0_07_TX 71 +#define MSGRNG_STNID_XMAC0_08_TX 72 +#define MSGRNG_STNID_XMAC0_09_TX 73 +#define MSGRNG_STNID_XMAC0_10_TX 74 +#define MSGRNG_STNID_XMAC0_11_TX 75 +#define MSGRNG_STNID_XMAC0_12_TX 76 +#define MSGRNG_STNID_XMAC0_13_TX 77 +#define MSGRNG_STNID_XMAC0_14_TX 78 +#define MSGRNG_STNID_XMAC0_15_TX 79 + +#define MSGRNG_STNID_XGS1_TX 80 +#define MSGRNG_STNID_XMAC1_00_TX 80 +#define MSGRNG_STNID_XMAC1_01_TX 81 +#define MSGRNG_STNID_XMAC1_02_TX 82 +#define MSGRNG_STNID_XMAC1_03_TX 83 +#define MSGRNG_STNID_XMAC1_04_TX 84 +#define MSGRNG_STNID_XMAC1_05_TX 85 +#define MSGRNG_STNID_XMAC1_06_TX 86 +#define MSGRNG_STNID_XMAC1_07_TX 87 +#define MSGRNG_STNID_XMAC1_08_TX 88 +#define MSGRNG_STNID_XMAC1_09_TX 89 +#define MSGRNG_STNID_XMAC1_10_TX 90 +#define MSGRNG_STNID_XMAC1_11_TX 91 +#define MSGRNG_STNID_XMAC1_12_TX 92 +#define MSGRNG_STNID_XMAC1_13_TX 93 +#define MSGRNG_STNID_XMAC1_14_TX 94 +#define MSGRNG_STNID_XMAC1_15_TX 95 + +#define MSGRNG_STNID_GMAC 96 +#define MSGRNG_STNID_GMACJFR_0 96 +#define MSGRNG_STNID_GMACRFR_0 97 +#define MSGRNG_STNID_GMACTX0 98 +#define MSGRNG_STNID_GMACTX1 99 +#define MSGRNG_STNID_GMACTX2 100 +#define MSGRNG_STNID_GMACTX3 101 +#define MSGRNG_STNID_GMACJFR_1 102 +#define MSGRNG_STNID_GMACRFR_1 103 + +#define MSGRNG_STNID_DMA 104 +#define MSGRNG_STNID_DMA_0 104 +#define MSGRNG_STNID_DMA_1 105 +#define MSGRNG_STNID_DMA_2 106 +#define MSGRNG_STNID_DMA_3 107 + +#define MSGRNG_STNID_XGS0FR 112 +#define MSGRNG_STNID_XMAC0JFR 112 +#define MSGRNG_STNID_XMAC0RFR 113 + +#define MSGRNG_STNID_XGS1FR 114 +#define MSGRNG_STNID_XMAC1JFR 114 +#define MSGRNG_STNID_XMAC1RFR 115 +#define MSGRNG_STNID_SEC 120 +#define MSGRNG_STNID_SEC0 120 +#define MSGRNG_STNID_SEC1 121 +#define MSGRNG_STNID_SEC2 122 +#define MSGRNG_STNID_SEC3 123 +#define MSGRNG_STNID_PK0 124 +#define MSGRNG_STNID_SEC_RSA 124 +#define MSGRNG_STNID_SEC_RSVD0 125 +#define MSGRNG_STNID_SEC_RSVD1 126 +#define MSGRNG_STNID_SEC_RSVD2 127 + +#define MSGRNG_STNID_GMAC1 80 +#define MSGRNG_STNID_GMAC1_FR_0 81 +#define MSGRNG_STNID_GMAC1_TX0 82 +#define MSGRNG_STNID_GMAC1_TX1 83 +#define MSGRNG_STNID_GMAC1_TX2 84 +#define MSGRNG_STNID_GMAC1_TX3 85 +#define MSGRNG_STNID_GMAC1_FR_1 87 +#define MSGRNG_STNID_GMAC0 96 +#define MSGRNG_STNID_GMAC0_FR_0 97 +#define MSGRNG_STNID_GMAC0_TX0 98 +#define MSGRNG_STNID_GMAC0_TX1 99 +#define MSGRNG_STNID_GMAC0_TX2 100 +#define MSGRNG_STNID_GMAC0_TX3 101 +#define MSGRNG_STNID_GMAC0_FR_1 103 +#define MSGRNG_STNID_CMP_0 108 +#define MSGRNG_STNID_CMP_1 109 +#define MSGRNG_STNID_CMP_2 110 +#define MSGRNG_STNID_CMP_3 111 +#define MSGRNG_STNID_PCIE_0 116 +#define MSGRNG_STNID_PCIE_1 117 +#define MSGRNG_STNID_PCIE_2 118 +#define MSGRNG_STNID_PCIE_3 119 +#define MSGRNG_STNID_XLS_PK0 121 + +#define MSGRNG_CODE_MAC 0 +#define MSGRNG_CODE_XGMAC 2 +#define MSGRNG_CODE_SEC 0 +#define MSGRNG_CODE_BOOT_WAKEUP 200 +#define MSGRNG_CODE_SPI4 3 +#define msgrng_read_status() read_c2_register32(MSGRNG_MSG_STATUS_REG, 0) + +#define msgrng_read_config() read_c2_register32(MSGRNG_MSG_CONFIG_REG, 0) +#define msgrng_write_config(v) write_c2_register32(MSGRNG_MSG_CONFIG_REG, 0, v) + +#define msgrng_read_bucksize(b) read_c2_register32(MSGRNG_MSG_BUCKSIZE_REG, b) +#define msgrng_write_bucksize(b, v) write_c2_register32(MSGRNG_MSG_BUCKSIZE_REG, b, v) + +#define msgrng_read_cc(r, s) read_c2_register32(r, s) +#define msgrng_write_cc(r, v, s) write_c2_register32(r, s, v) + +#define msgrng_load_rx_msg0() read_c2_register64(MSGRNG_RX_BUF_REG, 0) +#define msgrng_load_rx_msg1() read_c2_register64(MSGRNG_RX_BUF_REG, 1) +#define msgrng_load_rx_msg2() read_c2_register64(MSGRNG_RX_BUF_REG, 2) +#define msgrng_load_rx_msg3() read_c2_register64(MSGRNG_RX_BUF_REG, 3) + +#define msgrng_load_tx_msg0(v) write_c2_register64(MSGRNG_TX_BUF_REG, 0, v) +#define msgrng_load_tx_msg1(v) write_c2_register64(MSGRNG_TX_BUF_REG, 1, v) +#define msgrng_load_tx_msg2(v) write_c2_register64(MSGRNG_TX_BUF_REG, 2, v) +#define msgrng_load_tx_msg3(v) write_c2_register64(MSGRNG_TX_BUF_REG, 3, v) -static inline void +static __inline void msgrng_send(unsigned int stid) { __asm__ volatile ( - ".set push\n" - ".set noreorder\n" - "sync\n" - // "msgsnd %0\n" - "move $8, %0\n" - "c2 0x80001\n" - ".set pop\n" - :: "r" (stid):"$8" + ".set push\n" + ".set noreorder\n" + "move $8, %0\n" + "c2 0x80001\n" /* msgsnd $8 */ + ".set pop\n" + :: "r" (stid): "$8" ); } -static inline void +static __inline void msgrng_receive(unsigned int pri) { __asm__ volatile ( - ".set push\n" - ".set noreorder\n" - // "msgld %0\n" - "move $8, %0\n" - "c2 0x80002\n" - ".set pop\n" - :: "r" (pri):"$8" + ".set push\n" + ".set noreorder\n" + "move $8, %0\n" + "c2 0x80002\n" /* msgld $8 */ + ".set pop\n" + :: "r" (pri): "$8" ); } -static inline void + +static __inline void msgrng_wait(unsigned int mask) { __asm__ volatile ( - ".set push\n" - ".set noreorder\n" - // "msgwait %0\n" - "move $8, %0\n" - "c2 0x80003\n" - ".set pop\n" - :: "r" (mask):"$8" + ".set push\n" + ".set noreorder\n" + "move $8, %0\n" + "c2 0x80003\n" /* msgwait $8 */ + ".set pop\n" + :: "r" (mask): "$8" ); } @@ -251,111 +248,77 @@ msgrng_restore(uint32_t sr) } struct msgrng_msg { - __uint64_t msg0; - __uint64_t msg1; - __uint64_t msg2; - __uint64_t msg3; + uint64_t msg0; + uint64_t msg1; + uint64_t msg2; + uint64_t msg3; }; -static inline void -message_send_block_fast(int size, unsigned int code, unsigned int stid, - unsigned long long msg0, unsigned long long msg1, - unsigned long long msg2, unsigned long long msg3) -{ - __asm__ __volatile__(".set push\n" - ".set noreorder\n" - ".set mips64\n" - "dmtc2 %1, $0, 0\n" - "dmtc2 %2, $0, 1\n" - "dmtc2 %3, $0, 2\n" - "dmtc2 %4, $0, 3\n" - "move $8, %0\n" - "1: c2 0x80001\n" - "mfc2 $8, $2\n" - "andi $8, $8, 0x6\n" - "bnez $8, 1b\n" - "move $8, %0\n" - ".set pop\n" - : - : "r"(((size - 1) << 16) | (code << 8) | stid), "r"(msg0), "r"(msg1), "r"(msg2), "r"(msg3) - : "$8" - ); -} - -#define message_receive_fast(bucket, size, code, stid, msg0, msg1, msg2, msg3) \ - ( { unsigned int _status=0, _tmp=0; \ - msgrng_receive(bucket); \ - while ( (_status=msgrng_read_status()) & 0x08) ; \ - _tmp = _status & 0x30; \ - if (__builtin_expect((!_tmp), 1)) { \ - (size)=((_status & 0xc0)>>6)+1; \ - (code)=(_status & 0xff00)>>8; \ - (stid)=(_status & 0x7f0000)>>16; \ - (msg0)=msgrng_load_rx_msg0(); \ - (msg1)=msgrng_load_rx_msg1(); \ - (msg2)=msgrng_load_rx_msg2(); \ - (msg3)=msgrng_load_rx_msg3(); \ - _tmp=0; \ - } \ - _tmp; \ - } ) - -static __inline int +static __inline int message_send(unsigned int size, unsigned int code, unsigned int stid, struct msgrng_msg *msg) { unsigned int dest = 0; unsigned long long status = 0; -#ifdef INVARIANTS int i = 0; -#endif + /* + * Make sure that all the writes pending at the cpu are flushed. + * Any writes pending on CPU will not be see by devices. L1/L2 + * caches are coherent with IO, so no cache flush needed. + */ + __asm __volatile ("sync"); + + /* Load TX message buffers */ msgrng_load_tx_msg0(msg->msg0); msgrng_load_tx_msg1(msg->msg1); msgrng_load_tx_msg2(msg->msg2); msgrng_load_tx_msg3(msg->msg3); - - dest = ((size - 1) << 16) | (code << 8) | (stid); - msgrng_send(dest); - - /* Wait for the thread pending to clear */ - do { - status = msgrng_read_status(); - KASSERT(i++ < 10000, ("Too many fails\n")); - } while ((status & 0x2) != 0); - - /* If there is a credit failure, return error */ - return status & 0x06; -} - -static __inline int -message_send_retry(unsigned int size, unsigned int code, - unsigned int stid, struct msgrng_msg *msg) -{ - int i, ret; + dest = ((size - 1) << 16) | (code << 8) | stid; /* - * we are in with interrupt disabled, retrying too many - * times is not good + * Retry a few times on credit fail, this should be a + * transient condition, unless there is a configuration + * failure, or the receiver is stuck. */ - for (i = 0; i < 16; i++) { - ret = message_send(size, code, stid, msg); - if (ret == 0) + for (i = 0; i < 8; i++) { + msgrng_send(dest); + status = msgrng_read_status(); + KASSERT((status & 0x2) == 0, ("Send pending fail!")); + if ((status & 0x4) == 0) return (0); } - return (1); + /* If there is a credit failure, return error */ + return (status & 0x06); } -static __inline__ int -message_receive(int pri, int *size, int *code, int *src_id, +static __inline int +message_receive(int bucket, int *size, int *code, int *stid, struct msgrng_msg *msg) { - int res; + uint32_t status = 0, tmp = 0; - res = message_receive_fast(pri, *size, *code, *src_id, - msg->msg0, msg->msg1, msg->msg2, msg->msg3); - return res; + msgrng_receive(bucket); + + /* wait for load pending to clear */ + do { + status = msgrng_read_status(); + } while ((status & 0x08) != 0); + + /* receive error bits */ + tmp = status & 0x30; + if (tmp != 0) + return (tmp); + + *size = ((status & 0xc0) >> 6) + 1; + *code = (status & 0xff00) >> 8; + *stid = (status & 0x7f0000) >> 16; + msg->msg0 = msgrng_load_rx_msg0(); + msg->msg1 = msgrng_load_rx_msg1(); + msg->msg2 = msgrng_load_rx_msg2(); + msg->msg3 = msgrng_load_rx_msg3(); + return (0); } #define MSGRNG_STN_RX_QSIZE 256 From owner-svn-src-head@FreeBSD.ORG Mon Sep 13 13:48:19 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6D833106564A; Mon, 13 Sep 2010 13:48:19 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 572608FC0C; Mon, 13 Sep 2010 13:48:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8DDmJTf004176; Mon, 13 Sep 2010 13:48:19 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8DDmJL8004159; Mon, 13 Sep 2010 13:48:19 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201009131348.o8DDmJL8004159@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Mon, 13 Sep 2010 13:48:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212554 - in head: sbin/geom/class/cache sbin/geom/class/concat sbin/geom/class/eli sbin/geom/class/journal sbin/geom/class/label sbin/geom/class/mirror sbin/geom/class/mountver sbin/ge... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2010 13:48:19 -0000 Author: pjd Date: Mon Sep 13 13:48:18 2010 New Revision: 212554 URL: http://svn.freebsd.org/changeset/base/212554 Log: - Remove gc_argname field. It was introduced for gpart(8), but if I understand everything correctly, we don't really need it. - Provide default numeric value as strings. This allows to simplify a lot of code. - Bump version number. Modified: head/sbin/geom/class/cache/geom_cache.c head/sbin/geom/class/concat/geom_concat.c head/sbin/geom/class/eli/geom_eli.c head/sbin/geom/class/journal/geom_journal.c head/sbin/geom/class/label/geom_label.c head/sbin/geom/class/mirror/geom_mirror.c head/sbin/geom/class/mountver/geom_mountver.c head/sbin/geom/class/multipath/geom_multipath.c head/sbin/geom/class/nop/geom_nop.c head/sbin/geom/class/part/geom_part.c head/sbin/geom/class/raid3/geom_raid3.c head/sbin/geom/class/sched/geom_sched.c head/sbin/geom/class/shsec/geom_shsec.c head/sbin/geom/class/stripe/geom_stripe.c head/sbin/geom/class/virstor/geom_virstor.c head/sbin/geom/core/geom.c head/sbin/geom/core/geom.h head/sys/geom/part/g_part.c Modified: head/sbin/geom/class/cache/geom_cache.c ============================================================================== --- head/sbin/geom/class/cache/geom_cache.c Mon Sep 13 13:11:50 2010 (r212553) +++ head/sbin/geom/class/cache/geom_cache.c Mon Sep 13 13:48:18 2010 (r212554) @@ -42,10 +42,8 @@ __FBSDID("$FreeBSD$"); uint32_t lib_version = G_LIB_VERSION; uint32_t version = G_CACHE_VERSION; -static intmax_t blocksize_label = 65536; -static intmax_t size_label = 100; -static intmax_t blocksize_configure = 0; -static intmax_t size_configure = 0; +#define GCACHE_BLOCKSIZE "65536" +#define GCACHE_SIZE "100" static void cache_main(struct gctl_req *req, unsigned flags); static void cache_clear(struct gctl_req *req); @@ -53,44 +51,44 @@ static void cache_dump(struct gctl_req * static void cache_label(struct gctl_req *req); struct g_command class_commands[] = { - { "clear", G_FLAG_VERBOSE, cache_main, G_NULL_OPTS, NULL, + { "clear", G_FLAG_VERBOSE, cache_main, G_NULL_OPTS, "[-v] prov ..." }, { "configure", G_FLAG_VERBOSE, NULL, { - { 'b', "blocksize", &blocksize_configure, G_TYPE_NUMBER }, - { 's', "size", &size_configure, G_TYPE_NUMBER }, + { 'b', "blocksize", "0", G_TYPE_NUMBER }, + { 's', "size", "0", G_TYPE_NUMBER }, G_OPT_SENTINEL }, - NULL, "[-v] [-b blocksize] [-s size] name" + "[-v] [-b blocksize] [-s size] name" }, { "create", G_FLAG_VERBOSE | G_FLAG_LOADKLD, NULL, { - { 'b', "blocksize", &blocksize_label, G_TYPE_NUMBER }, - { 's', "size", &size_label, G_TYPE_NUMBER }, + { 'b', "blocksize", GCACHE_BLOCKSIZE, G_TYPE_NUMBER }, + { 's', "size", GCACHE_SIZE, G_TYPE_NUMBER }, G_OPT_SENTINEL }, - NULL, "[-v] [-b blocksize] [-s size] name prov" + "[-v] [-b blocksize] [-s size] name prov" }, { "destroy", G_FLAG_VERBOSE, NULL, { { 'f', "force", NULL, G_TYPE_BOOL }, G_OPT_SENTINEL }, - NULL, "[-fv] name ..." + "[-fv] name ..." }, - { "dump", 0, cache_main, G_NULL_OPTS, NULL, + { "dump", 0, cache_main, G_NULL_OPTS, "prov ..." }, { "label", G_FLAG_VERBOSE | G_FLAG_LOADKLD, cache_main, { - { 'b', "blocksize", &blocksize_label, G_TYPE_NUMBER }, - { 's', "size", &size_label, G_TYPE_NUMBER }, + { 'b', "blocksize", GCACHE_BLOCKSIZE, G_TYPE_NUMBER }, + { 's', "size", GCACHE_SIZE, G_TYPE_NUMBER }, G_OPT_SENTINEL }, - NULL, "[-v] [-b blocksize] [-s size] name prov" + "[-v] [-b blocksize] [-s size] name prov" }, - { "reset", G_FLAG_VERBOSE, NULL, G_NULL_OPTS, NULL, + { "reset", G_FLAG_VERBOSE, NULL, G_NULL_OPTS, "[-v] name ..." }, { "stop", G_FLAG_VERBOSE, NULL, @@ -98,7 +96,7 @@ struct g_command class_commands[] = { { 'f', "force", NULL, G_TYPE_BOOL }, G_OPT_SENTINEL }, - NULL, "[-fv] name ..." + "[-fv] name ..." }, G_CMD_SENTINEL }; Modified: head/sbin/geom/class/concat/geom_concat.c ============================================================================== --- head/sbin/geom/class/concat/geom_concat.c Mon Sep 13 13:11:50 2010 (r212553) +++ head/sbin/geom/class/concat/geom_concat.c Mon Sep 13 13:48:18 2010 (r212554) @@ -51,20 +51,20 @@ static void concat_dump(struct gctl_req static void concat_label(struct gctl_req *req); struct g_command class_commands[] = { - { "clear", G_FLAG_VERBOSE, concat_main, G_NULL_OPTS, NULL, + { "clear", G_FLAG_VERBOSE, concat_main, G_NULL_OPTS, "[-v] prov ..." }, { "create", G_FLAG_VERBOSE | G_FLAG_LOADKLD, NULL, G_NULL_OPTS, - NULL, "[-v] name prov ..." + "[-v] name prov ..." }, { "destroy", G_FLAG_VERBOSE, NULL, { { 'f', "force", NULL, G_TYPE_BOOL }, G_OPT_SENTINEL }, - NULL, "[-fv] name ..." + "[-fv] name ..." }, - { "dump", 0, concat_main, G_NULL_OPTS, NULL, + { "dump", 0, concat_main, G_NULL_OPTS, "prov ..." }, { "label", G_FLAG_VERBOSE | G_FLAG_LOADKLD, concat_main, @@ -72,14 +72,14 @@ struct g_command class_commands[] = { { 'h', "hardcode", NULL, G_TYPE_BOOL }, G_OPT_SENTINEL }, - NULL, "[-hv] name prov ..." + "[-hv] name prov ..." }, { "stop", G_FLAG_VERBOSE, NULL, { { 'f', "force", NULL, G_TYPE_BOOL }, G_OPT_SENTINEL }, - NULL, "[-fv] name ..." + "[-fv] name ..." }, G_CMD_SENTINEL }; Modified: head/sbin/geom/class/eli/geom_eli.c ============================================================================== --- head/sbin/geom/class/eli/geom_eli.c Mon Sep 13 13:11:50 2010 (r212553) +++ head/sbin/geom/class/eli/geom_eli.c Mon Sep 13 13:48:18 2010 (r212554) @@ -57,11 +57,6 @@ uint32_t version = G_ELI_VERSION; #define GELI_BACKUP_DIR "/var/backups/" #define GELI_ENC_ALGO "aes" -static intmax_t keylen = 0; -static intmax_t keyno = -1; -static intmax_t iterations = -1; -static intmax_t sectorsize = 0; - static void eli_main(struct gctl_req *req, unsigned flags); static void eli_init(struct gctl_req *req); static void eli_attach(struct gctl_req *req); @@ -102,14 +97,14 @@ struct g_command class_commands[] = { { 'b', "boot", NULL, G_TYPE_BOOL }, { 'B', "backupfile", "", G_TYPE_STRING }, { 'e', "ealgo", GELI_ENC_ALGO, G_TYPE_STRING }, - { 'i', "iterations", &iterations, G_TYPE_NUMBER }, + { 'i', "iterations", "-1", G_TYPE_NUMBER }, { 'K', "newkeyfile", "", G_TYPE_STRING }, - { 'l', "keylen", &keylen, G_TYPE_NUMBER }, + { 'l', "keylen", "0", G_TYPE_NUMBER }, { 'P', "nonewpassphrase", NULL, G_TYPE_BOOL }, - { 's', "sectorsize", §orsize, G_TYPE_NUMBER }, + { 's', "sectorsize", "0", G_TYPE_NUMBER }, G_OPT_SENTINEL }, - NULL, "[-bPv] [-a aalgo] [-B backupfile] [-e ealgo] [-i iterations] [-l keylen] [-K newkeyfile] [-s sectorsize] prov" + "[-bPv] [-a aalgo] [-B backupfile] [-e ealgo] [-i iterations] [-l keylen] [-K newkeyfile] [-s sectorsize] prov" }, { "label", G_FLAG_VERBOSE, eli_main, { @@ -117,14 +112,14 @@ struct g_command class_commands[] = { { 'b', "boot", NULL, G_TYPE_BOOL }, { 'B', "backupfile", "", G_TYPE_STRING }, { 'e', "ealgo", GELI_ENC_ALGO, G_TYPE_STRING }, - { 'i', "iterations", &iterations, G_TYPE_NUMBER }, + { 'i', "iterations", "-1", G_TYPE_NUMBER }, { 'K', "newkeyfile", "", G_TYPE_STRING }, - { 'l', "keylen", &keylen, G_TYPE_NUMBER }, + { 'l', "keylen", "0", G_TYPE_NUMBER }, { 'P', "nonewpassphrase", NULL, G_TYPE_BOOL }, - { 's', "sectorsize", §orsize, G_TYPE_NUMBER }, + { 's', "sectorsize", "0", G_TYPE_NUMBER }, G_OPT_SENTINEL }, - NULL, "- an alias for 'init'" + "- an alias for 'init'" }, { "attach", G_FLAG_VERBOSE | G_FLAG_LOADKLD, eli_main, { @@ -134,7 +129,7 @@ struct g_command class_commands[] = { { 'r', "readonly", NULL, G_TYPE_BOOL }, G_OPT_SENTINEL }, - NULL, "[-dprv] [-k keyfile] prov" + "[-dprv] [-k keyfile] prov" }, { "detach", 0, NULL, { @@ -142,7 +137,7 @@ struct g_command class_commands[] = { { 'l', "last", NULL, G_TYPE_BOOL }, G_OPT_SENTINEL }, - NULL, "[-fl] prov ..." + "[-fl] prov ..." }, { "stop", 0, NULL, { @@ -150,18 +145,18 @@ struct g_command class_commands[] = { { 'l', "last", NULL, G_TYPE_BOOL }, G_OPT_SENTINEL }, - NULL, "- an alias for 'detach'" + "- an alias for 'detach'" }, { "onetime", G_FLAG_VERBOSE | G_FLAG_LOADKLD, NULL, { { 'a', "aalgo", "", G_TYPE_STRING }, { 'd', "detach", NULL, G_TYPE_BOOL }, { 'e', "ealgo", GELI_ENC_ALGO, G_TYPE_STRING }, - { 'l', "keylen", &keylen, G_TYPE_NUMBER }, - { 's', "sectorsize", §orsize, G_TYPE_NUMBER }, + { 'l', "keylen", "0", G_TYPE_NUMBER }, + { 's', "sectorsize", "0", G_TYPE_NUMBER }, G_OPT_SENTINEL }, - NULL, "[-d] [-a aalgo] [-e ealgo] [-l keylen] [-s sectorsize] prov" + "[-d] [-a aalgo] [-e ealgo] [-l keylen] [-s sectorsize] prov" }, { "configure", G_FLAG_VERBOSE, eli_main, { @@ -169,46 +164,46 @@ struct g_command class_commands[] = { { 'B', "noboot", NULL, G_TYPE_BOOL }, G_OPT_SENTINEL }, - NULL, "[-bB] prov ..." + "[-bB] prov ..." }, { "setkey", G_FLAG_VERBOSE, eli_main, { - { 'i', "iterations", &iterations, G_TYPE_NUMBER }, + { 'i', "iterations", "-1", G_TYPE_NUMBER }, { 'k', "keyfile", "", G_TYPE_STRING }, { 'K', "newkeyfile", "", G_TYPE_STRING }, - { 'n', "keyno", &keyno, G_TYPE_NUMBER }, + { 'n', "keyno", "-1", G_TYPE_NUMBER }, { 'p', "nopassphrase", NULL, G_TYPE_BOOL }, { 'P', "nonewpassphrase", NULL, G_TYPE_BOOL }, G_OPT_SENTINEL }, - NULL, "[-pPv] [-n keyno] [-i iterations] [-k keyfile] [-K newkeyfile] prov" + "[-pPv] [-n keyno] [-i iterations] [-k keyfile] [-K newkeyfile] prov" }, { "delkey", G_FLAG_VERBOSE, eli_main, { { 'a', "all", NULL, G_TYPE_BOOL }, { 'f', "force", NULL, G_TYPE_BOOL }, - { 'n', "keyno", &keyno, G_TYPE_NUMBER }, + { 'n', "keyno", "-1", G_TYPE_NUMBER }, G_OPT_SENTINEL }, - NULL, "[-afv] [-n keyno] prov" + "[-afv] [-n keyno] prov" }, { "kill", G_FLAG_VERBOSE, eli_main, { { 'a', "all", NULL, G_TYPE_BOOL }, G_OPT_SENTINEL }, - NULL, "[-av] [prov ...]" + "[-av] [prov ...]" }, - { "backup", G_FLAG_VERBOSE, eli_main, G_NULL_OPTS, NULL, + { "backup", G_FLAG_VERBOSE, eli_main, G_NULL_OPTS, "[-v] prov file" }, - { "restore", G_FLAG_VERBOSE, eli_main, G_NULL_OPTS, NULL, + { "restore", G_FLAG_VERBOSE, eli_main, G_NULL_OPTS, "[-v] file prov" }, - { "clear", G_FLAG_VERBOSE, eli_main, G_NULL_OPTS, NULL, + { "clear", G_FLAG_VERBOSE, eli_main, G_NULL_OPTS, "[-v] prov ..." }, - { "dump", G_FLAG_VERBOSE, eli_main, G_NULL_OPTS, NULL, + { "dump", G_FLAG_VERBOSE, eli_main, G_NULL_OPTS, "[-v] prov ..." }, G_CMD_SENTINEL Modified: head/sbin/geom/class/journal/geom_journal.c ============================================================================== --- head/sbin/geom/class/journal/geom_journal.c Mon Sep 13 13:11:50 2010 (r212553) +++ head/sbin/geom/class/journal/geom_journal.c Mon Sep 13 13:48:18 2010 (r212554) @@ -47,18 +47,16 @@ __FBSDID("$FreeBSD$"); uint32_t lib_version = G_LIB_VERSION; uint32_t version = G_JOURNAL_VERSION; -static intmax_t default_jsize = -1; - static void journal_main(struct gctl_req *req, unsigned flags); static void journal_clear(struct gctl_req *req); static void journal_dump(struct gctl_req *req); static void journal_label(struct gctl_req *req); struct g_command class_commands[] = { - { "clear", G_FLAG_VERBOSE, journal_main, G_NULL_OPTS, NULL, + { "clear", G_FLAG_VERBOSE, journal_main, G_NULL_OPTS, "[-v] prov ..." }, - { "dump", 0, journal_main, G_NULL_OPTS, NULL, + { "dump", 0, journal_main, G_NULL_OPTS, "prov ..." }, { "label", G_FLAG_VERBOSE, journal_main, @@ -66,19 +64,19 @@ struct g_command class_commands[] = { { 'c', "checksum", NULL, G_TYPE_BOOL }, { 'f', "force", NULL, G_TYPE_BOOL }, { 'h', "hardcode", NULL, G_TYPE_BOOL }, - { 's', "jsize", &default_jsize, G_TYPE_NUMBER }, + { 's', "jsize", "-1", G_TYPE_NUMBER }, G_OPT_SENTINEL }, - NULL, "[-cfhv] [-s jsize] dataprov [jprov]" + "[-cfhv] [-s jsize] dataprov [jprov]" }, { "stop", G_FLAG_VERBOSE, NULL, { { 'f', "force", NULL, G_TYPE_BOOL }, G_OPT_SENTINEL }, - NULL, "[-fv] name ..." + "[-fv] name ..." }, - { "sync", G_FLAG_VERBOSE, NULL, G_NULL_OPTS, NULL, + { "sync", G_FLAG_VERBOSE, NULL, G_NULL_OPTS, "[-v]" }, G_CMD_SENTINEL Modified: head/sbin/geom/class/label/geom_label.c ============================================================================== --- head/sbin/geom/class/label/geom_label.c Mon Sep 13 13:11:50 2010 (r212553) +++ head/sbin/geom/class/label/geom_label.c Mon Sep 13 13:48:18 2010 (r212554) @@ -55,31 +55,31 @@ static void label_dump(struct gctl_req * static void label_label(struct gctl_req *req); struct g_command PUBSYM(class_commands)[] = { - { "clear", G_FLAG_VERBOSE, label_main, G_NULL_OPTS, NULL, + { "clear", G_FLAG_VERBOSE, label_main, G_NULL_OPTS, "[-v] dev ..." }, { "create", G_FLAG_VERBOSE | G_FLAG_LOADKLD, NULL, G_NULL_OPTS, - NULL, "[-v] name dev" + "[-v] name dev" }, { "destroy", G_FLAG_VERBOSE, NULL, { { 'f', "force", NULL, G_TYPE_BOOL }, G_OPT_SENTINEL }, - NULL, "[-fv] name ..." + "[-fv] name ..." }, - { "dump", 0, label_main, G_NULL_OPTS, NULL, + { "dump", 0, label_main, G_NULL_OPTS, "dev ..." }, { "label", G_FLAG_VERBOSE | G_FLAG_LOADKLD, label_main, G_NULL_OPTS, - NULL, "[-v] name dev" + "[-v] name dev" }, { "stop", G_FLAG_VERBOSE, NULL, { { 'f', "force", NULL, G_TYPE_BOOL }, G_OPT_SENTINEL }, - NULL, "[-fv] name ..." + "[-fv] name ..." }, G_CMD_SENTINEL }; Modified: head/sbin/geom/class/mirror/geom_mirror.c ============================================================================== --- head/sbin/geom/class/mirror/geom_mirror.c Mon Sep 13 13:11:50 2010 (r212553) +++ head/sbin/geom/class/mirror/geom_mirror.c Mon Sep 13 13:48:18 2010 (r212554) @@ -44,10 +44,9 @@ __FBSDID("$FreeBSD$"); uint32_t lib_version = G_LIB_VERSION; uint32_t version = G_MIRROR_VERSION; -#define GMIRROR_BALANCE "load" - -static intmax_t label_slice = 4096, configure_slice = -1; -static intmax_t insert_priority = 0, configure_priority = -1; +#define GMIRROR_BALANCE "load" +#define GMIRROR_SLICE "4096" +#define GMIRROR_PRIORITY "0" static void mirror_main(struct gctl_req *req, unsigned flags); static void mirror_activate(struct gctl_req *req); @@ -56,10 +55,10 @@ static void mirror_dump(struct gctl_req static void mirror_label(struct gctl_req *req); struct g_command class_commands[] = { - { "activate", G_FLAG_VERBOSE, mirror_main, G_NULL_OPTS, NULL, + { "activate", G_FLAG_VERBOSE, mirror_main, G_NULL_OPTS, "[-v] name prov ..." }, - { "clear", G_FLAG_VERBOSE, mirror_main, G_NULL_OPTS, NULL, + { "clear", G_FLAG_VERBOSE, mirror_main, G_NULL_OPTS, "[-v] prov ..." }, { "configure", G_FLAG_VERBOSE, NULL, @@ -71,20 +70,20 @@ struct g_command class_commands[] = { { 'F', "nofailsync", NULL, G_TYPE_BOOL }, { 'h', "hardcode", NULL, G_TYPE_BOOL }, { 'n', "noautosync", NULL, G_TYPE_BOOL }, - { 'p', "priority", &configure_priority, G_TYPE_NUMBER }, - { 's', "slice", &configure_slice, G_TYPE_NUMBER }, + { 'p', "priority", "-1", G_TYPE_NUMBER }, + { 's', "slice", "-1", G_TYPE_NUMBER }, G_OPT_SENTINEL }, - NULL, "[-adfFhnv] [-b balance] [-s slice] name\n" - "[-v] -p priority name prov" + "[-adfFhnv] [-b balance] [-s slice] name\n" + "[-v] -p priority name prov" }, - { "deactivate", G_FLAG_VERBOSE, NULL, G_NULL_OPTS, NULL, + { "deactivate", G_FLAG_VERBOSE, NULL, G_NULL_OPTS, "[-v] name prov ..." }, - { "dump", 0, mirror_main, G_NULL_OPTS, NULL, + { "dump", 0, mirror_main, G_NULL_OPTS, "prov ..." }, - { "forget", G_FLAG_VERBOSE, NULL, G_NULL_OPTS, NULL, + { "forget", G_FLAG_VERBOSE, NULL, G_NULL_OPTS, "name ..." }, { "label", G_FLAG_VERBOSE, mirror_main, @@ -93,24 +92,24 @@ struct g_command class_commands[] = { { 'F', "nofailsync", NULL, G_TYPE_BOOL }, { 'h', "hardcode", NULL, G_TYPE_BOOL }, { 'n', "noautosync", NULL, G_TYPE_BOOL }, - { 's', "slice", &label_slice, G_TYPE_NUMBER }, + { 's', "slice", GMIRROR_SLICE, G_TYPE_NUMBER }, G_OPT_SENTINEL }, - NULL, "[-Fhnv] [-b balance] [-s slice] name prov ..." + "[-Fhnv] [-b balance] [-s slice] name prov ..." }, { "insert", G_FLAG_VERBOSE, NULL, { { 'h', "hardcode", NULL, G_TYPE_BOOL }, { 'i', "inactive", NULL, G_TYPE_BOOL }, - { 'p', "priority", &insert_priority, G_TYPE_NUMBER }, + { 'p', "priority", GMIRROR_PRIORITY, G_TYPE_NUMBER }, G_OPT_SENTINEL }, - NULL, "[-hiv] [-p priority] name prov ..." + "[-hiv] [-p priority] name prov ..." }, - { "rebuild", G_FLAG_VERBOSE, NULL, G_NULL_OPTS, NULL, + { "rebuild", G_FLAG_VERBOSE, NULL, G_NULL_OPTS, "[-v] name prov ..." }, - { "remove", G_FLAG_VERBOSE, NULL, G_NULL_OPTS, NULL, + { "remove", G_FLAG_VERBOSE, NULL, G_NULL_OPTS, "[-v] name prov ..." }, { "stop", G_FLAG_VERBOSE, NULL, @@ -118,7 +117,7 @@ struct g_command class_commands[] = { { 'f', "force", NULL, G_TYPE_BOOL }, G_OPT_SENTINEL }, - NULL, "[-fv] name ..." + "[-fv] name ..." }, G_CMD_SENTINEL }; Modified: head/sbin/geom/class/mountver/geom_mountver.c ============================================================================== --- head/sbin/geom/class/mountver/geom_mountver.c Mon Sep 13 13:11:50 2010 (r212553) +++ head/sbin/geom/class/mountver/geom_mountver.c Mon Sep 13 13:48:18 2010 (r212554) @@ -43,14 +43,14 @@ struct g_command class_commands[] = { { G_OPT_SENTINEL }, - NULL, "[-v] dev ..." + "[-v] dev ..." }, { "destroy", G_FLAG_VERBOSE, NULL, { { 'f', "force", NULL, G_TYPE_BOOL }, G_OPT_SENTINEL }, - NULL, "[-fv] prov ..." + "[-fv] prov ..." }, G_CMD_SENTINEL }; Modified: head/sbin/geom/class/multipath/geom_multipath.c ============================================================================== --- head/sbin/geom/class/multipath/geom_multipath.c Mon Sep 13 13:11:50 2010 (r212553) +++ head/sbin/geom/class/multipath/geom_multipath.c Mon Sep 13 13:48:18 2010 (r212554) @@ -53,27 +53,27 @@ static void mp_add(struct gctl_req *); struct g_command class_commands[] = { { "label", G_FLAG_VERBOSE | G_FLAG_LOADKLD, mp_main, G_NULL_OPTS, - NULL, "[-v] name prov ..." + "[-v] name prov ..." }, { "add", G_FLAG_VERBOSE | G_FLAG_LOADKLD, mp_main, G_NULL_OPTS, - NULL, "[-v] name prov ..." + "[-v] name prov ..." }, { "destroy", G_FLAG_VERBOSE, NULL, G_NULL_OPTS, - NULL, "[-v] prov ..." + "[-v] prov ..." }, { "clear", G_FLAG_VERBOSE, mp_main, G_NULL_OPTS, - NULL, "[-v] prov ..." + "[-v] prov ..." }, { "rotate", G_FLAG_VERBOSE, NULL, G_NULL_OPTS, - NULL, "[-v] prov ..." + "[-v] prov ..." }, { "getactive", G_FLAG_VERBOSE, NULL, G_NULL_OPTS, - NULL, "[-v] prov ..." + "[-v] prov ..." }, G_CMD_SENTINEL }; Modified: head/sbin/geom/class/nop/geom_nop.c ============================================================================== --- head/sbin/geom/class/nop/geom_nop.c Mon Sep 13 13:11:50 2010 (r212553) +++ head/sbin/geom/class/nop/geom_nop.c Mon Sep 13 13:48:18 2010 (r212554) @@ -38,44 +38,37 @@ __FBSDID("$FreeBSD$"); uint32_t lib_version = G_LIB_VERSION; uint32_t version = G_NOP_VERSION; -static intmax_t error = -1; -static intmax_t rfailprob = -1; -static intmax_t wfailprob = -1; -static intmax_t offset = 0; -static intmax_t secsize = 0; -static intmax_t size = 0; - struct g_command class_commands[] = { { "create", G_FLAG_VERBOSE | G_FLAG_LOADKLD, NULL, { - { 'e', "error", &error, G_TYPE_NUMBER }, - { 'o', "offset", &offset, G_TYPE_NUMBER }, - { 'r', "rfailprob", &rfailprob, G_TYPE_NUMBER }, - { 's', "size", &size, G_TYPE_NUMBER }, - { 'S', "secsize", &secsize, G_TYPE_NUMBER }, - { 'w', "wfailprob", &wfailprob, G_TYPE_NUMBER }, + { 'e', "error", "-1", G_TYPE_NUMBER }, + { 'o', "offset", "0", G_TYPE_NUMBER }, + { 'r', "rfailprob", "-1", G_TYPE_NUMBER }, + { 's', "size", "0", G_TYPE_NUMBER }, + { 'S', "secsize", "0", G_TYPE_NUMBER }, + { 'w', "wfailprob", "-1", G_TYPE_NUMBER }, G_OPT_SENTINEL }, - NULL, "[-v] [-e error] [-o offset] [-r rfailprob] [-s size] " + "[-v] [-e error] [-o offset] [-r rfailprob] [-s size] " "[-S secsize] [-w wfailprob] dev ..." }, { "configure", G_FLAG_VERBOSE, NULL, { - { 'e', "error", &error, G_TYPE_NUMBER }, - { 'r', "rfailprob", &rfailprob, G_TYPE_NUMBER }, - { 'w', "wfailprob", &wfailprob, G_TYPE_NUMBER }, + { 'e', "error", "-1", G_TYPE_NUMBER }, + { 'r', "rfailprob", "-1", G_TYPE_NUMBER }, + { 'w', "wfailprob", "-1", G_TYPE_NUMBER }, G_OPT_SENTINEL }, - NULL, "[-v] [-e error] [-r rfailprob] [-w wfailprob] prov ..." + "[-v] [-e error] [-r rfailprob] [-w wfailprob] prov ..." }, { "destroy", G_FLAG_VERBOSE, NULL, { { 'f', "force", NULL, G_TYPE_BOOL }, G_OPT_SENTINEL }, - NULL, "[-fv] prov ..." + "[-fv] prov ..." }, - { "reset", G_FLAG_VERBOSE, NULL, G_NULL_OPTS, NULL, + { "reset", G_FLAG_VERBOSE, NULL, G_NULL_OPTS, "[-v] prov ..." }, G_CMD_SENTINEL Modified: head/sbin/geom/class/part/geom_part.c ============================================================================== --- head/sbin/geom/class/part/geom_part.c Mon Sep 13 13:11:50 2010 (r212553) +++ head/sbin/geom/class/part/geom_part.c Mon Sep 13 13:48:18 2010 (r212554) @@ -58,15 +58,15 @@ __FBSDID("$FreeBSD$"); uint32_t PUBSYM(lib_version) = G_LIB_VERSION; uint32_t PUBSYM(version) = 0; -static char autofill[] = "*"; -static char flags[] = "C"; - static char sstart[32]; static char ssize[32]; -static const char const bootcode_param[] = "bootcode"; -static const char const index_param[] = "index"; -static const char const partcode_param[] = "partcode"; +#define GPART_AUTOFILL "*" +#define GPART_FLAGS "C" + +#define GPART_PARAM_BOOTCODE "bootcode" +#define GPART_PARAM_INDEX "index" +#define GPART_PARAM_PARTCODE "partcode" static struct gclass *find_class(struct gmesh *, const char *); static struct ggeom * find_geom(struct gclass *, const char *); @@ -87,76 +87,81 @@ static void gpart_write_partcode_vtoc8(s struct g_command PUBSYM(class_commands)[] = { { "add", 0, gpart_issue, { - { 'b', "start", autofill, G_TYPE_STRING }, - { 's', "size", autofill, G_TYPE_STRING }, + { 'b', "start", GPART_AUTOFILL, G_TYPE_STRING }, + { 's', "size", GPART_AUTOFILL, G_TYPE_STRING }, { 't', "type", NULL, G_TYPE_STRING }, - { 'i', index_param, "", G_TYPE_ASCNUM }, + { 'i', GPART_PARAM_INDEX, "", G_TYPE_ASCNUM }, { 'l', "label", "", G_TYPE_STRING }, - { 'f', "flags", flags, G_TYPE_STRING }, + { 'f', "flags", GPART_FLAGS, G_TYPE_STRING }, G_OPT_SENTINEL }, - "geom", NULL + "[-b start] [-s size] -t type [-i index] [-l label] [-f flags] geom" }, { "bootcode", 0, gpart_bootcode, { - { 'b', bootcode_param, "", G_TYPE_STRING }, - { 'p', partcode_param, "", G_TYPE_STRING }, - { 'i', index_param, "", G_TYPE_ASCNUM }, - { 'f', "flags", flags, G_TYPE_STRING }, + { 'b', GPART_PARAM_BOOTCODE, "", G_TYPE_STRING }, + { 'p', GPART_PARAM_PARTCODE, "", G_TYPE_STRING }, + { 'i', GPART_PARAM_INDEX, "", G_TYPE_ASCNUM }, + { 'f', "flags", GPART_FLAGS, G_TYPE_STRING }, G_OPT_SENTINEL }, - "geom", NULL + "bootcode [-b bootcode] [-p partcode] [-i index] [-f flags] geom" + }, + { "commit", 0, gpart_issue, G_NULL_OPTS, + "geom" }, - { "commit", 0, gpart_issue, G_NULL_OPTS, "geom", NULL }, { "create", 0, gpart_issue, { { 's', "scheme", NULL, G_TYPE_STRING }, { 'n', "entries", "", G_TYPE_ASCNUM }, - { 'f', "flags", flags, G_TYPE_STRING }, + { 'f', "flags", GPART_FLAGS, G_TYPE_STRING }, G_OPT_SENTINEL }, - "provider", NULL + "-s scheme [-n entries] [-f flags] provider" }, { "delete", 0, gpart_issue, { - { 'i', index_param, NULL, G_TYPE_ASCNUM }, - { 'f', "flags", flags, G_TYPE_STRING }, + { 'i', GPART_PARAM_INDEX, NULL, G_TYPE_ASCNUM }, + { 'f', "flags", GPART_FLAGS, G_TYPE_STRING }, G_OPT_SENTINEL }, - "geom", NULL + "-i index [-f flags] geom" }, { "destroy", 0, gpart_issue, { - { 'f', "flags", flags, G_TYPE_STRING }, + { 'f', "flags", GPART_FLAGS, G_TYPE_STRING }, G_OPT_SENTINEL }, - "geom", NULL }, + "[-f flags] geom" + }, { "modify", 0, gpart_issue, { - { 'i', index_param, NULL, G_TYPE_ASCNUM }, + { 'i', GPART_PARAM_INDEX, NULL, G_TYPE_ASCNUM }, { 'l', "label", "", G_TYPE_STRING }, { 't', "type", "", G_TYPE_STRING }, - { 'f', "flags", flags, G_TYPE_STRING }, + { 'f', "flags", GPART_FLAGS, G_TYPE_STRING }, G_OPT_SENTINEL }, - "geom", NULL + "-i index [-l label] [-t type] [-f flags] geom" }, { "set", 0, gpart_issue, { { 'a', "attrib", NULL, G_TYPE_STRING }, - { 'i', index_param, NULL, G_TYPE_ASCNUM }, - { 'f', "flags", flags, G_TYPE_STRING }, + { 'i', GPART_PARAM_INDEX, NULL, G_TYPE_ASCNUM }, + { 'f', "flags", GPART_FLAGS, G_TYPE_STRING }, G_OPT_SENTINEL }, - "geom", NULL + "-a attrib -i index [-f flags] geom" }, { "show", 0, gpart_show, { { 'l', "show_label", NULL, G_TYPE_BOOL }, { 'r', "show_rawtype", NULL, G_TYPE_BOOL }, G_OPT_SENTINEL }, - NULL, "[-lr] [geom ...]" + "[-lr] [geom ...]" + }, + { "undo", 0, gpart_issue, G_NULL_OPTS, + "geom" }, - { "undo", 0, gpart_issue, G_NULL_OPTS, "geom", NULL }, { "unset", 0, gpart_issue, { { 'a', "attrib", NULL, G_TYPE_STRING }, - { 'i', index_param, NULL, G_TYPE_ASCNUM }, - { 'f', "flags", flags, G_TYPE_STRING }, + { 'i', GPART_PARAM_INDEX, NULL, G_TYPE_ASCNUM }, + { 'f', "flags", GPART_FLAGS, G_TYPE_STRING }, G_OPT_SENTINEL }, - "geom", NULL + "-a attrib -i index [-f flags] geom" }, { "resize", 0, gpart_issue, { - { 's', "size", autofill, G_TYPE_STRING }, - { 'i', index_param, NULL, G_TYPE_ASCNUM }, - { 'f', "flags", flags, G_TYPE_STRING }, + { 's', "size", GPART_AUTOFILL, G_TYPE_STRING }, + { 'i', GPART_PARAM_INDEX, NULL, G_TYPE_ASCNUM }, + { 'f', "flags", GPART_FLAGS, G_TYPE_STRING }, G_OPT_SENTINEL }, - "geom", NULL + "[-s size] -i index [-f flags] geom" }, G_CMD_SENTINEL }; @@ -281,7 +286,7 @@ gpart_autofill_resize(struct gctl_req *r char *val; int error, idx; - s = gctl_get_ascii(req, index_param); + s = gctl_get_ascii(req, GPART_PARAM_INDEX); idx = strtol(s, &val, 10); if (idx < 1 || *s == '\0' || *val != '\0') errx(EXIT_FAILURE, "invalid partition index"); @@ -773,11 +778,11 @@ gpart_bootcode(struct gctl_req *req, uns size_t bootsize, partsize; int error, idx, vtoc8; - if (gctl_has_param(req, bootcode_param)) { - s = gctl_get_ascii(req, bootcode_param); + if (gctl_has_param(req, GPART_PARAM_BOOTCODE)) { + s = gctl_get_ascii(req, GPART_PARAM_BOOTCODE); bootsize = 800 * 1024; /* Arbitrary limit. */ bootcode = gpart_bootfile_read(s, &bootsize); - error = gctl_change_param(req, bootcode_param, bootsize, + error = gctl_change_param(req, GPART_PARAM_BOOTCODE, bootsize, bootcode); if (error) errc(EXIT_FAILURE, error, "internal error"); @@ -797,7 +802,7 @@ gpart_bootcode(struct gctl_req *req, uns geom_deletetree(&mesh); errx(EXIT_FAILURE, "Class %s not found.", s); } - s = gctl_get_ascii(req, "geom"); + s = gctl_get_ascii(req, "arg0"); if (s == NULL) abort(); gp = find_geom(classp, s); @@ -808,11 +813,11 @@ gpart_bootcode(struct gctl_req *req, uns if (strcmp(s, "VTOC8") == 0) vtoc8 = 1; - if (gctl_has_param(req, partcode_param)) { - s = gctl_get_ascii(req, partcode_param); + if (gctl_has_param(req, GPART_PARAM_PARTCODE)) { + s = gctl_get_ascii(req, GPART_PARAM_PARTCODE); partsize = vtoc8 != 0 ? VTOC_BOOTSIZE : bootsize * 1024; partcode = gpart_bootfile_read(s, &partsize); - error = gctl_delete_param(req, partcode_param); + error = gctl_delete_param(req, GPART_PARAM_PARTCODE); if (error) errc(EXIT_FAILURE, error, "internal error"); } else { @@ -820,14 +825,14 @@ gpart_bootcode(struct gctl_req *req, uns partsize = 0; } - if (gctl_has_param(req, index_param)) { + if (gctl_has_param(req, GPART_PARAM_INDEX)) { if (partcode == NULL) errx(EXIT_FAILURE, "-i is only valid with -p"); - s = gctl_get_ascii(req, index_param); + s = gctl_get_ascii(req, GPART_PARAM_INDEX); idx = strtol(s, &sp, 10); if (idx < 1 || *s == '\0' || *sp != '\0') errx(EXIT_FAILURE, "invalid partition index"); - error = gctl_delete_param(req, index_param); + error = gctl_delete_param(req, GPART_PARAM_INDEX); if (error) errc(EXIT_FAILURE, error, "internal error"); } else @@ -858,6 +863,10 @@ gpart_issue(struct gctl_req *req, unsign const char *errstr; int error, status; + if (gctl_get_int(req, "nargs") != 1) + errx(EXIT_FAILURE, "Invalid number of arguments."); + (void)gctl_delete_param(req, "nargs"); + /* autofill parameters (if applicable). */ error = gpart_autofill(req); if (error) { Modified: head/sbin/geom/class/raid3/geom_raid3.c ============================================================================== --- head/sbin/geom/class/raid3/geom_raid3.c Mon Sep 13 13:11:50 2010 (r212553) +++ head/sbin/geom/class/raid3/geom_raid3.c Mon Sep 13 13:48:18 2010 (r212554) @@ -45,15 +45,13 @@ __FBSDID("$FreeBSD$"); uint32_t lib_version = G_LIB_VERSION; uint32_t version = G_RAID3_VERSION; -static intmax_t default_blocksize = 0; - static void raid3_main(struct gctl_req *req, unsigned f); static void raid3_clear(struct gctl_req *req); static void raid3_dump(struct gctl_req *req); static void raid3_label(struct gctl_req *req); struct g_command class_commands[] = { - { "clear", G_FLAG_VERBOSE, raid3_main, G_NULL_OPTS, NULL, + { "clear", G_FLAG_VERBOSE, raid3_main, G_NULL_OPTS, "[-v] prov ..." }, { "configure", G_FLAG_VERBOSE, NULL, @@ -70,9 +68,9 @@ struct g_command class_commands[] = { { 'W', "noverify", NULL, G_TYPE_BOOL }, G_OPT_SENTINEL }, - NULL, "[-adfFhnrRvwW] name" + "[-adfFhnrRvwW] name" }, - { "dump", 0, raid3_main, G_NULL_OPTS, NULL, + { "dump", 0, raid3_main, G_NULL_OPTS, "prov ..." }, { "insert", G_FLAG_VERBOSE, NULL, @@ -81,7 +79,7 @@ struct g_command class_commands[] = { { 'n', "number", NULL, G_TYPE_NUMBER }, G_OPT_SENTINEL }, - NULL, "[-hv] <-n number> name prov" + "[-hv] <-n number> name prov" }, { "label", G_FLAG_VERBOSE, raid3_main, { @@ -89,13 +87,13 @@ struct g_command class_commands[] = { { 'F', "nofailsync", NULL, G_TYPE_BOOL }, { 'n', "noautosync", NULL, G_TYPE_BOOL }, { 'r', "round_robin", NULL, G_TYPE_BOOL }, - { 's', "blocksize", &default_blocksize, G_TYPE_NUMBER }, + { 's', "sectorsize", "0", G_TYPE_NUMBER }, { 'w', "verify", NULL, G_TYPE_BOOL }, G_OPT_SENTINEL }, - NULL, "[-hFnrvw] [-s blocksize] name prov prov prov ..." + "[-hFnrvw] [-s blocksize] name prov prov prov ..." }, - { "rebuild", G_FLAG_VERBOSE, NULL, G_NULL_OPTS, NULL, + { "rebuild", G_FLAG_VERBOSE, NULL, G_NULL_OPTS, "[-v] name prov" }, { "remove", G_FLAG_VERBOSE, NULL, @@ -103,14 +101,14 @@ struct g_command class_commands[] = { { 'n', "number", NULL, G_TYPE_NUMBER }, G_OPT_SENTINEL }, - NULL, "[-v] <-n number> name" + "[-v] <-n number> name" }, { "stop", G_FLAG_VERBOSE, NULL, { { 'f', "force", NULL, G_TYPE_BOOL }, G_OPT_SENTINEL }, - NULL, "[-fv] name ..." + "[-fv] name ..." }, G_CMD_SENTINEL }; @@ -193,7 +191,7 @@ raid3_label(struct gctl_req *req) * sectorsizes of every disk and find the smallest mediasize. */ mediasize = 0; - sectorsize = gctl_get_intmax(req, "blocksize"); + sectorsize = gctl_get_intmax(req, "sectorsize"); for (i = 1; i < nargs; i++) { str = gctl_get_ascii(req, "arg%d", i); msize = g_get_mediasize(str); Modified: head/sbin/geom/class/sched/geom_sched.c ============================================================================== --- head/sbin/geom/class/sched/geom_sched.c Mon Sep 13 13:11:50 2010 (r212553) +++ head/sbin/geom/class/sched/geom_sched.c Mon Sep 13 13:48:18 2010 (r212554) @@ -60,11 +60,13 @@ uint32_t version = G_SCHED_VERSION; * Adapt to differences in geom library. * in V1 struct g_command misses gc_argname, eld, and G_BOOL is undefined */ -#if G_LIB_VERSION == 1 -#define G_ARGNAME +#if G_LIB_VERSION <= 1 #define G_TYPE_BOOL G_TYPE_NUMBER -#else +#endif +#if G_LIB_VERSION >= 3 && G_LIB_VERSION <= 4 #define G_ARGNAME NULL, +#else +#define G_ARGNAME #endif static void Modified: head/sbin/geom/class/shsec/geom_shsec.c ============================================================================== --- head/sbin/geom/class/shsec/geom_shsec.c Mon Sep 13 13:11:50 2010 (r212553) +++ head/sbin/geom/class/shsec/geom_shsec.c Mon Sep 13 13:48:18 2010 (r212554) @@ -52,10 +52,10 @@ static void shsec_dump(struct gctl_req * static void shsec_label(struct gctl_req *req); struct g_command class_commands[] = { - { "clear", G_FLAG_VERBOSE, shsec_main, G_NULL_OPTS, NULL, + { "clear", G_FLAG_VERBOSE, shsec_main, G_NULL_OPTS, "[-v] prov ..." }, - { "dump", 0, shsec_main, G_NULL_OPTS, NULL, + { "dump", 0, shsec_main, G_NULL_OPTS, "prov ..." }, { "label", G_FLAG_VERBOSE | G_FLAG_LOADKLD, shsec_main, @@ -63,14 +63,14 @@ struct g_command class_commands[] = { { 'h', "hardcode", NULL, G_TYPE_BOOL }, G_OPT_SENTINEL }, - NULL, "[-hv] name prov prov ..." + "[-hv] name prov prov ..." }, { "stop", G_FLAG_VERBOSE, NULL, { { 'f', "force", NULL, G_TYPE_BOOL }, G_OPT_SENTINEL }, - NULL, "[-fv] name ..." + "[-fv] name ..." }, G_CMD_SENTINEL }; Modified: head/sbin/geom/class/stripe/geom_stripe.c ============================================================================== --- head/sbin/geom/class/stripe/geom_stripe.c Mon Sep 13 13:11:50 2010 (r212553) +++ head/sbin/geom/class/stripe/geom_stripe.c Mon Sep 13 13:48:18 2010 (r212554) @@ -46,7 +46,7 @@ __FBSDID("$FreeBSD$"); uint32_t lib_version = G_LIB_VERSION; uint32_t version = G_STRIPE_VERSION; -static intmax_t default_stripesize = 65536; +#define GSTRIPE_STRIPESIZE "65536" static void stripe_main(struct gctl_req *req, unsigned flags); static void stripe_clear(struct gctl_req *req); @@ -54,40 +54,40 @@ static void stripe_dump(struct gctl_req static void stripe_label(struct gctl_req *req); struct g_command class_commands[] = { - { "clear", G_FLAG_VERBOSE, stripe_main, G_NULL_OPTS, NULL, + { "clear", G_FLAG_VERBOSE, stripe_main, G_NULL_OPTS, "[-v] prov ..." }, { "create", G_FLAG_VERBOSE | G_FLAG_LOADKLD, NULL, { - { 's', "stripesize", &default_stripesize, G_TYPE_NUMBER }, + { 's', "stripesize", GSTRIPE_STRIPESIZE, G_TYPE_NUMBER }, G_OPT_SENTINEL }, - NULL, "[-hv] [-s stripesize] name prov prov ..." + "[-hv] [-s stripesize] name prov prov ..." }, { "destroy", G_FLAG_VERBOSE, NULL, { { 'f', "force", NULL, G_TYPE_BOOL }, G_OPT_SENTINEL }, - NULL, "[-fv] name ..." + "[-fv] name ..." }, - { "dump", 0, stripe_main, G_NULL_OPTS, NULL, + { "dump", 0, stripe_main, G_NULL_OPTS, "prov ..." }, { "label", G_FLAG_VERBOSE | G_FLAG_LOADKLD, stripe_main, { { 'h', "hardcode", NULL, G_TYPE_BOOL }, - { 's', "stripesize", &default_stripesize, G_TYPE_NUMBER }, + { 's', "stripesize", GSTRIPE_STRIPESIZE, G_TYPE_NUMBER }, G_OPT_SENTINEL }, - NULL, "[-hv] [-s stripesize] name prov prov ..." + "[-hv] [-s stripesize] name prov prov ..." }, { "stop", G_FLAG_VERBOSE, NULL, { { 'f', "force", NULL, G_TYPE_BOOL }, G_OPT_SENTINEL }, - NULL, "[-fv] name ..." + "[-fv] name ..." }, G_CMD_SENTINEL }; Modified: head/sbin/geom/class/virstor/geom_virstor.c ============================================================================== --- head/sbin/geom/class/virstor/geom_virstor.c Mon Sep 13 13:11:50 2010 (r212553) +++ head/sbin/geom/class/virstor/geom_virstor.c Mon Sep 13 13:48:18 2010 (r212554) @@ -48,8 +48,9 @@ __FBSDID("$FreeBSD$"); uint32_t lib_version = G_LIB_VERSION; uint32_t version = G_VIRSTOR_VERSION; -static intmax_t chunk_size = 4 * 1024 * 1024; /* in kB (default: 4 MB) */ -static intmax_t vir_size = 2ULL << 40; /* in MB (default: 2 TB) */ + +#define GVIRSTOR_CHUNK_SIZE "4M" +#define GVIRSTOR_VIR_SIZE "2T" #if G_LIB_VERSION == 1 /* Support RELENG_6 */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Mon Sep 13 13:59:28 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AAC8A1065672; Mon, 13 Sep 2010 13:59:28 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 98A3D8FC15; Mon, 13 Sep 2010 13:59:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8DDxS5M004701; Mon, 13 Sep 2010 13:59:28 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8DDxSLm004698; Mon, 13 Sep 2010 13:59:28 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201009131359.o8DDxSLm004698@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Mon, 13 Sep 2010 13:59:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212555 - head/sbin/geom/core X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2010 13:59:28 -0000 Author: pjd Date: Mon Sep 13 13:59:28 2010 New Revision: 212555 URL: http://svn.freebsd.org/changeset/base/212555 Log: Add G_TYPE_MULTI flag, which when set for the given option, will allow the option to be specified multiple times. This will help to implement things like passing multiple keyfiles to geli(8) instead of cat(1)ing them all into stdin and reading from there using one '-k -' option. Modified: head/sbin/geom/core/geom.c head/sbin/geom/core/geom.h Modified: head/sbin/geom/core/geom.c ============================================================================== --- head/sbin/geom/core/geom.c Mon Sep 13 13:48:18 2010 (r212554) +++ head/sbin/geom/core/geom.c Mon Sep 13 13:59:28 2010 (r212555) @@ -234,9 +234,31 @@ find_option(struct g_command *cmd, char static void set_option(struct gctl_req *req, struct g_option *opt, const char *val) { + const char *optname; uint64_t number; void *ptr; + if (G_OPT_ISMULTI(opt)) { + size_t optnamesize; + + if (G_OPT_NUM(opt) == UCHAR_MAX) + errx(EXIT_FAILURE, "Too many -%c options.", opt->go_char); + + /* + * Base option name length plus 3 bytes for option number + * (max. 255 options) plus 1 byte for terminating '\0'. + */ + optnamesize = strlen(opt->go_name) + 3 + 1; + ptr = malloc(optnamesize); + if (ptr == NULL) + errx(EXIT_FAILURE, "No memory."); + snprintf(ptr, optnamesize, "%s%u", opt->go_name, G_OPT_NUM(opt)); + G_OPT_NUMINC(opt); + optname = ptr; + } else { + optname = opt->go_name; + } + if (G_OPT_TYPE(opt) == G_TYPE_NUMBER || G_OPT_TYPE(opt) == G_TYPE_ASCNUM) { if (expand_number(val, &number) == -1) { @@ -249,27 +271,30 @@ set_option(struct gctl_req *req, struct errx(EXIT_FAILURE, "No memory."); *(intmax_t *)ptr = number; opt->go_val = ptr; - gctl_ro_param(req, opt->go_name, sizeof(intmax_t), + gctl_ro_param(req, optname, sizeof(intmax_t), opt->go_val); } else { asprintf((void *)(&ptr), "%jd", number); if (ptr == NULL) errx(EXIT_FAILURE, "No memory."); opt->go_val = ptr; - gctl_ro_param(req, opt->go_name, -1, opt->go_val); + gctl_ro_param(req, optname, -1, opt->go_val); } } else if (G_OPT_TYPE(opt) == G_TYPE_STRING) { - gctl_ro_param(req, opt->go_name, -1, val); + gctl_ro_param(req, optname, -1, val); } else if (G_OPT_TYPE(opt) == G_TYPE_BOOL) { ptr = malloc(sizeof(int)); if (ptr == NULL) errx(EXIT_FAILURE, "No memory."); *(int *)ptr = *val - '0'; opt->go_val = ptr; - gctl_ro_param(req, opt->go_name, sizeof(int), opt->go_val); + gctl_ro_param(req, optname, sizeof(int), opt->go_val); } else { assert(!"Invalid type"); } + + if (G_OPT_ISMULTI(opt)) + free(__DECONST(char *, optname)); } /* @@ -294,7 +319,10 @@ parse_arguments(struct g_command *cmd, s if (opt->go_name == NULL) break; assert(G_OPT_TYPE(opt) != 0); - assert((opt->go_type & ~G_TYPE_MASK) == 0); + assert((opt->go_type & ~(G_TYPE_MASK | G_TYPE_MULTI)) == 0); + /* Multiple bool arguments makes no sense. */ + assert(G_OPT_TYPE(opt) != G_TYPE_BOOL || + (opt->go_type & G_TYPE_MULTI) == 0); strlcatf(opts, sizeof(opts), "%c", opt->go_char); if (G_OPT_TYPE(opt) != G_TYPE_BOOL) strlcat(opts, ":", sizeof(opts)); @@ -314,7 +342,7 @@ parse_arguments(struct g_command *cmd, s opt = find_option(cmd, ch); if (opt == NULL) usage(); - if (G_OPT_ISDONE(opt)) { + if (!G_OPT_ISMULTI(opt) && G_OPT_ISDONE(opt)) { warnx("Option '%c' specified twice.", opt->go_char); usage(); } Modified: head/sbin/geom/core/geom.h ============================================================================== --- head/sbin/geom/core/geom.h Mon Sep 13 13:48:18 2010 (r212554) +++ head/sbin/geom/core/geom.h Mon Sep 13 13:59:28 2010 (r212555) @@ -41,11 +41,17 @@ #define G_TYPE_ASCNUM 0x04 #define G_TYPE_MASK 0x0f #define G_TYPE_DONE 0x10 +#define G_TYPE_MULTI 0x20 +#define G_TYPE_NUMMASK 0xff00 +#define G_TYPE_NUMSHIFT 8 #define G_OPT_MAX 16 #define G_OPT_DONE(opt) do { (opt)->go_type |= G_TYPE_DONE; } while (0) #define G_OPT_ISDONE(opt) ((opt)->go_type & G_TYPE_DONE) +#define G_OPT_ISMULTI(opt) ((opt)->go_type & G_TYPE_MULTI) #define G_OPT_TYPE(opt) ((opt)->go_type & G_TYPE_MASK) +#define G_OPT_NUM(opt) (((opt)->go_type & G_TYPE_NUMMASK) >> G_TYPE_NUMSHIFT) +#define G_OPT_NUMINC(opt) ((opt)->go_type += (1 << G_TYPE_NUMSHIFT)) #define G_OPT_SENTINEL { '\0', NULL, NULL, G_TYPE_NONE } #define G_NULL_OPTS { G_OPT_SENTINEL } From owner-svn-src-head@FreeBSD.ORG Mon Sep 13 14:11:29 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from hub.freebsd.org (localhost [127.0.0.1]) by hub.freebsd.org (Postfix) with SMTP id E575F106564A; Mon, 13 Sep 2010 14:11:28 +0000 (UTC) (envelope-from nork@FreeBSD.org) Date: Mon, 13 Sep 2010 23:11:28 +0900 From: Norikatsu Shigemura To: Andriy Gapon Message-Id: <20100913231128.c674dfe8.nork@FreeBSD.org> In-Reply-To: <201009130951.o8D9pOsr085093@svn.freebsd.org> References: <201009130951.o8D9pOsr085093@svn.freebsd.org> X-Mailer: Sylpheed 3.0.3 (GTK+ 2.20.1; i386-portbld-freebsd8.1) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r212549 - head/sys/dev/acpica X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2010 14:11:29 -0000 Hi avg! On Mon, 13 Sep 2010 09:51:24 +0000 (UTC) Andriy Gapon wrote: > Author: avg > Date: Mon Sep 13 09:51:24 2010 > New Revision: 212549 > URL: http://svn.freebsd.org/changeset/base/212549 > Log: > acpi_cpu: do not apply P_LVLx_LAT rules to latencies returned by _CST > ACPI specification sates that if P_LVL2_LAT > 100, then a system doesn't > support C2; if P_LVL3_LAT > 1000, then C3 is not supported. > But there are no such rules for Cx state data returned by _CST. If a > state is not supported it should not be included into the return > package. In other words, any latency value returned by _CST is valid, > it's up to the OS and/or user to decide whether to use it. > Submitted by: nork > Suggested by: mav > MFC after: 1 week Thank you! > Modified: > head/sys/dev/acpica/acpi_cpu.c > > Modified: head/sys/dev/acpica/acpi_cpu.c > ============================================================================== > --- head/sys/dev/acpica/acpi_cpu.c Mon Sep 13 09:23:38 2010 (r212548) > +++ head/sys/dev/acpica/acpi_cpu.c Mon Sep 13 09:51:24 2010 (r212549) > @@ -690,19 +690,11 @@ acpi_cpu_cx_cst(struct acpi_cpu_softc *s > sc->cpu_cx_count++; > continue; > case ACPI_STATE_C2: > - if (cx_ptr->trans_lat > 100) { > - ACPI_DEBUG_PRINT((ACPI_DB_INFO, > - "acpi_cpu%d: C2[%d] not available.\n", > - device_get_unit(sc->cpu_dev), i)); > - continue; > - } > sc->cpu_non_c3 = i; > break; > case ACPI_STATE_C3: > default: > - if (cx_ptr->trans_lat > 1000 || > - (cpu_quirks & CPU_QUIRK_NO_C3) != 0) { > - > + if ((cpu_quirks & CPU_QUIRK_NO_C3) != 0) { > ACPI_DEBUG_PRINT((ACPI_DB_INFO, > "acpi_cpu%d: C3[%d] not available.\n", > device_get_unit(sc->cpu_dev), i)); -- Norikatsu Shigemura From owner-svn-src-head@FreeBSD.ORG Mon Sep 13 14:25:08 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3042E106564A; Mon, 13 Sep 2010 14:25:08 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1E9CC8FC0C; Mon, 13 Sep 2010 14:25:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8DEP8jN006434; Mon, 13 Sep 2010 14:25:08 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8DEP89A006432; Mon, 13 Sep 2010 14:25:08 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201009131425.o8DEP89A006432@svn.freebsd.org> From: Alexander Motin Date: Mon, 13 Sep 2010 14:25:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212556 - head/sys/powerpc/powerpc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2010 14:25:08 -0000 Author: mav Date: Mon Sep 13 14:25:07 2010 New Revision: 212556 URL: http://svn.freebsd.org/changeset/base/212556 Log: Change call order to enable interrupts only after timer being programmed. Submitted by: nwhitehorn Modified: head/sys/powerpc/powerpc/mp_machdep.c Modified: head/sys/powerpc/powerpc/mp_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/mp_machdep.c Mon Sep 13 13:59:28 2010 (r212555) +++ head/sys/powerpc/powerpc/mp_machdep.c Mon Sep 13 14:25:07 2010 (r212556) @@ -91,12 +91,12 @@ machdep_ap_bootstrap(void) PCPU_SET(curthread, PCPU_GET(idlethread)); PCPU_SET(curpcb, curthread->td_pcb); - /* Let the DEC and external interrupts go */ - mtmsr(mfmsr() | PSL_EE); - /* Start per-CPU event timers. */ cpu_initclocks_ap(); + /* Let the DEC and external interrupts go */ + mtmsr(mfmsr() | PSL_EE); + /* Announce ourselves awake, and enter the scheduler */ sched_throw(NULL); } From owner-svn-src-head@FreeBSD.ORG Mon Sep 13 15:06:55 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id 059071065670; Mon, 13 Sep 2010 15:06:55 +0000 (UTC) Date: Mon, 13 Sep 2010 15:06:55 +0000 From: Alexander Best To: Pawel Jakub Dawidek Message-ID: <20100913150654.GA23703@freebsd.org> References: <201009131348.o8DDmJL8004159@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201009131348.o8DDmJL8004159@svn.freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r212554 - in head: sbin/geom/class/cache sbin/geom/class/concat sbin/geom/class/eli sbin/geom/class/journal sbin/geom/class/label sbin/geom/class/mirror sbin/geom/class/mountver sbin/ge... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2010 15:06:55 -0000 hi there, could you take a quick peek at PR #150239 to see if the patch for g_part.c is a reasonable change? thanks. alex -- a13x From owner-svn-src-head@FreeBSD.ORG Mon Sep 13 15:10:31 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B87151065679; Mon, 13 Sep 2010 15:10:31 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 88DCC8FC14; Mon, 13 Sep 2010 15:10:31 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 2393146C0D; Mon, 13 Sep 2010 11:10:31 -0400 (EDT) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 3F47A8A03C; Mon, 13 Sep 2010 11:10:30 -0400 (EDT) From: John Baldwin To: Andriy Gapon Date: Mon, 13 Sep 2010 08:48:33 -0400 User-Agent: KMail/1.13.5 (FreeBSD/7.3-CBSD-20100819; KDE/4.4.5; amd64; ; ) References: <201009131147.o8DBla8x095589@svn.freebsd.org> <4C8E144C.3030405@freebsd.org> In-Reply-To: <4C8E144C.3030405@freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201009130848.34144.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Mon, 13 Sep 2010 11:10:30 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=4.2 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: "Jayachandran C." , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r212550 - head/sys/mips/rmi X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2010 15:10:31 -0000 On Monday, September 13, 2010 8:08:44 am Andriy Gapon wrote: > on 13/09/2010 14:47 Jayachandran C. said the following: > > Author: jchandra > > Date: Mon Sep 13 11:47:35 2010 > > New Revision: 212550 > > URL: http://svn.freebsd.org/changeset/base/212550 > > > > Log: > > bus_add_child method is needed now. > > Just a note: bus_add_child method needs to be defined only if it's actually > used, i.e. a device/bus has at least one child that calls BUS_ADD_CHILD. And that generally only happens in device_identify() methods of drivers that live on the bus. If a bus can self-enumerate devices (e.g. PCI) it should use device_add_child() directly. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Sep 13 15:30:09 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CEDFF106566B; Mon, 13 Sep 2010 15:30:09 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BD1968FC13; Mon, 13 Sep 2010 15:30:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8DFU95p010736; Mon, 13 Sep 2010 15:30:09 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8DFU9f5010734; Mon, 13 Sep 2010 15:30:09 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201009131530.o8DFU9f5010734@svn.freebsd.org> From: Warner Losh Date: Mon, 13 Sep 2010 15:30:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212558 - head/usr.bin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2010 15:30:09 -0000 Author: imp Date: Mon Sep 13 15:30:09 2010 New Revision: 212558 URL: http://svn.freebsd.org/changeset/base/212558 Log: Move to using Makefile.arch to include the proper target-specific programs. Modified: head/usr.bin/Makefile Modified: head/usr.bin/Makefile ============================================================================== --- head/usr.bin/Makefile Mon Sep 13 15:19:49 2010 (r212557) +++ head/usr.bin/Makefile Mon Sep 13 15:30:09 2010 (r212558) @@ -11,48 +11,29 @@ SUBDIR= alias \ apply \ - ${_ar} \ asa \ - ${_at} \ - ${_atm} \ awk \ banner \ basename \ - ${_bc} \ - ${_biff} \ - ${_bluetooth} \ brandelf \ bsdiff \ bzip2 \ bzip2recover \ - ${_c89} \ - ${_c99} \ - ${_calendar} \ cap_mkdb \ - ${_catman} \ chat \ - ${_checknr} \ - ${_chkey} \ chpass \ cksum \ ${_clang} \ cmp \ col \ - ${_colcrt} \ colldef \ colrm \ column \ comm \ - ${_compile_et} \ compress \ - ${_cpio} \ cpuset \ csplit \ - ${_csup} \ - ${_ctags} \ cut \ - ${_dc} \ - ${_dig} \ dirname \ du \ ee \ @@ -64,12 +45,10 @@ SUBDIR= alias \ false \ fetch \ file \ - ${_file2c} \ find \ finger \ fmt \ fold \ - ${_from} \ fstat \ fsync \ ftp \ @@ -78,15 +57,11 @@ SUBDIR= alias \ getconf \ getent \ getopt \ - ${_gprof} \ ${_grep} \ gzip \ head \ - ${_hesinfo} \ hexdump \ - ${_host} \ id \ - ${_indent} \ ipcrm \ ipcs \ join \ @@ -105,10 +80,8 @@ SUBDIR= alias \ less \ lessecho \ lesskey \ - ${_lex} \ limits \ locale \ - ${_locate} \ lock \ lockf \ logger \ @@ -120,8 +93,6 @@ SUBDIR= alias \ lsvfs \ lzmainfo \ m4 \ - ${_mail} \ - ${_make} \ ${_makewhatis} \ mesg \ minigzip \ @@ -129,24 +100,16 @@ SUBDIR= alias \ mkdep \ mkfifo \ mklocale \ - ${_mkstr} \ mktemp \ mkuzip \ - ${_msgs} \ mt \ - ${_nc} \ ncal \ - ${_ncplist} \ - ${_ncplogin} \ netstat \ newgrp \ - ${_newkey} \ nfsstat \ nice \ nl \ nohup \ - ${_nslookup} \ - ${_nsupdate} \ opieinfo \ opiekey \ opiepasswd \ @@ -159,26 +122,19 @@ SUBDIR= alias \ printenv \ printf \ procstat \ - ${_quota} \ renice \ rev \ revoke \ - ${_rlogin} \ - ${_rpcgen} \ rpcinfo \ rs \ - ${_rsh} \ rup \ - ${_ruptime} \ rusers \ rwall \ - ${_rwho} \ script \ sed \ seq \ shar \ showmount \ - ${_smbutil} \ sockstat \ split \ stat \ @@ -190,7 +146,6 @@ SUBDIR= alias \ tar \ tcopy \ tee \ - ${_telnet} \ tftp \ time \ tip \ @@ -200,25 +155,19 @@ SUBDIR= alias \ tr \ true \ truncate \ - ${_truss} \ + truss \ tset \ tsort \ tty \ - ${_ul} \ uname \ unexpand \ - ${_unifdef} \ uniq \ unzip \ units \ unvis \ - ${_usbhidaction} \ - ${_usbhidctl} \ users \ uudecode \ uuencode \ - ${_vacation} \ - ${_vgrind} \ vi \ vis \ vmstat \ @@ -244,37 +193,33 @@ SUBDIR= alias \ ${_ypmatch} \ ${_ypwhich} -.if ${MACHINE_ARCH} != "arm" -_truss= truss -.endif - # NB: keep these sorted by MK_* knobs .if ${MK_AT} != "no" -_at= at +SUBDIR+= at .endif .if ${MK_ATM} != "no" -_atm= atm +SUBDIR+= atm .endif .if ${MK_MAN_UTILS} != "no" -_catman= catman +SUBDIR+= catman .endif .if ${MK_BIND_UTILS} != "no" -_dig= dig -_host= host -_nslookup= nslookup -_nsupdate= nsupdate +SUBDIR+= dig +SUBDIR+= host +SUBDIR+= nslookup +SUBDIR+= nsupdate .endif .if ${MK_BLUETOOTH} != "no" -_bluetooth= bluetooth +SUBDIR+= bluetooth .endif .if ${MK_BSD_CPIO} != "no" -_cpio= cpio +SUBDIR+= cpio .endif .if ${MK_BSD_GREP} != "no" @@ -282,7 +227,7 @@ _grep= grep .endif .if ${MK_CALENDAR} != "no" -_calendar= calendar +SUBDIR+= calendar .endif .if ${MK_CLANG} != "no" @@ -290,33 +235,33 @@ _clang= clang .endif .if ${MK_HESIOD} != "no" -_hesinfo= hesinfo +SUBDIR+= hesinfo .endif .if ${MK_OPENSSL} != "no" -_bc= bc -_chkey= chkey -_dc= dc -_newkey= newkey +SUBDIR+= bc +SUBDIR+= chkey +SUBDIR+= dc +SUBDIR+= newkey .if ${MK_LIBTHR} != "no" -_csup= csup +SUBDIR+= csup .endif .endif .if ${MK_LOCATE} != "no" -_locate= locate +SUBDIR+= locate .endif # XXX msgs? .if ${MK_MAIL} != "no" -_biff= biff -_from= from -_mail= mail -_msgs= msgs +SUBDIR+= biff +SUBDIR+= from +SUBDIR+= mail +SUBDIR+= msgs .endif .if ${MK_MAKE} != "no" -_make= make +SUBDIR+= make .endif .if ${MK_MAN_UTILS} != "no" @@ -324,91 +269,67 @@ _makewhatis= makewhatis .endif .if ${MK_NETCAT} != "no" -_nc= nc +SUBDIR+= nc .endif .if ${MK_NIS} != "no" -_ypcat= ypcat -_ypmatch= ypmatch -_ypwhich= ypwhich +SUBDIR+= ypcat +SUBDIR+= ypmatch +SUBDIR+= ypwhich .endif .if ${MK_QUOTAS} != "no" -_quota= quota +SUBDIR+= quota .endif .if ${MK_RCMDS} != "no" -_rlogin= rlogin -_rsh= rsh -_ruptime= ruptime -_rwho= rwho +SUBDIR+= rlogin +SUBDIR+= rsh +SUBDIR+= ruptime +SUBDIR+= rwho .endif .if ${MK_SENDMAIL} != "no" -_vacation= vacation +SUBDIR+= vacation .endif .if ${MK_TELNET} != "no" -_telnet= telnet +SUBDIR+= telnet .endif .if ${MK_TEXTPROC} != "no" -_checknr= checknr -_colcrt= colcrt -_ul= ul +SUBDIR+= checknr +SUBDIR+= colcrt +SUBDIR+= ul .endif .if ${MK_TOOLCHAIN} != "no" -_ar= ar -_c89= c89 -_c99= c99 -_compile_et= compile_et -_ctags= ctags -_file2c= file2c -_gprof= gprof -_indent= indent -_lex= lex -_mkstr= mkstr -_rpcgen= rpcgen -_unifdef= unifdef -_xlint= xlint -_xstr= xstr +SUBDIR+= ar +SUBDIR+= c89 +SUBDIR+= c99 +SUBDIR+= compile_et +SUBDIR+= ctags +SUBDIR+= file2c +SUBDIR+= gprof +SUBDIR+= indent +SUBDIR+= lex +SUBDIR+= mkstr +SUBDIR+= rpcgen +SUBDIR+= unifdef +SUBDIR+= xlint +SUBDIR+= xstr # XXX maybe under textproc? -_vgrind= vgrind -_yacc= yacc +SUBDIR+= vgrind +SUBDIR+= yacc .endif .if ${MK_USB} != "no" -_usbhidaction= usbhidaction -_usbhidctl= usbhidctl -.endif - -.if ${MACHINE_ARCH} == "i386" -.if ${MK_NCP} != "no" -_ncplist= ncplist -_ncplogin= ncplogin -.endif -_smbutil= smbutil -.endif - -.if ${MACHINE_ARCH} == "ia64" -_smbutil= smbutil -.endif - -.if ${MACHINE_ARCH} == "amd64" -.if ${MK_NCP} != "no" -_ncplist= ncplist -_ncplogin= ncplogin -.endif -_smbutil= smbutil +SUBDIR+= usbhidaction +SUBDIR+= usbhidctl .endif -.if ${MACHINE_ARCH} == "powerpc" -_smbutil= smbutil -.endif +.include -.if ${MACHINE_ARCH} == "sparc64" -_smbutil= smbutil -.endif +SUBDIR:= ${SUBDIR:O} .include From owner-svn-src-head@FreeBSD.ORG Mon Sep 13 15:36:42 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 81DE81065672; Mon, 13 Sep 2010 15:36:42 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 702698FC0A; Mon, 13 Sep 2010 15:36:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8DFagu2011229; Mon, 13 Sep 2010 15:36:42 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8DFagHW011227; Mon, 13 Sep 2010 15:36:42 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201009131536.o8DFagHW011227@svn.freebsd.org> From: Nathan Whitehorn Date: Mon, 13 Sep 2010 15:36:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212559 - head/sys/powerpc/powerpc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2010 15:36:42 -0000 Author: nwhitehorn Date: Mon Sep 13 15:36:42 2010 New Revision: 212559 URL: http://svn.freebsd.org/changeset/base/212559 Log: Fix a subtle bug uncovered by the recent one-shot timer import in which any spin locks acquired between the enabling of interrupts in machdep_ap_bootstrap() and the invocation of the scheduler would fail to have interrupts disabled due to the fake spinlock already held by the idle thread. sched_throw(NULL) will enable interrupts by itself when exiting this spinlock, so just let it do that and don't enable interrupts here. Modified: head/sys/powerpc/powerpc/mp_machdep.c Modified: head/sys/powerpc/powerpc/mp_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/mp_machdep.c Mon Sep 13 15:30:09 2010 (r212558) +++ head/sys/powerpc/powerpc/mp_machdep.c Mon Sep 13 15:36:42 2010 (r212559) @@ -94,9 +94,6 @@ machdep_ap_bootstrap(void) /* Start per-CPU event timers. */ cpu_initclocks_ap(); - /* Let the DEC and external interrupts go */ - mtmsr(mfmsr() | PSL_EE); - /* Announce ourselves awake, and enter the scheduler */ sched_throw(NULL); } From owner-svn-src-head@FreeBSD.ORG Mon Sep 13 16:39:34 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3381E106564A; Mon, 13 Sep 2010 16:39:34 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 223288FC0C; Mon, 13 Sep 2010 16:39:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8DGdYNb015259; Mon, 13 Sep 2010 16:39:34 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8DGdYeG015255; Mon, 13 Sep 2010 16:39:34 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201009131639.o8DGdYeG015255@svn.freebsd.org> From: Warner Losh Date: Mon, 13 Sep 2010 16:39:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212560 - in head/sys: conf mips/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2010 16:39:34 -0000 Author: imp Date: Mon Sep 13 16:39:33 2010 New Revision: 212560 URL: http://svn.freebsd.org/changeset/base/212560 Log: TARGET_64BIT isn't needed anymore, GC it (partial merge from tbemd). Modified: head/sys/conf/Makefile.mips head/sys/mips/conf/MALTA64 head/sys/mips/conf/OCTEON1 Modified: head/sys/conf/Makefile.mips ============================================================================== --- head/sys/conf/Makefile.mips Mon Sep 13 15:36:42 2010 (r212559) +++ head/sys/conf/Makefile.mips Mon Sep 13 16:39:33 2010 (r212560) @@ -54,20 +54,12 @@ SYSTEM_LD+=-EB EXTRA_FLAGS+=-EB TRAMP_LDFLAGS+=-Wl,-EB HACK_EXTRA_FLAGS+=-EB -Wl,-EB -.if defined(TARGET_64BIT) -SYSTEM_LD+=-m elf64btsmip_fbsd -HACK_EXTRA_FLAGS+=-Wl,-m,elf64btsmip_fbsd -.endif .else CFLAGS+=-EL SYSTEM_LD+=-EL EXTRA_FLAGS+=-EL TRAMP_LDFLAGS+=-Wl,-EL HACK_EXTRA_FLAGS+=-EL -Wl,-EL -.if defined(TARGET_64BIT) -SYSTEM_LD+=-m elf64ltsmip_fbsd -HACK_EXTRA_FLAGS+=-Wl,-m,elf64ltsmip_fbsd -.endif .endif Modified: head/sys/mips/conf/MALTA64 ============================================================================== --- head/sys/mips/conf/MALTA64 Mon Sep 13 15:36:42 2010 (r212559) +++ head/sys/mips/conf/MALTA64 Mon Sep 13 16:39:33 2010 (r212560) @@ -21,7 +21,6 @@ ident MALTA makeoptions ARCH_FLAGS="-march=mips64 -mabi=64" makeoptions MIPS_LITTLE_ENDIAN=defined -makeoptions TARGET_64BIT=t makeoptions LDSCRIPT_NAME= ldscript.mips.mips64 options YAMON Modified: head/sys/mips/conf/OCTEON1 ============================================================================== --- head/sys/mips/conf/OCTEON1 Mon Sep 13 15:36:42 2010 (r212559) +++ head/sys/mips/conf/OCTEON1 Mon Sep 13 16:39:33 2010 (r212560) @@ -34,7 +34,6 @@ makeoptions LDSCRIPT_NAME=ldscript.mips. # Don't build any modules yet. makeoptions MODULES_OVERRIDE="" makeoptions TARGET_BIG_ENDIAN=defined -makeoptions TARGET_64BIT=defined makeoptions KERNLOADADDR=0xffffffff80100000 include "../cavium/std.octeon1" From owner-svn-src-head@FreeBSD.ORG Mon Sep 13 17:30:33 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CEF651065777; Mon, 13 Sep 2010 17:30:31 +0000 (UTC) (envelope-from alc@rice.edu) Received: from mh2.mail.rice.edu (mh2.mail.rice.edu [128.42.201.21]) by mx1.freebsd.org (Postfix) with ESMTP id 8177C8FC1D; Mon, 13 Sep 2010 17:30:31 +0000 (UTC) Received: from mh2.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh2.mail.rice.edu (Postfix) with ESMTP id 904A428F6FE; Mon, 13 Sep 2010 12:30:30 -0500 (CDT) X-Virus-Scanned: by amavis-2.6.4 at mh2.mail.rice.edu, auth channel Received: from mh2.mail.rice.edu ([127.0.0.1]) by mh2.mail.rice.edu (mh2.mail.rice.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id k0nIjkv6JAHP; Mon, 13 Sep 2010 12:30:30 -0500 (CDT) Received: from adsl-216-63-78-18.dsl.hstntx.swbell.net (adsl-216-63-78-18.dsl.hstntx.swbell.net [216.63.78.18]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) (Authenticated sender: alc) by mh2.mail.rice.edu (Postfix) with ESMTPSA id B4BE228F6D6; Mon, 13 Sep 2010 12:30:29 -0500 (CDT) Message-ID: <4C8E5FB5.9070009@rice.edu> Date: Mon, 13 Sep 2010 12:30:29 -0500 From: Alan Cox User-Agent: Thunderbird 2.0.0.24 (X11/20100725) MIME-Version: 1.0 To: Kostik Belousov , Ryan Stone References: <201009070023.o870Njtg072607@svn.freebsd.org> <20100907080446.GA2853@deviant.kiev.zoral.com.ua> In-Reply-To: <20100907080446.GA2853@deviant.kiev.zoral.com.ua> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r212281 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2010 17:30:34 -0000 Kostik Belousov wrote: > On Tue, Sep 07, 2010 at 12:23:45AM +0000, Ryan Stone wrote: > >> Author: rstone >> Date: Tue Sep 7 00:23:45 2010 >> New Revision: 212281 >> URL: http://svn.freebsd.org/changeset/base/212281 >> >> Log: >> In munmap() downgrade the vm_map_lock to a read lock before taking a read >> lock on the pmc-sx lock. This prevents a deadlock with >> pmc_log_process_mappings, which has an exclusive lock on pmc-sx and tries >> to get a read lock on a vm_map. Downgrading the vm_map_lock in munmap >> allows pmc_log_process_mappings to continue, preventing the deadlock. >> >> Without this change I could cause a deadlock on a multicore 8.1-RELEASE >> system by having one thread constantly mmap'ing and then munmap'ing a >> PROT_EXEC mapping in a loop while I repeatedly invoked and stopped pmcstat >> in system-wide sampling mode. >> >> Reviewed by: fabient >> Approved by: emaste (mentor) >> MFC after: 2 weeks >> >> Modified: >> head/sys/vm/vm_mmap.c >> >> Modified: head/sys/vm/vm_mmap.c >> ============================================================================== >> --- head/sys/vm/vm_mmap.c Mon Sep 6 23:52:04 2010 (r212280) >> +++ head/sys/vm/vm_mmap.c Tue Sep 7 00:23:45 2010 (r212281) >> @@ -579,6 +579,7 @@ munmap(td, uap) >> * Inform hwpmc if the address range being unmapped contains >> * an executable region. >> */ >> + pkm.pm_address = (uintptr_t) NULL; >> if (vm_map_lookup_entry(map, addr, &entry)) { >> for (; >> entry != &map->header && entry->start < addr + size; >> @@ -587,16 +588,23 @@ munmap(td, uap) >> entry->end, VM_PROT_EXECUTE) == TRUE) { >> pkm.pm_address = (uintptr_t) addr; >> pkm.pm_size = (size_t) size; >> - PMC_CALL_HOOK(td, PMC_FN_MUNMAP, >> - (void *) &pkm); >> break; >> } >> } >> } >> #endif >> - /* returns nothing but KERN_SUCCESS anyway */ >> vm_map_delete(map, addr, addr + size); >> + >> +#ifdef HWPMC_HOOKS >> + /* downgrade the lock to prevent a LOR with the pmc-sx lock */ >> + vm_map_lock_downgrade(map); >> + if (pkm.pm_address != (uintptr) NULL) >> + PMC_CALL_HOOK(td, PMC_FN_MUNMAP, (void *) &pkm); >> + vm_map_unlock_read(map); >> +#else >> vm_map_unlock(map); >> +#endif >> + /* vm_map_delete returns nothing but KERN_SUCCESS anyway */ >> return (0); >> } >> >> > Note that vm_map_unlock() is more then just dropping the lock on the map. > Due to ordering of the vnode lock before vm map lock, vm_map_unlock() > processes the deferred free entries after map lock is dropped. After your > change, the deferred list might keep entries for some time until next > unlock is performed. > > I'm afraid that this understates the effect. Over the weekend, when I updated one of my amd64 machines to include this change, I found that the delay in object and page deallocation is leading to severe fragmentation within the physical memory allocator. As a result, the time spent in the kernel during a "buildworld" increased by about 8%. Moreover, superpage promotion by applications effectively stopped. For now, I think it would be best to back out r212281 and r212282. Ultimately, the fix may be to change the vm map synchronization primitives, and simply reinstate r212281 and r212282, but I'd like some time to consider the options. Regards, Alan From owner-svn-src-head@FreeBSD.ORG Mon Sep 13 17:49:40 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4EBF41065672; Mon, 13 Sep 2010 17:49:40 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3E1068FC0A; Mon, 13 Sep 2010 17:49:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8DHnecJ020667; Mon, 13 Sep 2010 17:49:40 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8DHneFS020665; Mon, 13 Sep 2010 17:49:40 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201009131749.o8DHneFS020665@svn.freebsd.org> From: Rui Paulo Date: Mon, 13 Sep 2010 17:49:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212567 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2010 17:49:40 -0000 Author: rpaulo Date: Mon Sep 13 17:49:39 2010 New Revision: 212567 URL: http://svn.freebsd.org/changeset/base/212567 Log: Add a note about userland DTracing. Sponsored by: The FreeBSD Foundation > Description of fields to fill in above: 76 columns --| > PR: If a GNATS PR is affected by the change. > Submitted by: If someone else sent in the change. > Reviewed by: If someone else reviewed your modification. > Approved by: If you needed approval for this commit. > Obtained from: If the change is from a third party. > MFC after: N [day[s]|week[s]|month[s]]. Request a reminder email. > Security: Vulnerability reference (one per line) or description. > Empty fields above will be automatically removed. M UPDATING Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Mon Sep 13 17:30:29 2010 (r212566) +++ head/UPDATING Mon Sep 13 17:49:39 2010 (r212567) @@ -22,6 +22,16 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 9. machines to maximize performance. (To disable malloc debugging, run ln -s aj /etc/malloc.conf.) +20100913: + DTrace has grown support for userland tracing. Due to this, DTrace is + now i386 and amd64 only. + dtruss(1) is now installed by default on those systems and a new + kernel module is needed for userland tracing: fasttrap. + No changes to your kernel config file are necessary to enable + userland tracing, but you might consider adding 'STRIP=' and + 'CFLAGS+=-fno-omit-frame-pointer' to your make.conf if you want + to have informative userland stack traces in DTrace (ustack). + 20100725: The acpi_aiboost(4) driver has been removed in favor of the new aibs(4) driver. You should update your kernel configuration file. From owner-svn-src-head@FreeBSD.ORG Mon Sep 13 17:53:43 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BD114106564A; Mon, 13 Sep 2010 17:53:43 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AC3CD8FC16; Mon, 13 Sep 2010 17:53:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8DHrhGl021006; Mon, 13 Sep 2010 17:53:43 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8DHrh0j021004; Mon, 13 Sep 2010 17:53:43 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201009131753.o8DHrh0j021004@svn.freebsd.org> From: Rui Paulo Date: Mon, 13 Sep 2010 17:53:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212568 - head/sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2010 17:53:43 -0000 Author: rpaulo Date: Mon Sep 13 17:53:43 2010 New Revision: 212568 URL: http://svn.freebsd.org/changeset/base/212568 Log: Bump __FreeBSD_version to reflect the userland DTrace changes. Sponsored by: The FreeBSD Foundation > Description of fields to fill in above: 76 columns --| > PR: If a GNATS PR is affected by the change. > Submitted by: If someone else sent in the change. > Reviewed by: If someone else reviewed your modification. > Approved by: If you needed approval for this commit. > Obtained from: If the change is from a third party. > MFC after: N [day[s]|week[s]|month[s]]. Request a reminder email. > Security: Vulnerability reference (one per line) or description. > Empty fields above will be automatically removed. M param.h Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Mon Sep 13 17:49:39 2010 (r212567) +++ head/sys/sys/param.h Mon Sep 13 17:53:43 2010 (r212568) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 900020 /* Master, propagated to newvers */ +#define __FreeBSD_version 900021 /* Master, propagated to newvers */ #ifndef LOCORE #include From owner-svn-src-head@FreeBSD.ORG Mon Sep 13 18:26:35 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 71931106571F; Mon, 13 Sep 2010 18:26:34 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 729B48FC16; Mon, 13 Sep 2010 18:26:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8DIQYjk023365; Mon, 13 Sep 2010 18:26:34 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8DIQYwn023363; Mon, 13 Sep 2010 18:26:34 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201009131826.o8DIQYwn023363@svn.freebsd.org> From: Ed Maste Date: Mon, 13 Sep 2010 18:26:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212570 - head/usr.sbin/config X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2010 18:26:35 -0000 Author: emaste Date: Mon Sep 13 18:26:34 2010 New Revision: 212570 URL: http://svn.freebsd.org/changeset/base/212570 Log: Allow a kernel config to specify a set but empty value via 'makeoptions OPTION=' for consistency with the make commandline. Previously 'makeoptions WERROR=' would result in a syntax error; now it produces the same effect as 'makeoptions WERROR'. Both forms now result in 'WERROR=' in the generated Makefile. Modified: head/usr.sbin/config/config.y Modified: head/usr.sbin/config/config.y ============================================================================== --- head/usr.sbin/config/config.y Mon Sep 13 18:26:32 2010 (r212569) +++ head/usr.sbin/config/config.y Mon Sep 13 18:26:34 2010 (r212570) @@ -261,6 +261,7 @@ Mkopt_list: Mkoption: Save_id { newopt(&mkopt, $1, ns(""), 0); } | + Save_id EQUALS { newopt(&mkopt, $1, ns(""), 0); } | Save_id EQUALS Opt_value { newopt(&mkopt, $1, $3, 0); } | Save_id PLUSEQUALS Opt_value { newopt(&mkopt, $1, $3, 1); } ; From owner-svn-src-head@FreeBSD.ORG Mon Sep 13 18:48:24 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 070F5106566C; Mon, 13 Sep 2010 18:48:24 +0000 (UTC) (envelope-from mdf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E8C448FC17; Mon, 13 Sep 2010 18:48:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8DImNSx025004; Mon, 13 Sep 2010 18:48:23 GMT (envelope-from mdf@svn.freebsd.org) Received: (from mdf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8DImNU6024992; Mon, 13 Sep 2010 18:48:23 GMT (envelope-from mdf@svn.freebsd.org) Message-Id: <201009131848.o8DImNU6024992@svn.freebsd.org> From: Matthew D Fleming Date: Mon, 13 Sep 2010 18:48:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212572 - in head/sys: dev/cxgb kern sys vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2010 18:48:24 -0000 Author: mdf Date: Mon Sep 13 18:48:23 2010 New Revision: 212572 URL: http://svn.freebsd.org/changeset/base/212572 Log: Revert r212370, as it causes a LOR on powerpc. powerpc does a few unexpected things in copyout(9) and so wiring the user buffer is not sufficient to perform a copyout(9) while holding a random mutex. Requested by: nwhitehorn Modified: head/sys/dev/cxgb/cxgb_sge.c head/sys/kern/kern_malloc.c head/sys/kern/kern_sysctl.c head/sys/kern/subr_lock.c head/sys/kern/subr_sbuf.c head/sys/kern/subr_sleepqueue.c head/sys/kern/subr_witness.c head/sys/sys/sysctl.h head/sys/vm/uma_core.c head/sys/vm/vm_phys.c head/sys/vm/vm_reserv.c Modified: head/sys/dev/cxgb/cxgb_sge.c ============================================================================== --- head/sys/dev/cxgb/cxgb_sge.c Mon Sep 13 18:32:49 2010 (r212571) +++ head/sys/dev/cxgb/cxgb_sge.c Mon Sep 13 18:48:23 2010 (r212572) @@ -3227,6 +3227,7 @@ t3_dump_rspq(SYSCTL_HANDLER_ARGS) struct sge_rspq *rspq; struct sge_qset *qs; int i, err, dump_end, idx; + static int multiplier = 1; struct sbuf *sb; struct rsp_desc *rspd; uint32_t data[4]; @@ -3251,8 +3252,8 @@ t3_dump_rspq(SYSCTL_HANDLER_ARGS) err = t3_sge_read_rspq(qs->port->adapter, rspq->cntxt_id, data); if (err) return (err); - - sb = sbuf_new_for_sysctl(NULL, NULL, QDUMP_SBUF_SIZE, req); +retry_sbufops: + sb = sbuf_new(NULL, NULL, QDUMP_SBUF_SIZE*multiplier, SBUF_FIXEDLEN); sbuf_printf(sb, " \n index=%u size=%u MSI-X/RspQ=%u intr enable=%u intr armed=%u\n", (data[0] & 0xffff), data[0] >> 16, ((data[2] >> 20) & 0x3f), @@ -3275,11 +3276,13 @@ t3_dump_rspq(SYSCTL_HANDLER_ARGS) rspd->rss_hdr.rss_hash_val, be32toh(rspd->flags), be32toh(rspd->len_cq), rspd->intr_gen); } - - err = sbuf_finish(sb); - /* Output a trailing NUL. */ - if (err == 0) - err = SYSCTL_OUT(req, "", 1); + if (sbuf_error(sb) != 0) { + sbuf_delete(sb); + multiplier++; + goto retry_sbufops; + } + sbuf_finish(sb); + err = SYSCTL_OUT(req, sbuf_data(sb), sbuf_len(sb) + 1); sbuf_delete(sb); return (err); } @@ -3290,6 +3293,7 @@ t3_dump_txq_eth(SYSCTL_HANDLER_ARGS) struct sge_txq *txq; struct sge_qset *qs; int i, j, err, dump_end; + static int multiplier = 1; struct sbuf *sb; struct tx_desc *txd; uint32_t *WR, wr_hi, wr_lo, gen; @@ -3317,7 +3321,9 @@ t3_dump_txq_eth(SYSCTL_HANDLER_ARGS) if (err) return (err); - sb = sbuf_new_for_sysctl(NULL, NULL, QDUMP_SBUF_SIZE, req); + +retry_sbufops: + sb = sbuf_new(NULL, NULL, QDUMP_SBUF_SIZE*multiplier, SBUF_FIXEDLEN); sbuf_printf(sb, " \n credits=%u GTS=%u index=%u size=%u rspq#=%u cmdq#=%u\n", (data[0] & 0x7fff), ((data[0] >> 15) & 1), (data[0] >> 16), @@ -3344,10 +3350,13 @@ t3_dump_txq_eth(SYSCTL_HANDLER_ARGS) WR[j], WR[j + 1], WR[j + 2], WR[j + 3]); } - err = sbuf_finish(sb); - /* Output a trailing NUL. */ - if (err == 0) - err = SYSCTL_OUT(req, "", 1); + if (sbuf_error(sb) != 0) { + sbuf_delete(sb); + multiplier++; + goto retry_sbufops; + } + sbuf_finish(sb); + err = SYSCTL_OUT(req, sbuf_data(sb), sbuf_len(sb) + 1); sbuf_delete(sb); return (err); } @@ -3358,6 +3367,7 @@ t3_dump_txq_ctrl(SYSCTL_HANDLER_ARGS) struct sge_txq *txq; struct sge_qset *qs; int i, j, err, dump_end; + static int multiplier = 1; struct sbuf *sb; struct tx_desc *txd; uint32_t *WR, wr_hi, wr_lo, gen; @@ -3381,7 +3391,8 @@ t3_dump_txq_ctrl(SYSCTL_HANDLER_ARGS) return (EINVAL); } - sb = sbuf_new_for_sysctl(NULL, NULL, QDUMP_SBUF_SIZE, req); +retry_sbufops: + sb = sbuf_new(NULL, NULL, QDUMP_SBUF_SIZE*multiplier, SBUF_FIXEDLEN); sbuf_printf(sb, " qid=%d start=%d -> end=%d\n", qs->idx, txq->txq_dump_start, (txq->txq_dump_start + txq->txq_dump_count) & 255); @@ -3401,10 +3412,13 @@ t3_dump_txq_ctrl(SYSCTL_HANDLER_ARGS) WR[j], WR[j + 1], WR[j + 2], WR[j + 3]); } - err = sbuf_finish(sb); - /* Output a trailing NUL. */ - if (err == 0) - err = SYSCTL_OUT(req, "", 1); + if (sbuf_error(sb) != 0) { + sbuf_delete(sb); + multiplier++; + goto retry_sbufops; + } + sbuf_finish(sb); + err = SYSCTL_OUT(req, sbuf_data(sb), sbuf_len(sb) + 1); sbuf_delete(sb); return (err); } Modified: head/sys/kern/kern_malloc.c ============================================================================== --- head/sys/kern/kern_malloc.c Mon Sep 13 18:32:49 2010 (r212571) +++ head/sys/kern/kern_malloc.c Mon Sep 13 18:48:23 2010 (r212572) @@ -828,11 +828,25 @@ sysctl_kern_malloc_stats(SYSCTL_HANDLER_ struct malloc_type_internal *mtip; struct malloc_type_header mth; struct malloc_type *mtp; - int error, i; + int buflen, count, error, i; struct sbuf sbuf; + char *buffer; - sbuf_new_for_sysctl(&sbuf, NULL, 128, req); mtx_lock(&malloc_mtx); +restart: + mtx_assert(&malloc_mtx, MA_OWNED); + count = kmemcount; + mtx_unlock(&malloc_mtx); + buflen = sizeof(mtsh) + count * (sizeof(mth) + + sizeof(struct malloc_type_stats) * MAXCPU) + 1; + buffer = malloc(buflen, M_TEMP, M_WAITOK | M_ZERO); + mtx_lock(&malloc_mtx); + if (count < kmemcount) { + free(buffer, M_TEMP); + goto restart; + } + + sbuf_new(&sbuf, buffer, buflen, SBUF_FIXEDLEN); /* * Insert stream header. @@ -841,7 +855,11 @@ sysctl_kern_malloc_stats(SYSCTL_HANDLER_ mtsh.mtsh_version = MALLOC_TYPE_STREAM_VERSION; mtsh.mtsh_maxcpus = MAXCPU; mtsh.mtsh_count = kmemcount; - (void)sbuf_bcat(&sbuf, &mtsh, sizeof(mtsh)); + if (sbuf_bcat(&sbuf, &mtsh, sizeof(mtsh)) < 0) { + mtx_unlock(&malloc_mtx); + error = ENOMEM; + goto out; + } /* * Insert alternating sequence of type headers and type statistics. @@ -854,19 +872,30 @@ sysctl_kern_malloc_stats(SYSCTL_HANDLER_ */ bzero(&mth, sizeof(mth)); strlcpy(mth.mth_name, mtp->ks_shortdesc, MALLOC_MAX_NAME); - (void)sbuf_bcat(&sbuf, &mth, sizeof(mth)); + if (sbuf_bcat(&sbuf, &mth, sizeof(mth)) < 0) { + mtx_unlock(&malloc_mtx); + error = ENOMEM; + goto out; + } /* * Insert type statistics for each CPU. */ for (i = 0; i < MAXCPU; i++) { - (void)sbuf_bcat(&sbuf, &mtip->mti_stats[i], - sizeof(mtip->mti_stats[i])); + if (sbuf_bcat(&sbuf, &mtip->mti_stats[i], + sizeof(mtip->mti_stats[i])) < 0) { + mtx_unlock(&malloc_mtx); + error = ENOMEM; + goto out; + } } } mtx_unlock(&malloc_mtx); - error = sbuf_finish(&sbuf); + sbuf_finish(&sbuf); + error = SYSCTL_OUT(req, sbuf_data(&sbuf), sbuf_len(&sbuf)); +out: sbuf_delete(&sbuf); + free(buffer, M_TEMP); return (error); } @@ -976,19 +1005,26 @@ DB_SHOW_COMMAND(multizone_matches, db_sh static int sysctl_kern_mprof(SYSCTL_HANDLER_ARGS) { + int linesize = 64; struct sbuf sbuf; uint64_t count; uint64_t waste; uint64_t mem; + int bufsize; int error; + char *buf; int rsize; int size; int i; + bufsize = linesize * (KMEM_ZSIZE + 1); + bufsize += 128; /* For the stats line */ + bufsize += 128; /* For the banner line */ waste = 0; mem = 0; - sbuf_new_for_sysctl(&sbuf, NULL, 128, req); + buf = malloc(bufsize, M_TEMP, M_WAITOK|M_ZERO); + sbuf_new(&sbuf, buf, bufsize, SBUF_FIXEDLEN); sbuf_printf(&sbuf, "\n Size Requests Real Size\n"); for (i = 0; i < KMEM_ZSIZE; i++) { @@ -1006,8 +1042,12 @@ sysctl_kern_mprof(SYSCTL_HANDLER_ARGS) sbuf_printf(&sbuf, "\nTotal memory used:\t%30llu\nTotal Memory wasted:\t%30llu\n", (unsigned long long)mem, (unsigned long long)waste); - error = sbuf_finish(&sbuf); + sbuf_finish(&sbuf); + + error = SYSCTL_OUT(req, sbuf_data(&sbuf), sbuf_len(&sbuf)); + sbuf_delete(&sbuf); + free(buf, M_TEMP); return (error); } Modified: head/sys/kern/kern_sysctl.c ============================================================================== --- head/sys/kern/kern_sysctl.c Mon Sep 13 18:32:49 2010 (r212571) +++ head/sys/kern/kern_sysctl.c Mon Sep 13 18:48:23 2010 (r212572) @@ -51,7 +51,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -1545,30 +1544,3 @@ userland_sysctl(struct thread *td, int * } return (error); } - -/* - * Drain into a sysctl struct. The user buffer must be wired. - */ -static int -sbuf_sysctl_drain(void *arg, const char *data, int len) -{ - struct sysctl_req *req = arg; - int error; - - error = SYSCTL_OUT(req, data, len); - KASSERT(error >= 0, ("Got unexpected negative value %d", error)); - return (error == 0 ? len : -error); -} - -struct sbuf * -sbuf_new_for_sysctl(struct sbuf *s, char *buf, int length, - struct sysctl_req *req) -{ - - /* Wire the user buffer, so we can write without blocking. */ - sysctl_wire_old_buffer(req, 0); - - s = sbuf_new(s, buf, length, SBUF_FIXEDLEN); - sbuf_set_drain(s, sbuf_sysctl_drain, req); - return (s); -} Modified: head/sys/kern/subr_lock.c ============================================================================== --- head/sys/kern/subr_lock.c Mon Sep 13 18:32:49 2010 (r212571) +++ head/sys/kern/subr_lock.c Mon Sep 13 18:48:23 2010 (r212572) @@ -191,7 +191,8 @@ struct lock_prof_cpu *lp_cpu[MAXCPU]; volatile int lock_prof_enable = 0; static volatile int lock_prof_resetting; -#define LPROF_SBUF_SIZE 256 +/* SWAG: sbuf size = avg stat. line size * number of locks */ +#define LPROF_SBUF_SIZE 256 * 400 static int lock_prof_rejected; static int lock_prof_skipspin; @@ -383,6 +384,8 @@ lock_prof_type_stats(struct lock_prof_ty continue; lock_prof_sum(l, &lp, i, spin, t); lock_prof_output(&lp, sb); + if (sbuf_error(sb) != 0) + return; } } } @@ -390,11 +393,13 @@ lock_prof_type_stats(struct lock_prof_ty static int dump_lock_prof_stats(SYSCTL_HANDLER_ARGS) { + static int multiplier = 1; struct sbuf *sb; int error, cpu, t; int enabled; - sb = sbuf_new_for_sysctl(NULL, NULL, LPROF_SBUF_SIZE, req); +retry_sbufops: + sb = sbuf_new(NULL, NULL, LPROF_SBUF_SIZE * multiplier, SBUF_FIXEDLEN); sbuf_printf(sb, "\n%8s %9s %11s %11s %11s %6s %6s %2s %6s %s\n", "max", "wait_max", "total", "wait_total", "count", "avg", "wait_avg", "cnt_hold", "cnt_lock", "name"); enabled = lock_prof_enable; @@ -406,13 +411,16 @@ dump_lock_prof_stats(SYSCTL_HANDLER_ARGS continue; lock_prof_type_stats(&lp_cpu[cpu]->lpc_types[0], sb, 0, t); lock_prof_type_stats(&lp_cpu[cpu]->lpc_types[1], sb, 1, t); + if (sbuf_error(sb) != 0) { + sbuf_delete(sb); + multiplier++; + goto retry_sbufops; + } } lock_prof_enable = enabled; - error = sbuf_finish(sb); - /* Output a trailing NUL. */ - if (error == 0) - error = SYSCTL_OUT(req, "", 1); + sbuf_finish(sb); + error = SYSCTL_OUT(req, sbuf_data(sb), sbuf_len(sb) + 1); sbuf_delete(sb); return (error); } Modified: head/sys/kern/subr_sbuf.c ============================================================================== --- head/sys/kern/subr_sbuf.c Mon Sep 13 18:32:49 2010 (r212571) +++ head/sys/kern/subr_sbuf.c Mon Sep 13 18:48:23 2010 (r212572) @@ -303,8 +303,8 @@ sbuf_drain(struct sbuf *s) s->s_error = -len; return (s->s_error); } - KASSERT(len > 0 && len <= s->s_len, - ("Bad drain amount %d for sbuf %p", len, s)); + + KASSERT(len > 0, ("Drain must either error or work!")); s->s_len -= len; /* * Fast path for the expected case where all the data was Modified: head/sys/kern/subr_sleepqueue.c ============================================================================== --- head/sys/kern/subr_sleepqueue.c Mon Sep 13 18:32:49 2010 (r212571) +++ head/sys/kern/subr_sleepqueue.c Mon Sep 13 18:48:23 2010 (r212572) @@ -1018,7 +1018,7 @@ sleepq_abort(struct thread *td, int intr #ifdef SLEEPQUEUE_PROFILING #define SLEEPQ_PROF_LOCATIONS 1024 -#define SLEEPQ_SBUFSIZE 512 +#define SLEEPQ_SBUFSIZE (40 * 512) struct sleepq_prof { LIST_ENTRY(sleepq_prof) sp_link; const char *sp_wmesg; @@ -1123,13 +1123,15 @@ reset_sleepq_prof_stats(SYSCTL_HANDLER_A static int dump_sleepq_prof_stats(SYSCTL_HANDLER_ARGS) { + static int multiplier = 1; struct sleepq_prof *sp; struct sbuf *sb; int enabled; int error; int i; - sb = sbuf_new_for_sysctl(NULL, NULL, SLEEPQ_SBUFSIZE, req); +retry_sbufops: + sb = sbuf_new(NULL, NULL, SLEEPQ_SBUFSIZE * multiplier, SBUF_FIXEDLEN); sbuf_printf(sb, "\nwmesg\tcount\n"); enabled = prof_enabled; mtx_lock_spin(&sleepq_prof_lock); @@ -1139,13 +1141,19 @@ dump_sleepq_prof_stats(SYSCTL_HANDLER_AR LIST_FOREACH(sp, &sleepq_hash[i], sp_link) { sbuf_printf(sb, "%s\t%ld\n", sp->sp_wmesg, sp->sp_count); + if (sbuf_error(sb) != 0) { + sbuf_delete(sb); + multiplier++; + goto retry_sbufops; + } } } mtx_lock_spin(&sleepq_prof_lock); prof_enabled = enabled; mtx_unlock_spin(&sleepq_prof_lock); - error = sbuf_finish(sb); + sbuf_finish(sb); + error = SYSCTL_OUT(req, sbuf_data(sb), sbuf_len(sb) + 1); sbuf_delete(sb); return (error); } Modified: head/sys/kern/subr_witness.c ============================================================================== --- head/sys/kern/subr_witness.c Mon Sep 13 18:32:49 2010 (r212571) +++ head/sys/kern/subr_witness.c Mon Sep 13 18:48:23 2010 (r212572) @@ -154,7 +154,8 @@ __FBSDID("$FreeBSD$"); #define MAX_W_NAME 64 #define BADSTACK_SBUF_SIZE (256 * WITNESS_COUNT) -#define FULLGRAPH_SBUF_SIZE 512 +#define CYCLEGRAPH_SBUF_SIZE 8192 +#define FULLGRAPH_SBUF_SIZE 32768 /* * These flags go in the witness relationship matrix and describe the @@ -2544,7 +2545,7 @@ sysctl_debug_witness_fullgraph(SYSCTL_HA return (error); } error = 0; - sb = sbuf_new_for_sysctl(NULL, NULL, FULLGRAPH_SBUF_SIZE, req); + sb = sbuf_new(NULL, NULL, FULLGRAPH_SBUF_SIZE, SBUF_FIXEDLEN); if (sb == NULL) return (ENOMEM); sbuf_printf(sb, "\n"); @@ -2557,9 +2558,19 @@ sysctl_debug_witness_fullgraph(SYSCTL_HA mtx_unlock_spin(&w_mtx); /* + * While using SBUF_FIXEDLEN, check if the sbuf overflowed. + */ + if (sbuf_error(sb) != 0) { + sbuf_delete(sb); + panic("%s: sbuf overflowed, bump FULLGRAPH_SBUF_SIZE value\n", + __func__); + } + + /* * Close the sbuf and return to userland. */ - error = sbuf_finish(sb); + sbuf_finish(sb); + error = SYSCTL_OUT(req, sbuf_data(sb), sbuf_len(sb) + 1); sbuf_delete(sb); return (error); Modified: head/sys/sys/sysctl.h ============================================================================== --- head/sys/sys/sysctl.h Mon Sep 13 18:32:49 2010 (r212571) +++ head/sys/sys/sysctl.h Mon Sep 13 18:48:23 2010 (r212572) @@ -710,9 +710,6 @@ void sysctl_lock(void); void sysctl_unlock(void); int sysctl_wire_old_buffer(struct sysctl_req *req, size_t len); -struct sbuf; -struct sbuf *sbuf_new_for_sysctl(struct sbuf *, char *, int, - struct sysctl_req *); #else /* !_KERNEL */ #include Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Mon Sep 13 18:32:49 2010 (r212571) +++ head/sys/vm/uma_core.c Mon Sep 13 18:48:23 2010 (r212572) @@ -3175,16 +3175,36 @@ sysctl_vm_zone_stats(SYSCTL_HANDLER_ARGS uma_keg_t kz; uma_zone_t z; uma_keg_t k; - int count, error, i; + char *buffer; + int buflen, count, error, i; - sbuf_new_for_sysctl(&sbuf, NULL, 128, req); - - count = 0; mtx_lock(&uma_mtx); +restart: + mtx_assert(&uma_mtx, MA_OWNED); + count = 0; LIST_FOREACH(kz, &uma_kegs, uk_link) { LIST_FOREACH(z, &kz->uk_zones, uz_link) count++; } + mtx_unlock(&uma_mtx); + + buflen = sizeof(ush) + count * (sizeof(uth) + sizeof(ups) * + (mp_maxid + 1)) + 1; + buffer = malloc(buflen, M_TEMP, M_WAITOK | M_ZERO); + + mtx_lock(&uma_mtx); + i = 0; + LIST_FOREACH(kz, &uma_kegs, uk_link) { + LIST_FOREACH(z, &kz->uk_zones, uz_link) + i++; + } + if (i > count) { + free(buffer, M_TEMP); + goto restart; + } + count = i; + + sbuf_new(&sbuf, buffer, buflen, SBUF_FIXEDLEN); /* * Insert stream header. @@ -3193,7 +3213,11 @@ sysctl_vm_zone_stats(SYSCTL_HANDLER_ARGS ush.ush_version = UMA_STREAM_VERSION; ush.ush_maxcpus = (mp_maxid + 1); ush.ush_count = count; - (void)sbuf_bcat(&sbuf, &ush, sizeof(ush)); + if (sbuf_bcat(&sbuf, &ush, sizeof(ush)) < 0) { + mtx_unlock(&uma_mtx); + error = ENOMEM; + goto out; + } LIST_FOREACH(kz, &uma_kegs, uk_link) { LIST_FOREACH(z, &kz->uk_zones, uz_link) { @@ -3226,7 +3250,12 @@ sysctl_vm_zone_stats(SYSCTL_HANDLER_ARGS uth.uth_frees = z->uz_frees; uth.uth_fails = z->uz_fails; uth.uth_sleeps = z->uz_sleeps; - (void)sbuf_bcat(&sbuf, &uth, sizeof(uth)); + if (sbuf_bcat(&sbuf, &uth, sizeof(uth)) < 0) { + ZONE_UNLOCK(z); + mtx_unlock(&uma_mtx); + error = ENOMEM; + goto out; + } /* * While it is not normally safe to access the cache * bucket pointers while not on the CPU that owns the @@ -3251,14 +3280,21 @@ sysctl_vm_zone_stats(SYSCTL_HANDLER_ARGS ups.ups_allocs = cache->uc_allocs; ups.ups_frees = cache->uc_frees; skip: - (void)sbuf_bcat(&sbuf, &ups, sizeof(ups)); + if (sbuf_bcat(&sbuf, &ups, sizeof(ups)) < 0) { + ZONE_UNLOCK(z); + mtx_unlock(&uma_mtx); + error = ENOMEM; + goto out; + } } ZONE_UNLOCK(z); } } mtx_unlock(&uma_mtx); - error = sbuf_finish(&sbuf); - sbuf_delete(&sbuf); + sbuf_finish(&sbuf); + error = SYSCTL_OUT(req, sbuf_data(&sbuf), sbuf_len(&sbuf)); +out: + free(buffer, M_TEMP); return (error); } Modified: head/sys/vm/vm_phys.c ============================================================================== --- head/sys/vm/vm_phys.c Mon Sep 13 18:32:49 2010 (r212571) +++ head/sys/vm/vm_phys.c Mon Sep 13 18:48:23 2010 (r212572) @@ -123,9 +123,12 @@ sysctl_vm_phys_free(SYSCTL_HANDLER_ARGS) { struct sbuf sbuf; struct vm_freelist *fl; + char *cbuf; + const int cbufsize = vm_nfreelists*(VM_NFREEORDER + 1)*81; int error, flind, oind, pind; - sbuf_new_for_sysctl(&sbuf, NULL, 128, req); + cbuf = malloc(cbufsize, M_TEMP, M_WAITOK | M_ZERO); + sbuf_new(&sbuf, cbuf, cbufsize, SBUF_FIXEDLEN); for (flind = 0; flind < vm_nfreelists; flind++) { sbuf_printf(&sbuf, "\nFREE LIST %d:\n" "\n ORDER (SIZE) | NUMBER" @@ -146,8 +149,10 @@ sysctl_vm_phys_free(SYSCTL_HANDLER_ARGS) sbuf_printf(&sbuf, "\n"); } } - error = sbuf_finish(&sbuf); + sbuf_finish(&sbuf); + error = SYSCTL_OUT(req, sbuf_data(&sbuf), sbuf_len(&sbuf)); sbuf_delete(&sbuf); + free(cbuf, M_TEMP); return (error); } @@ -159,9 +164,12 @@ sysctl_vm_phys_segs(SYSCTL_HANDLER_ARGS) { struct sbuf sbuf; struct vm_phys_seg *seg; + char *cbuf; + const int cbufsize = VM_PHYSSEG_MAX*(VM_NFREEORDER + 1)*81; int error, segind; - sbuf_new_for_sysctl(&sbuf, NULL, 128, req); + cbuf = malloc(cbufsize, M_TEMP, M_WAITOK | M_ZERO); + sbuf_new(&sbuf, cbuf, cbufsize, SBUF_FIXEDLEN); for (segind = 0; segind < vm_phys_nsegs; segind++) { sbuf_printf(&sbuf, "\nSEGMENT %d:\n\n", segind); seg = &vm_phys_segs[segind]; @@ -172,8 +180,10 @@ sysctl_vm_phys_segs(SYSCTL_HANDLER_ARGS) sbuf_printf(&sbuf, "domain: %d\n", seg->domain); sbuf_printf(&sbuf, "free list: %p\n", seg->free_queues); } - error = sbuf_finish(&sbuf); + sbuf_finish(&sbuf); + error = SYSCTL_OUT(req, sbuf_data(&sbuf), sbuf_len(&sbuf)); sbuf_delete(&sbuf); + free(cbuf, M_TEMP); return (error); } @@ -185,18 +195,23 @@ static int sysctl_vm_phys_lookup_lists(SYSCTL_HANDLER_ARGS) { struct sbuf sbuf; + char *cbuf; + const int cbufsize = (vm_nfreelists + 1) * VM_NDOMAIN * 81; int domain, error, flind, ndomains; ndomains = vm_nfreelists - VM_NFREELIST + 1; - sbuf_new_for_sysctl(&sbuf, NULL, 128, req); + cbuf = malloc(cbufsize, M_TEMP, M_WAITOK | M_ZERO); + sbuf_new(&sbuf, cbuf, cbufsize, SBUF_FIXEDLEN); for (domain = 0; domain < ndomains; domain++) { sbuf_printf(&sbuf, "\nDOMAIN %d:\n\n", domain); for (flind = 0; flind < vm_nfreelists; flind++) sbuf_printf(&sbuf, " [%d]:\t%p\n", flind, vm_phys_lookup_lists[domain][flind]); } - error = sbuf_finish(&sbuf); + sbuf_finish(&sbuf); + error = SYSCTL_OUT(req, sbuf_data(&sbuf), sbuf_len(&sbuf)); sbuf_delete(&sbuf); + free(cbuf, M_TEMP); return (error); } #endif Modified: head/sys/vm/vm_reserv.c ============================================================================== --- head/sys/vm/vm_reserv.c Mon Sep 13 18:32:49 2010 (r212571) +++ head/sys/vm/vm_reserv.c Mon Sep 13 18:48:23 2010 (r212572) @@ -180,9 +180,12 @@ sysctl_vm_reserv_partpopq(SYSCTL_HANDLER { struct sbuf sbuf; vm_reserv_t rv; + char *cbuf; + const int cbufsize = (VM_NRESERVLEVEL + 1) * 81; int counter, error, level, unused_pages; - sbuf_new_for_sysctl(&sbuf, NULL, 128, req); + cbuf = malloc(cbufsize, M_TEMP, M_WAITOK | M_ZERO); + sbuf_new(&sbuf, cbuf, cbufsize, SBUF_FIXEDLEN); sbuf_printf(&sbuf, "\nLEVEL SIZE NUMBER\n\n"); for (level = -1; level <= VM_NRESERVLEVEL - 2; level++) { counter = 0; @@ -196,8 +199,10 @@ sysctl_vm_reserv_partpopq(SYSCTL_HANDLER sbuf_printf(&sbuf, "%5.5d: %6.6dK, %6.6d\n", level, unused_pages * (PAGE_SIZE / 1024), counter); } - error = sbuf_finish(&sbuf); + sbuf_finish(&sbuf); + error = SYSCTL_OUT(req, sbuf_data(&sbuf), sbuf_len(&sbuf)); sbuf_delete(&sbuf); + free(cbuf, M_TEMP); return (error); } From owner-svn-src-head@FreeBSD.ORG Mon Sep 13 19:12:54 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8B1CB106567A; Mon, 13 Sep 2010 19:12:54 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id A512A8FC1C; Mon, 13 Sep 2010 19:12:53 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id o8DJClPn028197 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 13 Sep 2010 22:12:47 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id o8DJClTQ084253; Mon, 13 Sep 2010 22:12:47 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id o8DJClHE084252; Mon, 13 Sep 2010 22:12:47 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 13 Sep 2010 22:12:47 +0300 From: Kostik Belousov To: Alan Cox Message-ID: <20100913191247.GN2465@deviant.kiev.zoral.com.ua> References: <201009070023.o870Njtg072607@svn.freebsd.org> <20100907080446.GA2853@deviant.kiev.zoral.com.ua> <4C8E5FB5.9070009@rice.edu> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="vRCs+Tj6pwiFrQdW" Content-Disposition: inline In-Reply-To: <4C8E5FB5.9070009@rice.edu> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-2.1 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_50, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, Ryan Stone , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r212281 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2010 19:12:54 -0000 --vRCs+Tj6pwiFrQdW Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Sep 13, 2010 at 12:30:29PM -0500, Alan Cox wrote: > Kostik Belousov wrote: > >On Tue, Sep 07, 2010 at 12:23:45AM +0000, Ryan Stone wrote: > > =20 > >>Author: rstone > >>Date: Tue Sep 7 00:23:45 2010 > >>New Revision: 212281 > >>URL: http://svn.freebsd.org/changeset/base/212281 > >> > >>Log: > >> In munmap() downgrade the vm_map_lock to a read lock before taking a= =20 > >> read > >> lock on the pmc-sx lock. This prevents a deadlock with > >> pmc_log_process_mappings, which has an exclusive lock on pmc-sx and= =20 > >> tries > >> to get a read lock on a vm_map. Downgrading the vm_map_lock in munmap > >> allows pmc_log_process_mappings to continue, preventing the deadlock. > >> =20 > >> Without this change I could cause a deadlock on a multicore 8.1-RELEA= SE > >> system by having one thread constantly mmap'ing and then munmap'ing a > >> PROT_EXEC mapping in a loop while I repeatedly invoked and stopped=20 > >> pmcstat > >> in system-wide sampling mode. > >> =20 > >> Reviewed by: fabient > >> Approved by: emaste (mentor) > >> MFC after: 2 weeks > >> > >>Modified: > >> head/sys/vm/vm_mmap.c > >> > >>Modified: head/sys/vm/vm_mmap.c > >>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > >>--- head/sys/vm/vm_mmap.c Mon Sep 6 23:52:04 2010 (r212280) > >>+++ head/sys/vm/vm_mmap.c Tue Sep 7 00:23:45 2010 (r212281) > >>@@ -579,6 +579,7 @@ munmap(td, uap) > >> * Inform hwpmc if the address range being unmapped contains > >> * an executable region. > >> */ > >>+ pkm.pm_address =3D (uintptr_t) NULL; > >> if (vm_map_lookup_entry(map, addr, &entry)) { > >> for (; > >> entry !=3D &map->header && entry->start < addr + size; > >>@@ -587,16 +588,23 @@ munmap(td, uap) > >> entry->end, VM_PROT_EXECUTE) =3D=3D TRUE) { > >> pkm.pm_address =3D (uintptr_t) addr; > >> pkm.pm_size =3D (size_t) size; > >>- PMC_CALL_HOOK(td, PMC_FN_MUNMAP, > >>- (void *) &pkm); > >> break; > >> } > >> } > >> } > >> #endif > >>- /* returns nothing but KERN_SUCCESS anyway */ > >> vm_map_delete(map, addr, addr + size); > >>+ > >>+#ifdef HWPMC_HOOKS > >>+ /* downgrade the lock to prevent a LOR with the pmc-sx lock */ > >>+ vm_map_lock_downgrade(map); > >>+ if (pkm.pm_address !=3D (uintptr) NULL) > >>+ PMC_CALL_HOOK(td, PMC_FN_MUNMAP, (void *) &pkm); > >>+ vm_map_unlock_read(map); > >>+#else > >> vm_map_unlock(map); > >>+#endif > >>+ /* vm_map_delete returns nothing but KERN_SUCCESS anyway */ > >> return (0); > >> } > >>=20 > >> =20 > >Note that vm_map_unlock() is more then just dropping the lock on the map. > >Due to ordering of the vnode lock before vm map lock, vm_map_unlock() > >processes the deferred free entries after map lock is dropped. After your > >change, the deferred list might keep entries for some time until next > >unlock is performed. > > > > =20 >=20 > I'm afraid that this understates the effect. Over the weekend, when I=20 > updated one of my amd64 machines to include this change, I found that=20 > the delay in object and page deallocation is leading to severe=20 > fragmentation within the physical memory allocator. As a result, the=20 > time spent in the kernel during a "buildworld" increased by about 8%. =20 > Moreover, superpage promotion by applications effectively stopped. >=20 > For now, I think it would be best to back out r212281 and r212282. =20 > Ultimately, the fix may be to change the vm map synchronization=20 > primitives, and simply reinstate r212281 and r212282, but I'd like some= =20 > time to consider the options. Did you noted the thread on current@ about r212281 ? The submitter claims that the rev. causes panics in unrelated code pathes when vnode_create_vobject() locks vm object lock. I cannot understand how this can happen, with or without the rev. More, when I suggested the following change, that is intended to minimize the window, the answer was that it makes the situation worse. diff --git a/sys/vm/vm_mmap.c b/sys/vm/vm_mmap.c index 63dfb67..d13e488 100644 --- a/sys/vm/vm_mmap.c +++ b/sys/vm/vm_mmap.c @@ -597,13 +597,15 @@ munmap(td, uap) =20 #ifdef HWPMC_HOOKS /* downgrade the lock to prevent a LOR with the pmc-sx lock */ - vm_map_lock_downgrade(map); - if (pkm.pm_address !=3D (uintptr_t) NULL) - PMC_CALL_HOOK(td, PMC_FN_MUNMAP, (void *) &pkm); - vm_map_unlock_read(map); -#else - vm_map_unlock(map); + if (pkm.pm_address !=3D (uintptr_t)NULL) { + vm_map_lock_downgrade(map); + if (pkm.pm_address !=3D (uintptr_t)NULL) + PMC_CALL_HOOK(td, PMC_FN_MUNMAP, (void *)&pkm); + vm_map_unlock_read(map); + vm_map_lock(map); + } #endif + vm_map_unlock(map); /* vm_map_delete returns nothing but KERN_SUCCESS anyway */ return (0); } --vRCs+Tj6pwiFrQdW Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkyOd68ACgkQC3+MBN1Mb4h4YACg5VBzgUZtyKq6f5N0W1fl4pik YpoAoOCtlCJjs5Lq+dkjEHegFUvZwEXl =wtoz -----END PGP SIGNATURE----- --vRCs+Tj6pwiFrQdW-- From owner-svn-src-head@FreeBSD.ORG Mon Sep 13 19:24:26 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DFF27106566C; Mon, 13 Sep 2010 19:24:26 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id B1A898FC0C; Mon, 13 Sep 2010 19:24:26 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 613C046B5C; Mon, 13 Sep 2010 15:24:26 -0400 (EDT) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 7B9AA8A03C; Mon, 13 Sep 2010 15:24:25 -0400 (EDT) From: John Baldwin To: Matthew D Fleming Date: Mon, 13 Sep 2010 15:18:38 -0400 User-Agent: KMail/1.13.5 (FreeBSD/7.3-CBSD-20100819; KDE/4.4.5; amd64; ; ) References: <201009131848.o8DImNU6024992@svn.freebsd.org> In-Reply-To: <201009131848.o8DImNU6024992@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201009131518.38829.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Mon, 13 Sep 2010 15:24:25 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=4.2 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r212572 - in head/sys: dev/cxgb kern sys vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2010 19:24:27 -0000 On Monday, September 13, 2010 2:48:23 pm Matthew D Fleming wrote: > Author: mdf > Date: Mon Sep 13 18:48:23 2010 > New Revision: 212572 > URL: http://svn.freebsd.org/changeset/base/212572 > > Log: > Revert r212370, as it causes a LOR on powerpc. powerpc does a few > unexpected things in copyout(9) and so wiring the user buffer is not > sufficient to perform a copyout(9) while holding a random mutex. > > Requested by: nwhitehorn Hmmm, that is going to break several other sysctls as well then. Many sysctls use sysctl_wire_old_buffer() explicitly so that they can then call SYSCTL_OUT() without dropping a lock. The pcblist sysctls do this for example I think. In general code in the kernel assumes that copyout(9) to/from a wired buffer is safe while holding mutexes or rwlocks. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Sep 13 19:32:19 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BABE4106564A; Mon, 13 Sep 2010 19:32:19 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from argol.doit.wisc.edu (argol.doit.wisc.edu [144.92.197.212]) by mx1.freebsd.org (Postfix) with ESMTP id 8ABFB8FC14; Mon, 13 Sep 2010 19:32:19 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII Received: from avs-daemon.smtpauth3.wiscmail.wisc.edu by smtpauth3.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) id <0L8P00506A9U3O00@smtpauth3.wiscmail.wisc.edu>; Mon, 13 Sep 2010 14:32:19 -0500 (CDT) Received: from anacreon.physics.wisc.edu (anacreon.physics.wisc.edu [128.104.160.176]) by smtpauth3.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) with ESMTPSA id <0L8P000PCA9QQ560@smtpauth3.wiscmail.wisc.edu>; Mon, 13 Sep 2010 14:32:14 -0500 (CDT) Date: Mon, 13 Sep 2010 14:32:13 -0500 From: Nathan Whitehorn In-reply-to: <201009131518.38829.jhb@freebsd.org> To: John Baldwin Message-id: <20100913143213.420ec5c6@anacreon.physics.wisc.edu> X-Mailer: Claws Mail 3.7.6 (GTK+ 2.20.1; powerpc64-portbld-freebsd9.0) X-Spam-Report: AuthenticatedSender=yes, SenderIP=128.104.160.176 X-Spam-PmxInfo: Server=avs-14, Version=5.6.0.2009776, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2010.9.13.192414, SenderIP=128.104.160.176 References: <201009131848.o8DImNU6024992@svn.freebsd.org> <201009131518.38829.jhb@freebsd.org> Cc: svn-src-head@freebsd.org, Matthew D Fleming , svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r212572 - in head/sys: dev/cxgb kern sys vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2010 19:32:19 -0000 On Mon, 13 Sep 2010 15:18:38 -0400 John Baldwin wrote: > On Monday, September 13, 2010 2:48:23 pm Matthew D Fleming wrote: > > Author: mdf > > Date: Mon Sep 13 18:48:23 2010 > > New Revision: 212572 > > URL: http://svn.freebsd.org/changeset/base/212572 > > > > Log: > > Revert r212370, as it causes a LOR on powerpc. powerpc does a few > > unexpected things in copyout(9) and so wiring the user buffer is > > not sufficient to perform a copyout(9) while holding a random mutex. > > > > Requested by: nwhitehorn > > Hmmm, that is going to break several other sysctls as well then. > Many sysctls use sysctl_wire_old_buffer() explicitly so that they can > then call SYSCTL_OUT() without dropping a lock. The pcblist sysctls > do this for example I think. In general code in the kernel assumes > that copyout(9) to/from a wired buffer is safe while holding mutexes > or rwlocks. > Yes. The issue here is that powerpc64 copyin/out() needs to acquire the PMAP lock, so holding normal mutexes is fine, but calling into copyout() with non-sleepable locks like this code did is not. Matthew and I are working on a better solution that fixes this on the powerpc copyout() side, but it is tricky for a variety of reasons and will take a little while. In the meantime, this keeps powerpc64 systems bootable. -Nathan From owner-svn-src-head@FreeBSD.ORG Mon Sep 13 19:47:09 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 91B2A106566C; Mon, 13 Sep 2010 19:47:09 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 80BDA8FC22; Mon, 13 Sep 2010 19:47:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8DJl96w028099; Mon, 13 Sep 2010 19:47:09 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8DJl98t028097; Mon, 13 Sep 2010 19:47:09 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201009131947.o8DJl98t028097@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Mon, 13 Sep 2010 19:47:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212573 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2010 19:47:09 -0000 Author: pjd Date: Mon Sep 13 19:47:09 2010 New Revision: 212573 URL: http://svn.freebsd.org/changeset/base/212573 Log: Remove the page queues lock around vm_page_undirty() - it is no longer needed. Reviewed by: alc Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon Sep 13 18:48:23 2010 (r212572) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon Sep 13 19:47:09 2010 (r212573) @@ -326,9 +326,7 @@ page_lookup(vnode_t *vp, int64_t start, if (vm_page_sleep_if_busy(pp, FALSE, "zfsmwb")) continue; vm_page_busy(pp); - vm_page_lock_queues(); vm_page_undirty(pp); - vm_page_unlock_queues(); } else { if (__predict_false(obj->cache != NULL)) { vm_page_cache_free(obj, OFF_TO_IDX(start), From owner-svn-src-head@FreeBSD.ORG Mon Sep 13 19:51:15 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F40E1065696; Mon, 13 Sep 2010 19:51:15 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6DBE58FC27; Mon, 13 Sep 2010 19:51:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8DJpFCI028325; Mon, 13 Sep 2010 19:51:15 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8DJpFLh028318; Mon, 13 Sep 2010 19:51:15 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201009131951.o8DJpFLh028318@svn.freebsd.org> From: Hiroki Sato Date: Mon, 13 Sep 2010 19:51:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212574 - in head: etc etc/defaults etc/rc.d share/man/man5 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2010 19:51:15 -0000 Author: hrs Date: Mon Sep 13 19:51:15 2010 New Revision: 212574 URL: http://svn.freebsd.org/changeset/base/212574 Log: Revert changes in r206408. Discussed with: dougb, core.5, and core.6 Modified: head/etc/defaults/rc.conf head/etc/network.subr head/etc/rc.d/ip6addrctl head/etc/rc.d/netif head/etc/rc.d/netoptions head/share/man/man5/rc.conf.5 Modified: head/etc/defaults/rc.conf ============================================================================== --- head/etc/defaults/rc.conf Mon Sep 13 19:47:09 2010 (r212573) +++ head/etc/defaults/rc.conf Mon Sep 13 19:51:15 2010 (r212574) @@ -210,8 +210,6 @@ cloned_interfaces="" # List of cloned n ifconfig_lo0="inet 127.0.0.1" # default loopback device configuration. #ifconfig_lo0_alias0="inet 127.0.0.254 netmask 0xffffffff" # Sample alias entry. #ifconfig_ed0_ipx="ipx 0x00010010" # Sample IPX address family entry. -#ifconfig_ed0_ipv6="RTADV" # Sample IPv6 entry for RA/rtsol(8) -#ifconfig_ed0_ipv6="inet6 auto_linklocal" # To configure only link-local #ifconfig_ed0_ipv6="inet6 2001:db8:1::1 prefixlen 64" # Sample IPv6 addr entry #ifconfig_ed0_alias0="inet6 2001:db8:2::1 prefixlen 64" # Sample IPv6 alias #ifconfig_fxp0_name="net0" # Change interface name from fxp0 to net0. @@ -446,9 +444,8 @@ ubthidhci_enable="NO" # Switch an USB B icmp_bmcastecho="NO" # respond to broadcast ping packets ### IPv6 options: ### -ipv6_network_interfaces="AUTO" # List of IPv6 network interfaces -ipv6_prefer="YES" # Use IPv6 when both IPv4 and IPv6 can be used -ipv6_privacy="NO" # Use privacy addresses with RTADV (RFC 4193) +ipv6_network_interfaces="none" # List of IPv6 network interfaces + # (or "auto" or "none"). ipv6_defaultrouter="NO" # Set to IPv6 default gateway (or NO). #ipv6_defaultrouter="2002:c058:6301::" # Use this for 6to4 (RFC 3068) ipv6_static_routes="" # Set to static route list (or leave empty). @@ -507,6 +504,7 @@ ipv6_ipfilter_rules="/etc/ipf6.rules" # # for examples ip6addrctl_enable="YES" # Set to YES to enable default address selection ip6addrctl_verbose="NO" # Set to YES to enable verbose configuration messages +ipv6_prefer="NO" # Use IPv6 when both IPv4 and IPv6 can be used ############################################################## ### System console options ################################# Modified: head/etc/network.subr ============================================================================== --- head/etc/network.subr Mon Sep 13 19:47:09 2010 (r212573) +++ head/etc/network.subr Mon Sep 13 19:51:15 2010 (r212574) @@ -96,32 +96,44 @@ ifconfig_up() # inet6 specific if afexists inet6; then if ipv6if $1; then - # Implicitly handles ipv6_gateway_enable - _ipv6_opts='-ifdisabled -accept_rtadv' - - if ipv6_autoconfif $1; then - _ipv6_opts='-ifdisabled accept_rtadv' - fi - - ifconfig $1 inet6 $_ipv6_opts - - # ifconfig_IF_ipv6 - ifconfig_args=`ifconfig_getargs $1 ipv6` - - if [ -n "$ifconfig_args" ]; then - ifconfig $1 $ifconfig_args - _cfg=0 + if checkyesno ipv6_gateway_enable; then + _ipv6_opts="-accept_rtadv" fi else - # Remove in FreeBSD 10.x - # Explicit test is necessary here to avoid nonexistence error - case "$ipv6_enable" in - [Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1) - warn "Interface $1 will NOT be configured for IPv6" + if checkyesno ipv6_prefer; then + _ipv6_opts="-ifdisabled" + else + _ipv6_opts="ifdisabled" + fi + + # backward compatibility: $ipv6_enable + case $ipv6_enable in + [Yy][Ee][Ss]) + _ipv6_opts="${_ipv6_opts} accept_rtadv" ;; esac + fi - ifconfig $1 inet6 ifdisabled + if [ -n "${_ipv6_opts}" ]; then + ifconfig $1 inet6 ${_ipv6_opts} + fi + + # ifconfig_IF_ipv6 + ifconfig_args=`ifconfig_getargs $1 ipv6` + if [ -n "${ifconfig_args}" ]; then + ifconfig $1 inet6 -ifdisabled + ifconfig $1 ${ifconfig_args} + _cfg=0 + fi + + # backward compatiblity: $ipv6_ifconfig_IF + ifconfig_args=`get_if_var $1 ipv6_ifconfig_IF` + if [ -n "${ifconfig_args}" ]; then + warn "\$ipv6_ifconfig_$1 is obsolete." \ + " Use ifconfig_$1_ipv6 instead." + ifconfig $1 inet6 -ifdisabled + ifconfig $1 inet6 ${ifconfig_args} + _cfg=0 fi fi @@ -182,7 +194,7 @@ ifconfig_down() # $default if given. get_if_var() { - local _if _punct _punct_c _var _default prefix suffix + local _if _punct _var _default prefix suffix if [ $# -ne 2 -a $# -ne 3 ]; then err 3 'USAGE: get_if_var name var [default]' @@ -207,7 +219,7 @@ get_if_var() # outside this file. _ifconfig_getargs() { - local _ifn _af value + local _ifn _af _ifn=$1 _af=${2+_$2} @@ -215,18 +227,7 @@ _ifconfig_getargs() return 1 fi - value=`get_if_var $_ifn ifconfig_IF$_af "$ifconfig_DEFAULT"` - - # Remove in FreeBSD 10.x - if [ "$_af" = _ipv6 -a -z "$value" ]; then - value=`get_if_var $_ifn ipv6_ifconfig_IF "$ifconfig_DEFAULT"` - if [ -n "$value" ]; then - warn "\$ipv6_ifconfig_$1 is obsolete." \ - " Use ifconfig_$1_ipv6 instead." - fi - fi - - echo $value + get_if_var $_ifn ifconfig_IF$_af "$ifconfig_DEFAULT" } # ifconfig_getargs if [af] @@ -248,8 +249,6 @@ ifconfig_getargs() [Nn][Oo][Ss][Yy][Nn][Cc][Dd][Hh][Cc][Pp]) ;; [Ss][Yy][Nn][Cc][Dd][Hh][Cc][Pp]) ;; [Ww][Pp][Aa]) ;; - [Rr][Tt][Aa][Dd][Vv]) ;; - [Nn][Oo][Rr][Tt][Aa][Dd][Vv]) ;; *) _args="$_args $_arg" ;; @@ -373,47 +372,77 @@ afexists() esac } +# noafif if +# Returns 0 if the interface has no af configuration and 1 otherwise. +noafif() +{ + local _if + _if=$1 + + case $_if in + pflog[0-9]*|\ + pfsync[0-9]*|\ + an[0-9]*|\ + ath[0-9]*|\ + ipw[0-9]*|\ + iwi[0-9]*|\ + iwn[0-9]*|\ + ral[0-9]*|\ + wi[0-9]*|\ + wl[0-9]*|\ + wpi[0-9]*) + return 0 + ;; + esac + + return 1 +} + # ipv6if if # Returns 0 if the interface should be configured for IPv6 and # 1 otherwise. ipv6if() { + local _if _tmpargs i + _if=$1 + if ! afexists inet6; then return 1 fi # lo0 is always IPv6-enabled - case $1 in + case $_if in lo0) return 0 ;; esac - local _if _tmpargs i - _if=$1 + # True if $ifconfig_IF_ipv6 is defined. + _tmpargs=`_ifconfig_getargs $_if ipv6` + if [ -n "${_tmpargs}" ]; then + return 0 + fi + + # backward compatibility: True if $ipv6_ifconfig_IF is defined. + _tmpargs=`get_if_var $_if ipv6_ifconfig_IF` + if [ -n "${_tmpargs}" ]; then + return 0 + fi - case "$ipv6_network_interfaces" in + case "${ipv6_network_interfaces}" in + [Aa][Uu][Tt][Oo]) + return 0 + ;; ''|[Nn][Oo][Nn][Ee]) return 1 ;; - $_if|"$_if "*|*" $_if"|*" $_if "*|[Aa][Uu][Tt][Oo]) - # True if $ifconfig_IF_ipv6 is defined. - _tmpargs=`_ifconfig_getargs $_if ipv6` - # Also true if ipv6_prefix_IF is defined - [ -n "$_tmpargs" ] || _tmpargs=`get_if_var $_if ipv6_prefix_IF` - ;; esac - if [ -n "$_tmpargs" ]; then - # Remove in FreeBSD 10.x - # Explicit test is necessary here to avoid nonexistence error - case "$ipv6_enable" in - [Nn][Oo]|[Ff][Aa][Ll][Ss][Ee]|[Oo][Ff][Ff]|0) - ;; - *) return 0 - ;; - esac - fi + for i in ${ipv6_network_interfaces}; do + if [ "$i" = "$_if" ]; then + return 0 + fi + done return 1 } @@ -423,24 +452,15 @@ ipv6if() # Stateless Address Configuration, 1 otherwise. ipv6_autoconfif() { - case $1 in - lo0|\ - stf[0-9]*|\ - faith[0-9]*|\ - lp[0-9]*|\ - sl[0-9]*|\ - pflog[0-9]*|\ - pfsync[0-9]*) - return 1 - ;; - esac - local _if _tmpargs _arg _if=$1 if ! ipv6if $_if; then return 1 fi + if noafif $_if; then + return 1 + fi if checkyesno ipv6_gateway_enable; then return 1 fi @@ -448,24 +468,45 @@ ipv6_autoconfif() if [ -n "${_tmpargs}" ]; then return 1 fi - if ! is_wired_interface $_if; then - case $_if in - wlan[0-9]*) ;; # Allow test to continue - *) return 1 - ;; - esac - fi - _tmpargs=`_ifconfig_getargs $_if ipv6` - case "$_tmpargs" in - *inet6\ *|*[Nn][Oo][Rr][Tt][Aa][Dd][Vv]*|*-accept_rtadv*) + case $_if in + lo0|\ + stf[0-9]*|\ + faith[0-9]*|\ + lp[0-9]*|\ + sl[0-9]*|\ + pflog[0-9]*|\ + pfsync[0-9]*) return 1 ;; - *[Rr][Tt][Aa][Dd][Vv]*|*accept_rtadv*) + esac + + # backward compatibility: $ipv6_enable + case $ipv6_enable in + [Yy][Ee][Ss]) return 0 ;; esac + _tmpargs=`_ifconfig_getargs $_if ipv6` + for _arg in $_tmpargs; do + case $_arg in + accept_rtadv) + return 0 + ;; + esac + done + + # backward compatibility: $ipv6_ifconfig_IF + _tmpargs=`get_if_var $_if ipv6_ifconfig_IF` + for _arg in $_tmpargs; do + case $_arg in + accept_rtadv) + return 0 + ;; + esac + done + return 1 } @@ -478,7 +519,7 @@ ifexists() } # ipv4_up if -# add IPv4 addresses to the interface $if +# add IPv4 addresses to the interface $if ipv4_up() { local _if _ret @@ -588,14 +629,14 @@ ipv6_down() ipv4_addrs_common() { local _ret _if _action _cidr _cidr_addr - local _ipaddr _netmask _range _ipnet _iplow _iphigh _ipcount + local _ipaddr _netmask _range _ipnet _iplow _iphigh _ipcount _ret=1 _if=$1 _action=$2 - + # get ipv4-addresses cidr_addr=`get_if_var $_if ipv4_addrs_IF` - + for _cidr in ${cidr_addr}; do _ipaddr=${_cidr%%/*} _netmask="/"${_cidr##*/} @@ -608,7 +649,7 @@ ipv4_addrs_common() if [ "${_action}" = "-alias" ]; then _netmask="" fi - + _ipcount=${_iplow} while [ "${_ipcount}" -le "${_iphigh}" ]; do eval "ifconfig ${_if} ${_action} ${_ipnet}.${_ipcount}${_netmask}" Modified: head/etc/rc.d/ip6addrctl ============================================================================== --- head/etc/rc.d/ip6addrctl Mon Sep 13 19:47:09 2010 (r212573) +++ head/etc/rc.d/ip6addrctl Mon Sep 13 19:51:15 2010 (r212574) @@ -20,6 +20,8 @@ status_cmd="ip6addrctl" prefer_ipv6_cmd="ip6addrctl_prefer_ipv6" prefer_ipv4_cmd="ip6addrctl_prefer_ipv4" +set_rcvar_obsolete ipv6_enable ipv6_prefer + ip6addrctl_prefer_ipv6() { afexists inet6 || return 0 Modified: head/etc/rc.d/netif ============================================================================== --- head/etc/rc.d/netif Mon Sep 13 19:47:09 2010 (r212573) +++ head/etc/rc.d/netif Mon Sep 13 19:51:15 2010 (r212574) @@ -34,7 +34,6 @@ . /etc/network.subr name="network" -start_precmd="network_prestart" start_cmd="network_start" stop_cmd="network_stop" cloneup_cmd="clone_up" @@ -42,13 +41,7 @@ clonedown_cmd="clone_down" extra_commands="cloneup clonedown" cmdifn= -network_prestart() -{ - if [ -n "$ipv6_enable" ]; then - warn 'The ipv6_enable option is deprecated.' - warn 'See rc.conf(5) for information on disabling IPv6.' - fi -} +set_rcvar_obsolete ipv6_enable ipv6_prefer network_start() { Modified: head/etc/rc.d/netoptions ============================================================================== --- head/etc/rc.d/netoptions Mon Sep 13 19:47:09 2010 (r212573) +++ head/etc/rc.d/netoptions Mon Sep 13 19:51:15 2010 (r212574) @@ -99,13 +99,6 @@ netoptions_inet6() else ${SYSCTL_W} net.inet6.ip6.v6only=1 >/dev/null fi - - if checkyesno ipv6_privacy; then - netoptions_init - echo -n " IPv6 Privacy Addresses" - ${SYSCTL_W} net.inet6.ip6.use_tempaddr=1 >/dev/null - ${SYSCTL_W} net.inet6.ip6.prefer_tempaddr=1 >/dev/null - fi } load_rc_config $name Modified: head/share/man/man5/rc.conf.5 ============================================================================== --- head/share/man/man5/rc.conf.5 Mon Sep 13 19:47:09 2010 (r212573) +++ head/share/man/man5/rc.conf.5 Mon Sep 13 19:51:15 2010 (r212574) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 4, 2010 +.Dd September 13, 2010 .Dt RC.CONF 5 .Os .Sh NAME @@ -1261,86 +1261,26 @@ It is also possible to rename an interfa ifconfig_ed0_name="net0" ifconfig_net0="inet 192.0.2.1 netmask 0xffffff00" .Ed -.\" Remove in FreeBSD 10.x .It Va ipv6_enable .Pq Vt bool -.Pp -This option is deprecated. -.Pp -If the variable is -.Dq Li YES -it has no effect. -To configure IPv6 for an interface see -.Va ipv6_network_interfaces -below. -.Pp If the variable is -.Dq Li NO -then other than -.Dq Li lo0 -IPv6 will be disabled for each interface, -however the same effect can be achieved by -not configuring the interface. -.It Va ipv6_network_interfaces -.Pq Vt str -This is the IPv6 equivalent of -.Va network_interfaces . -Normally configuration of this variable is not needed, -the value should be left as -.Dq Li AUTO . -.Pp -If -.Dq Li INET6 -is configured in the kernel configuration for the -.Dq Li lo0 -interface will always be performed. -It is not necessary to list it in -.Va ipv6_network_interfaces . -.Pp -Example configuration to accept Router Advertisements (RA) for the -.Dq Li ed0 -interface: -.Bd -literal -ifconfig_ed0_ipv6="RTADV" -.Ed -.Pp -To configure only a link-local address on the -.Dq Li ed0 -interface: -.Bd -literal -ifconfig_ed0_ipv6="inet6 auto_linklocal" -.Ed -.Pp -To disable RA the -.Dq Li NORTADV -option is available, although not required if manual -configuration is performed as described below. +.Dq Li YES , +.Dq Li inet6 accept_rtadv +is added to all of +.Va ifconfig_ Ns Ao Ar interface Ac Ns _ipv6 +and the +.Va ipv6_prefer +is defined as +.Dq Li YES . .Pp -An IPv6 interface can be configured manually with +This variable is deprecated. Use +.Va ipv6_prefer +and .Va ifconfig_ Ns Ao Ar interface Ac Ns _ipv6 . -For example: -.Bd -literal -ifconfig_ed0_ipv6="inet6 2001:db8:1::1 prefixlen 64" -.Ed -.Pp -Manual configuration of an IPv6 address will also -require configuration of the -.Va ipv6_defaultrouter -option. -.Pp -Aliases should be set by -.Va ifconfig_ Ns Ao Ar interface Ac Ns Va _alias Ns Aq Ar n -with the -.Dq Li inet6 -keyword. -For example: -.Pp -.Bd -literal -ifconfig_ed0_alias0="inet6 2001:db8:2::1 prefixlen 64" -.Ed -.Pp .It Va ipv6_prefer .Pq Vt bool +This variable does the following: +.Pp If the variable is .Dq Li YES , the default policy of the source address selection set by @@ -1351,15 +1291,49 @@ If the variable is .Dq Li NO , the default policy of the source address selection set by .Xr ip6addrctl 8 -will be IPv4-preferred. +will be IPv4-preferred, and all of interfaces which does not have the +corrsponding +.Va ifconfig_ Ns Ao Ar interface Ac Ns _ipv6 +variable will be marked as +.Dq Li IFDISABLED . +This means only IPv6 functionality on that interface is completely +disabled. For more details of +.Dq Li IFDISABLED +flag and keywords +.Dq Li inet6 ifdisabled , +see +.Xr ifconfig 8 . .Pp -.It Va ipv6_privacy -.Pq Vt bool -If the variable is -.Dq Li YES -privacy addresses will be generated for each IPv6 -interface as described in RFC 4193. +.It Va ipv6_network_interfaces +.Pq Vt str +This is the IPv6 equivalent of +.Va network_interfaces . +Normally manual configuration of this variable is not needed. .Pp +IPv6 functionality on an interface should be configured by +.Va ifconfig_ Ns Ao Ar interface Ac Ns _ipv6 , +instead of setting ifconfig parameters in +.Va ifconfig_ Ns Aq Ar interface . +Aliases should be set by +.Va ifconfig_ Ns Ao Ar interface Ac Ns Va _alias Ns Aq Ar n +with +.Dq Li inet6 +keyword. For example: +.Bd -literal +ifconfig_ed0_ipv6="inet6 2001:db8:1::1 prefixlen 64" +ifconfig_ed0_alias0="inet6 2001:db8:2::1 prefixlen 64" +.Ed +.Pp +Interfaces that have an +.Dq Li inet6 accept_rtadv +keyword in +.Va ifconfig_ Ns Ao Ar interface Ac Ns _ipv6 +setting will be automatically configured by +.Xr rtsol 8 . +Note that this automatic configuration is disabled if the +.Va ipv6_gateway_enable +is set to +.Dq Li YES . .It Va ipv6_prefix_ Ns Aq Ar interface .Pq Vt str If one or more prefixes are defined in From owner-svn-src-head@FreeBSD.ORG Mon Sep 13 19:52:04 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 861191065693; Mon, 13 Sep 2010 19:52:04 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5B4448FC0A; Mon, 13 Sep 2010 19:52:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8DJq4UA028400; Mon, 13 Sep 2010 19:52:04 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8DJq4JA028397; Mon, 13 Sep 2010 19:52:04 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201009131952.o8DJq4JA028397@svn.freebsd.org> From: Hiroki Sato Date: Mon, 13 Sep 2010 19:52:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212575 - in head/etc: . defaults X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2010 19:52:04 -0000 Author: hrs Date: Mon Sep 13 19:52:04 2010 New Revision: 212575 URL: http://svn.freebsd.org/changeset/base/212575 Log: Fix $ipv6_network_interfaces and set it as AUTO by default. Based on: changes in r206408 by dougb Modified: head/etc/defaults/rc.conf head/etc/network.subr Modified: head/etc/defaults/rc.conf ============================================================================== --- head/etc/defaults/rc.conf Mon Sep 13 19:51:15 2010 (r212574) +++ head/etc/defaults/rc.conf Mon Sep 13 19:52:04 2010 (r212575) @@ -444,7 +444,7 @@ ubthidhci_enable="NO" # Switch an USB B icmp_bmcastecho="NO" # respond to broadcast ping packets ### IPv6 options: ### -ipv6_network_interfaces="none" # List of IPv6 network interfaces +ipv6_network_interfaces="auto" # List of IPv6 network interfaces # (or "auto" or "none"). ipv6_defaultrouter="NO" # Set to IPv6 default gateway (or NO). #ipv6_defaultrouter="2002:c058:6301::" # Use this for 6to4 (RFC 3068) Modified: head/etc/network.subr ============================================================================== --- head/etc/network.subr Mon Sep 13 19:51:15 2010 (r212574) +++ head/etc/network.subr Mon Sep 13 19:52:04 2010 (r212575) @@ -417,32 +417,21 @@ ipv6if() ;; esac - # True if $ifconfig_IF_ipv6 is defined. - _tmpargs=`_ifconfig_getargs $_if ipv6` - if [ -n "${_tmpargs}" ]; then - return 0 - fi - - # backward compatibility: True if $ipv6_ifconfig_IF is defined. - _tmpargs=`get_if_var $_if ipv6_ifconfig_IF` - if [ -n "${_tmpargs}" ]; then - return 0 - fi - case "${ipv6_network_interfaces}" in - [Aa][Uu][Tt][Oo]) - return 0 - ;; - ''|[Nn][Oo][Nn][Ee]) - return 1 - ;; - esac + $_if|"$_if "*|*" $_if"|*" $_if "*|[Aa][Uu][Tt][Oo]) + # True if $ifconfig_IF_ipv6 is defined. + _tmpargs=`_ifconfig_getargs $_if ipv6` + if [ -n "${_tmpargs}" ]; then + return 0 + fi - for i in ${ipv6_network_interfaces}; do - if [ "$i" = "$_if" ]; then + # backward compatibility: True if $ipv6_ifconfig_IF is defined. + _tmpargs=`get_if_var $_if ipv6_ifconfig_IF` + if [ -n "${_tmpargs}" ]; then return 0 fi - done + ;; + esac return 1 } From owner-svn-src-head@FreeBSD.ORG Mon Sep 13 19:52:47 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 59A0A1065670; Mon, 13 Sep 2010 19:52:47 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2E81F8FC12; Mon, 13 Sep 2010 19:52:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8DJqlj4028466; Mon, 13 Sep 2010 19:52:47 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8DJql40028462; Mon, 13 Sep 2010 19:52:47 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201009131952.o8DJql40028462@svn.freebsd.org> From: Hiroki Sato Date: Mon, 13 Sep 2010 19:52:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212576 - in head: etc/defaults etc/rc.d share/man/man5 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2010 19:52:47 -0000 Author: hrs Date: Mon Sep 13 19:52:46 2010 New Revision: 212576 URL: http://svn.freebsd.org/changeset/base/212576 Log: Add $ipv6_privacy to support net.inet6.ip6.use_tempaddr. Note that this will be replaced with a per-IF version later. Based on: changes in r206408 by dougb Modified: head/etc/defaults/rc.conf head/etc/rc.d/netoptions head/share/man/man5/rc.conf.5 Modified: head/etc/defaults/rc.conf ============================================================================== --- head/etc/defaults/rc.conf Mon Sep 13 19:52:04 2010 (r212575) +++ head/etc/defaults/rc.conf Mon Sep 13 19:52:46 2010 (r212576) @@ -453,6 +453,8 @@ ipv6_static_routes="" # Set to static r # route toward loopback interface. #ipv6_route_xxx="fec0:0000:0000:0006:: -prefixlen 64 ::1" ipv6_gateway_enable="NO" # Set to YES if this host will be a gateway. +ipv6_privacy="NO" # Use privacy address on RA-receiving IFs + # (RFC 4193) route6d_enable="NO" # Set to YES to enable an IPv6 routing daemon. route6d_program="/usr/sbin/route6d" # Name of IPv6 routing daemon. Modified: head/etc/rc.d/netoptions ============================================================================== --- head/etc/rc.d/netoptions Mon Sep 13 19:52:04 2010 (r212575) +++ head/etc/rc.d/netoptions Mon Sep 13 19:52:46 2010 (r212576) @@ -99,6 +99,13 @@ netoptions_inet6() else ${SYSCTL_W} net.inet6.ip6.v6only=1 >/dev/null fi + + if checkyesno ipv6_privacy; then + netoptions_init + echo -n " IPv6 Privacy Addresses" + ${SYSCTL_W} net.inet6.ip6.use_tempaddr=1 >/dev/null + ${SYSCTL_W} net.inet6.ip6.prefer_tempaddr=1 >/dev/null + fi } load_rc_config $name Modified: head/share/man/man5/rc.conf.5 ============================================================================== --- head/share/man/man5/rc.conf.5 Mon Sep 13 19:52:04 2010 (r212575) +++ head/share/man/man5/rc.conf.5 Mon Sep 13 19:52:46 2010 (r212576) @@ -1304,6 +1304,12 @@ flag and keywords see .Xr ifconfig 8 . .Pp +.It Va ipv6_privacy +.Pq Vt bool +If the variable is +.Dq Li YES +privacy addresses will be generated for each IPv6 +interface as described in RFC 4193. .It Va ipv6_network_interfaces .Pq Vt str This is the IPv6 equivalent of From owner-svn-src-head@FreeBSD.ORG Mon Sep 13 19:53:22 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D2E241065674; Mon, 13 Sep 2010 19:53:22 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C2E1A8FC24; Mon, 13 Sep 2010 19:53:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8DJrMoo028547; Mon, 13 Sep 2010 19:53:22 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8DJrMhO028545; Mon, 13 Sep 2010 19:53:22 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201009131953.o8DJrMhO028545@svn.freebsd.org> From: Hiroki Sato Date: Mon, 13 Sep 2010 19:53:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212577 - head/etc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2010 19:53:22 -0000 Author: hrs Date: Mon Sep 13 19:53:22 2010 New Revision: 212577 URL: http://svn.freebsd.org/changeset/base/212577 Log: - Check some specific IFs first in ipv6_autoconfif(). - $ipv6_enable supports YES|TRUE|ON|1 as in checkyesno(). Based on: changes in r206408 by dougb Modified: head/etc/network.subr Modified: head/etc/network.subr ============================================================================== --- head/etc/network.subr Mon Sep 13 19:52:46 2010 (r212576) +++ head/etc/network.subr Mon Sep 13 19:53:22 2010 (r212577) @@ -108,7 +108,7 @@ ifconfig_up() # backward compatibility: $ipv6_enable case $ipv6_enable in - [Yy][Ee][Ss]) + [Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1) _ipv6_opts="${_ipv6_opts} accept_rtadv" ;; esac @@ -385,6 +385,7 @@ noafif() an[0-9]*|\ ath[0-9]*|\ ipw[0-9]*|\ + ipfw[0-9]*|\ iwi[0-9]*|\ iwn[0-9]*|\ ral[0-9]*|\ @@ -444,12 +445,21 @@ ipv6_autoconfif() local _if _tmpargs _arg _if=$1 - if ! ipv6if $_if; then + case $_if in + lo0|\ + stf[0-9]*|\ + faith[0-9]*|\ + lp[0-9]*|\ + sl[0-9]*) return 1 - fi + ;; + esac if noafif $_if; then return 1 fi + if ! ipv6if $_if; then + return 1 + fi if checkyesno ipv6_gateway_enable; then return 1 fi @@ -457,24 +467,11 @@ ipv6_autoconfif() if [ -n "${_tmpargs}" ]; then return 1 fi - - case $_if in - lo0|\ - stf[0-9]*|\ - faith[0-9]*|\ - lp[0-9]*|\ - sl[0-9]*|\ - pflog[0-9]*|\ - pfsync[0-9]*) - return 1 - ;; - esac - # backward compatibility: $ipv6_enable case $ipv6_enable in - [Yy][Ee][Ss]) + [Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1) return 0 - ;; + ;; esac _tmpargs=`_ifconfig_getargs $_if ipv6` From owner-svn-src-head@FreeBSD.ORG Mon Sep 13 19:53:54 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 809E810656A8; Mon, 13 Sep 2010 19:53:54 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 70A978FC12; Mon, 13 Sep 2010 19:53:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8DJrsYO028616; Mon, 13 Sep 2010 19:53:54 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8DJrsl2028614; Mon, 13 Sep 2010 19:53:54 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201009131953.o8DJrsl2028614@svn.freebsd.org> From: Hiroki Sato Date: Mon, 13 Sep 2010 19:53:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212578 - head/etc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2010 19:53:54 -0000 Author: hrs Date: Mon Sep 13 19:53:54 2010 New Revision: 212578 URL: http://svn.freebsd.org/changeset/base/212578 Log: Localize $_punct_c in get_if_var() and whitespace clean-ups. Based on: changes in r206408 by dougb Modified: head/etc/network.subr Modified: head/etc/network.subr ============================================================================== --- head/etc/network.subr Mon Sep 13 19:53:22 2010 (r212577) +++ head/etc/network.subr Mon Sep 13 19:53:54 2010 (r212578) @@ -194,7 +194,7 @@ ifconfig_down() # $default if given. get_if_var() { - local _if _punct _var _default prefix suffix + local _if _punct _punct_c _var _default prefix suffix if [ $# -ne 2 -a $# -ne 3 ]; then err 3 'USAGE: get_if_var name var [default]' @@ -505,7 +505,7 @@ ifexists() } # ipv4_up if -# add IPv4 addresses to the interface $if +# add IPv4 addresses to the interface $if ipv4_up() { local _if _ret @@ -615,14 +615,14 @@ ipv6_down() ipv4_addrs_common() { local _ret _if _action _cidr _cidr_addr - local _ipaddr _netmask _range _ipnet _iplow _iphigh _ipcount + local _ipaddr _netmask _range _ipnet _iplow _iphigh _ipcount _ret=1 _if=$1 _action=$2 - + # get ipv4-addresses cidr_addr=`get_if_var $_if ipv4_addrs_IF` - + for _cidr in ${cidr_addr}; do _ipaddr=${_cidr%%/*} _netmask="/"${_cidr##*/} @@ -635,7 +635,7 @@ ipv4_addrs_common() if [ "${_action}" = "-alias" ]; then _netmask="" fi - + _ipcount=${_iplow} while [ "${_ipcount}" -le "${_iphigh}" ]; do eval "ifconfig ${_if} ${_action} ${_ipnet}.${_ipcount}${_netmask}" From owner-svn-src-head@FreeBSD.ORG Mon Sep 13 19:55:40 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E73F1065672; Mon, 13 Sep 2010 19:55:40 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7C8208FC19; Mon, 13 Sep 2010 19:55:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8DJteHM028754; Mon, 13 Sep 2010 19:55:40 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8DJteMC028747; Mon, 13 Sep 2010 19:55:40 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201009131955.o8DJteMC028747@svn.freebsd.org> From: Hiroki Sato Date: Mon, 13 Sep 2010 19:55:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212579 - in head: . etc etc/defaults etc/rc.d share/man/man5 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2010 19:55:40 -0000 Author: hrs Date: Mon Sep 13 19:55:40 2010 New Revision: 212579 URL: http://svn.freebsd.org/changeset/base/212579 Log: Split $ipv6_prefer into $ip6addrctl_policy and $ipv6_activate_all_interfaces. The $ip6addrctl_policy is a variable to choose a pre-defined address selection policy set by ip6addrctl(8). The keyword "ipv4_prefer" sets IPv4-preferred one described in Section 10.3, the keyword "ipv6_prefer" sets IPv6-preferred one in Section 2.1 in RFC 3484, respectively. When "AUTO" is specified, it attempts to read /etc/ip6addrctl.conf first. If it is found, it reads and installs it as a policy table. If not, either of the two pre-defined policy tables is chosen automatically according to $ipv6_activate_all_interfaces. When $ipv6_activate_all_interfaces=NO, interfaces which have no corresponding $ifconfig_IF_ipv6 is marked as IFDISABLED for security reason. The default values are ip6addrctl_policy=AUTO and ipv6_activate_all_interfaces=NO. Discussed with: ume and bz Modified: head/UPDATING head/etc/defaults/rc.conf head/etc/network.subr head/etc/rc.d/ip6addrctl head/etc/rc.d/netif head/share/man/man5/rc.conf.5 Modified: head/UPDATING ============================================================================== --- head/UPDATING Mon Sep 13 19:53:54 2010 (r212578) +++ head/UPDATING Mon Sep 13 19:55:40 2010 (r212579) @@ -23,6 +23,25 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 9. ln -s aj /etc/malloc.conf.) 20100913: + The $ipv6_prefer variable in rc.conf(5) has been split into + $ip6addrctl_policy and $ipv6_activate_all_interfaces. + + The $ip6addrctl_policy is a variable to choose a pre-defined + address selection policy set by ip6addrctl(8). A value + "ipv4_prefer", "ipv6_prefer" or "AUTO" can be specified. The + default is "AUTO". + + The $ipv6_activate_all_interfaces specifies whether IFDISABLED + flag (see an entry of 20090926) is set on an interface with no + corresponding $ifconfig_IF_ipv6 line. The default is "NO" for + security reason. If you want IPv6 link-local address on all + interfaces by default, set this to "YES". + + The old ipv6_prefer="YES" is equivalent to + ipv6_activate_all_interfaces="YES" and + ip6addrctl_policy="ipv6_prefer". + +20100913: DTrace has grown support for userland tracing. Due to this, DTrace is now i386 and amd64 only. dtruss(1) is now installed by default on those systems and a new Modified: head/etc/defaults/rc.conf ============================================================================== --- head/etc/defaults/rc.conf Mon Sep 13 19:53:54 2010 (r212578) +++ head/etc/defaults/rc.conf Mon Sep 13 19:55:40 2010 (r212579) @@ -446,6 +446,10 @@ icmp_bmcastecho="NO" # respond to broadc ### IPv6 options: ### ipv6_network_interfaces="auto" # List of IPv6 network interfaces # (or "auto" or "none"). +ipv6_activate_all_interfaces="NO" # If NO, interfaces which have no + # corresponding $ifconfig_IF_ipv6 is + # marked as IFDISABLED for security + # reason. ipv6_defaultrouter="NO" # Set to IPv6 default gateway (or NO). #ipv6_defaultrouter="2002:c058:6301::" # Use this for 6to4 (RFC 3068) ipv6_static_routes="" # Set to static route list (or leave empty). @@ -506,7 +510,8 @@ ipv6_ipfilter_rules="/etc/ipf6.rules" # # for examples ip6addrctl_enable="YES" # Set to YES to enable default address selection ip6addrctl_verbose="NO" # Set to YES to enable verbose configuration messages -ipv6_prefer="NO" # Use IPv6 when both IPv4 and IPv6 can be used +ip6addrctl_policy="AUTO" # A pre-defined address selection policy + # (ipv4_prefer, ipv6_prefer, or AUTO) ############################################################## ### System console options ################################# Modified: head/etc/network.subr ============================================================================== --- head/etc/network.subr Mon Sep 13 19:53:54 2010 (r212578) +++ head/etc/network.subr Mon Sep 13 19:55:40 2010 (r212579) @@ -100,7 +100,7 @@ ifconfig_up() _ipv6_opts="-accept_rtadv" fi else - if checkyesno ipv6_prefer; then + if checkyesno ipv6_activate_all_interfaces; then _ipv6_opts="-ifdisabled" else _ipv6_opts="ifdisabled" Modified: head/etc/rc.d/ip6addrctl ============================================================================== --- head/etc/rc.d/ip6addrctl Mon Sep 13 19:53:54 2010 (r212578) +++ head/etc/rc.d/ip6addrctl Mon Sep 13 19:55:40 2010 (r212579) @@ -19,8 +19,10 @@ extra_commands="status prefer_ipv6 prefe status_cmd="ip6addrctl" prefer_ipv6_cmd="ip6addrctl_prefer_ipv6" prefer_ipv4_cmd="ip6addrctl_prefer_ipv4" +config_file="/etc/ip6addrctl.conf" -set_rcvar_obsolete ipv6_enable ipv6_prefer +set_rcvar_obsolete ipv6_enable ipv6_activate_all_interfaces +set_rcvar_obsolete ipv6_prefer ip6addrctl_policy ip6addrctl_prefer_ipv6() { @@ -53,17 +55,40 @@ ip6addrctl_start() afexists inet6 || return 0 # install the policy of the address selection algorithm. - if [ -f /etc/ip6addrctl.conf ]; then - ip6addrctl flush >/dev/null 2>&1 - ip6addrctl install /etc/ip6addrctl.conf - checkyesno ip6addrctl_verbose && ip6addrctl - else - if checkyesno ipv6_prefer; then - ip6addrctl_prefer_ipv6 + case "${ip6addrctl_policy}" in + [Aa][Uu][Tt][Oo]) + if [ -r "${config_file}" -a -s "${config_file}" ]; then + ip6addrctl flush >/dev/null 2>&1 + ip6addrctl install "${config_file}" + checkyesno ip6addrctl_verbose && ip6addrctl else - ip6addrctl_prefer_ipv4 + if checkyesno ipv6_activate_all_interfaces; then + ip6addrctl_prefer_ipv6 + else + ip6addrctl_prefer_ipv4 + fi fi - fi + ;; + ipv4_prefer) + ip6addrctl_prefer_ipv4 + ;; + ipv6_prefer) + ip6addrctl_prefer_ipv6 + ;; + [Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1) + # Backward compatibility when ipv6_prefer=YES + ip6addrctl_prefer_ipv6 + ;; + [Nn][Oo]|[Ff][Aa][Ll][Ss][Ee]|[Oo][Ff][Ff]|0) + # Backward compatibility when ipv6_prefer=NO + ip6addrctl_prefer_ipv4 + ;; + *) + warn "\$ip6addrctl_policy is invalid: ${ip6addrctl_policy}. " \ + " \"ipv4_prefer\" is used instead." + ip6addrctl_prefer_ipv4 + ;; + esac } ip6addrctl_stop() Modified: head/etc/rc.d/netif ============================================================================== --- head/etc/rc.d/netif Mon Sep 13 19:53:54 2010 (r212578) +++ head/etc/rc.d/netif Mon Sep 13 19:55:40 2010 (r212579) @@ -41,7 +41,8 @@ clonedown_cmd="clone_down" extra_commands="cloneup clonedown" cmdifn= -set_rcvar_obsolete ipv6_enable ipv6_prefer +set_rcvar_obsolete ipv6_enable ipv6_activate_all_interfaces +set_rcvar_obsolete ipv6_prefer network_start() { Modified: head/share/man/man5/rc.conf.5 ============================================================================== --- head/share/man/man5/rc.conf.5 Mon Sep 13 19:53:54 2010 (r212578) +++ head/share/man/man5/rc.conf.5 Mon Sep 13 19:55:40 2010 (r212579) @@ -1269,41 +1269,49 @@ If the variable is is added to all of .Va ifconfig_ Ns Ao Ar interface Ac Ns _ipv6 and the -.Va ipv6_prefer +.Va ipv6_activate_all_interfaces is defined as .Dq Li YES . .Pp This variable is deprecated. Use -.Va ipv6_prefer +.Va ifconfig_ Ns Ao Ar interface Ac Ns _ipv6 and -.Va ifconfig_ Ns Ao Ar interface Ac Ns _ipv6 . +.Va ipv6_activate_all_interfaces +if necessary. .It Va ipv6_prefer .Pq Vt bool -This variable does the following: -.Pp If the variable is .Dq Li YES , -the default policy of the source address selection set by +the default address selection policy table set by .Xr ip6addrctl 8 will be IPv6-preferred. .Pp If the variable is .Dq Li NO , -the default policy of the source address selection set by +the default address selection policy table set by .Xr ip6addrctl 8 -will be IPv4-preferred, and all of interfaces which does not have the -corrsponding +will be IPv4-preferred. +.Pp +This variable is deprecated. Use +.Va ip6addtctl_policy +instead. +.It Va ipv6_activate_all_interfaces +If the variable is +.Dq Li NO , +all of interfaces which do not have the corrsponding .Va ifconfig_ Ns Ao Ar interface Ac Ns _ipv6 variable will be marked as -.Dq Li IFDISABLED . -This means only IPv6 functionality on that interface is completely -disabled. For more details of +.Dq Li IFDISABLED +for security reason. This means only IPv6 functionality on that interface +is completely disabled. For more details of .Dq Li IFDISABLED flag and keywords .Dq Li inet6 ifdisabled , see .Xr ifconfig 8 . .Pp +Default is +.Dq Li NO . .It Va ipv6_privacy .Pq Vt bool If the variable is @@ -1316,6 +1324,8 @@ This is the IPv6 equivalent of .Va network_interfaces . Normally manual configuration of this variable is not needed. .Pp +.It Va ifconfig_ Ns Ao Ar interface Ac Ns _ipv6 +.Pq Vt str IPv6 functionality on an interface should be configured by .Va ifconfig_ Ns Ao Ar interface Ac Ns _ipv6 , instead of setting ifconfig parameters in @@ -1354,22 +1364,52 @@ this is the default output interface for This works only with ipv6_gateway_enable="NO". .It Va ip6addrctl_enable .Pq Vt bool -If set to -.Dq Li YES , -install default address selection policy table +This variable is to enable configuring default address selection policy table .Pq RFC 3484 . -If a file +The table can be specified in another variable +.Va ip6addrctl_policy . +For +.Va ip6addrctl_policy +the following keywords can be specified: +.Dq Li ipv4_prefer , +.Dq Li ipv6_prefer , +or +.Dq Li AUTO . +.Pp +If +.Dq Li ipv4_prefer +or +.Dq Li ipv6_prefer +is specified, +.Xr ip6addrctl 8 +installs a pre-defined policy table described in Section 2.1 +.Pq IPv6-preferred +or 10.3 +.Pq IPv4-preferred +of RFC 3484. +.Pp +If +.Dq Li AUTO +is specified, it attempts to read a file .Pa /etc/ip6addrctl.conf -is found the +first. If this file is found, .Xr ip6addrctl 8 -reads and installs it. -If not, a pre-defined policy table will be installed. -There are two pre-defined ones; IPv4-preferred and IPv6-preferred. -If set -.Va ipv6_prefer -variable to +reads and installs it. If not found, a policy is automatically set +according to +.Va ipv6_activate_all_interfaces +variable; if the variable is set to +.Dq Li YES +the IPv6-preferred one is used. Otherwise IPv4-preferred. +.Pp +The default value of +.Va ip6addrctl_enable +and +.Va ip6addrctl_policy +are .Dq Li YES -the IPv6-preferred one is used. Default is IPv4-preferred. +and +.Dq Li AUTO , +respectively. .It Va cloned_interfaces .Pq Vt str Set to the list of clonable network interfaces to create on this host. From owner-svn-src-head@FreeBSD.ORG Mon Sep 13 19:58:46 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A01BE1065670; Mon, 13 Sep 2010 19:58:46 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8FF1D8FC12; Mon, 13 Sep 2010 19:58:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8DJwk8S028910; Mon, 13 Sep 2010 19:58:46 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8DJwkUr028908; Mon, 13 Sep 2010 19:58:46 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201009131958.o8DJwkUr028908@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 13 Sep 2010 19:58:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212580 - head/sys/dev/fb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2010 19:58:46 -0000 Author: jkim Date: Mon Sep 13 19:58:46 2010 New Revision: 212580 URL: http://svn.freebsd.org/changeset/base/212580 Log: Fix segment:offset calculation of interrupt vector for relocated video BIOS when the original offset is bigger than size of one page. X86BIOS macros cannot be used here because it is assumed address is only linear in a page. Tested by: netchild Modified: head/sys/dev/fb/vesa.c Modified: head/sys/dev/fb/vesa.c ============================================================================== --- head/sys/dev/fb/vesa.c Mon Sep 13 19:55:40 2010 (r212579) +++ head/sys/dev/fb/vesa.c Mon Sep 13 19:58:46 2010 (r212580) @@ -804,18 +804,16 @@ vesa_bios_init(void) vbios = x86bios_get_orm(vesa_bios_offs); if (vbios != NULL) { vesa_bios_size = vbios[2] * 512; - offs = BIOS_SADDRTOLADDR(vesa_bios_int10); - if (offs > vesa_bios_offs && - offs < vesa_bios_offs + vesa_bios_size) { + if (((VESA_BIOS_OFFSET << 12) & 0xffff0000) == + (vesa_bios_int10 & 0xffff0000) && + vesa_bios_size > (vesa_bios_int10 & 0xffff)) { vesa_bios = x86bios_alloc(&vesa_bios_offs, vesa_bios_size, M_WAITOK); memcpy(vesa_bios, vbios, vesa_bios_size); - offs = offs - VESA_BIOS_OFFSET + vesa_bios_offs; - offs = (X86BIOS_PHYSTOSEG(offs) << 16) + - X86BIOS_PHYSTOOFF(offs); + offs = ((vesa_bios_offs << 12) & 0xffff0000) + + (vesa_bios_int10 & 0xffff); x86bios_set_intr(0x10, offs); - } else - offs = vesa_bios_int10; + } } if (vesa_bios == NULL) printf("VESA: failed to shadow video ROM\n"); From owner-svn-src-head@FreeBSD.ORG Mon Sep 13 22:50:06 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 37656106564A; Mon, 13 Sep 2010 22:50:06 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2652B8FC16; Mon, 13 Sep 2010 22:50:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8DMo6iI038849; Mon, 13 Sep 2010 22:50:06 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8DMo6DB038847; Mon, 13 Sep 2010 22:50:06 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201009132250.o8DMo6DB038847@svn.freebsd.org> From: Nathan Whitehorn Date: Mon, 13 Sep 2010 22:50:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212586 - head/sys/powerpc/powerpc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2010 22:50:06 -0000 Author: nwhitehorn Date: Mon Sep 13 22:50:05 2010 New Revision: 212586 URL: http://svn.freebsd.org/changeset/base/212586 Log: Fix a missing set of parantheses that could cause recent versions of libthr to crash deferencing a NULL pointer to the user context on powerpc64 systems with COMPAT_FREEBSD32 defined. Modified: head/sys/powerpc/powerpc/exec_machdep.c Modified: head/sys/powerpc/powerpc/exec_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/exec_machdep.c Mon Sep 13 22:40:10 2010 (r212585) +++ head/sys/powerpc/powerpc/exec_machdep.c Mon Sep 13 22:50:05 2010 (r212586) @@ -251,9 +251,9 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, tf->fixreg[FIRSTARG] = sig; #ifdef COMPAT_FREEBSD32 tf->fixreg[FIRSTARG+2] = (register_t)usfp + - (p->p_sysent->sv_flags & SV_ILP32) ? + ((p->p_sysent->sv_flags & SV_ILP32) ? offsetof(struct sigframe32, sf_uc) : - offsetof(struct sigframe, sf_uc); + offsetof(struct sigframe, sf_uc)); #else tf->fixreg[FIRSTARG+2] = (register_t)usfp + offsetof(struct sigframe, sf_uc); From owner-svn-src-head@FreeBSD.ORG Tue Sep 14 01:27:54 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 07084106564A; Tue, 14 Sep 2010 01:27:54 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EA58C8FC0C; Tue, 14 Sep 2010 01:27:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8E1Rro9051805; Tue, 14 Sep 2010 01:27:53 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8E1RroP051803; Tue, 14 Sep 2010 01:27:53 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201009140127.o8E1RroP051803@svn.freebsd.org> From: Neel Natu Date: Tue, 14 Sep 2010 01:27:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212589 - head/sys/mips/mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2010 01:27:54 -0000 Author: neel Date: Tue Sep 14 01:27:53 2010 New Revision: 212589 URL: http://svn.freebsd.org/changeset/base/212589 Log: Enforce that pmap_mapdev() always returns uncacheable mappings. Reviewed by: imp, jchandra, jmallett Modified: head/sys/mips/mips/pmap.c Modified: head/sys/mips/mips/pmap.c ============================================================================== --- head/sys/mips/mips/pmap.c Tue Sep 14 01:10:30 2010 (r212588) +++ head/sys/mips/mips/pmap.c Tue Sep 14 01:27:53 2010 (r212589) @@ -828,8 +828,8 @@ retry: /* * add a wired page to the kva */ - /* PMAP_INLINE */ void -pmap_kenter(vm_offset_t va, vm_paddr_t pa) +static void +pmap_kenter_attr(vm_offset_t va, vm_paddr_t pa, int attr) { pt_entry_t *pte; pt_entry_t opte, npte; @@ -837,12 +837,7 @@ pmap_kenter(vm_offset_t va, vm_paddr_t p #ifdef PMAP_DEBUG printf("pmap_kenter: va: %p -> pa: %p\n", (void *)va, (void *)pa); #endif - npte = TLBLO_PA_TO_PFN(pa) | PTE_D | PTE_V | PTE_G | PTE_W; - - if (is_cacheable_mem(pa)) - npte |= PTE_C_CACHE; - else - npte |= PTE_C_UNCACHED; + npte = TLBLO_PA_TO_PFN(pa) | PTE_D | PTE_V | PTE_G | PTE_W | attr; pte = pmap_pte(kernel_pmap, va); opte = *pte; @@ -851,6 +846,19 @@ pmap_kenter(vm_offset_t va, vm_paddr_t p pmap_update_page(kernel_pmap, va, npte); } +void +pmap_kenter(vm_offset_t va, vm_paddr_t pa) +{ + int attr; + + if (is_cacheable_mem(pa)) + attr = PTE_C_CACHE; + else + attr = PTE_C_UNCACHED; + + pmap_kenter_attr(va, pa, attr); +} + /* * remove a page from the kernel pagetables */ @@ -2863,7 +2871,7 @@ pmap_mapdev(vm_offset_t pa, vm_size_t si panic("pmap_mapdev: Couldn't alloc kernel virtual memory"); pa = trunc_page(pa); for (tmpva = va; size > 0;) { - pmap_kenter(tmpva, pa); + pmap_kenter_attr(tmpva, pa, PTE_C_UNCACHED); size -= PAGE_SIZE; tmpva += PAGE_SIZE; pa += PAGE_SIZE; From owner-svn-src-head@FreeBSD.ORG Tue Sep 14 01:33:21 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9736D1065673; Tue, 14 Sep 2010 01:33:21 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 866668FC12; Tue, 14 Sep 2010 01:33:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8E1XLGw052355; Tue, 14 Sep 2010 01:33:21 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8E1XLGC052353; Tue, 14 Sep 2010 01:33:21 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201009140133.o8E1XLGC052353@svn.freebsd.org> From: Ed Maste Date: Tue, 14 Sep 2010 01:33:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212591 - head/usr.bin/calendar X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2010 01:33:21 -0000 Author: emaste Date: Tue Sep 14 01:33:21 2010 New Revision: 212591 URL: http://svn.freebsd.org/changeset/base/212591 Log: Remove extra ; Modified: head/usr.bin/calendar/parsedata.c Modified: head/usr.bin/calendar/parsedata.c ============================================================================== --- head/usr.bin/calendar/parsedata.c Tue Sep 14 01:28:05 2010 (r212590) +++ head/usr.bin/calendar/parsedata.c Tue Sep 14 01:33:21 2010 (r212591) @@ -971,7 +971,7 @@ floattoday(int year, double f) int *cumdays = cumdaytab[isleap(year)]; for (i = 0; 1 + cumdays[i] < f; i++) - ;; + ; m = --i; d = floor(f - 1 - cumdays[i]); f -= floor(f); From owner-svn-src-head@FreeBSD.ORG Tue Sep 14 01:41:00 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 601E21065670; Tue, 14 Sep 2010 01:41:00 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 353FD8FC08; Tue, 14 Sep 2010 01:41:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8E1f0X3053026; Tue, 14 Sep 2010 01:41:00 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8E1f0HE053025; Tue, 14 Sep 2010 01:41:00 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201009140141.o8E1f0HE053025@svn.freebsd.org> From: Ed Maste Date: Tue, 14 Sep 2010 01:41:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212592 - head/contrib/libf2c X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2010 01:41:00 -0000 Author: emaste Date: Tue Sep 14 01:40:59 2010 New Revision: 212592 URL: http://svn.freebsd.org/changeset/base/212592 Log: Remove libf2c. It hasn't been used for more than 11 years, since revision 1.90 (CVS; SVN r45770) of lib/Makefile. Deleted: head/contrib/libf2c/ From owner-svn-src-head@FreeBSD.ORG Tue Sep 14 01:48:01 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8B8D5106566C; Tue, 14 Sep 2010 01:48:01 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7ADA58FC17; Tue, 14 Sep 2010 01:48:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8E1m1mQ053744; Tue, 14 Sep 2010 01:48:01 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8E1m1tn053742; Tue, 14 Sep 2010 01:48:01 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201009140148.o8E1m1tn053742@svn.freebsd.org> From: Neel Natu Date: Tue, 14 Sep 2010 01:48:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212593 - head/sys/mips/mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2010 01:48:01 -0000 Author: neel Date: Tue Sep 14 01:48:01 2010 New Revision: 212593 URL: http://svn.freebsd.org/changeset/base/212593 Log: Port r212559 to mips. Do not explicitly enable interrupts in smp_init_secondary() because it renders any spinlock protected code after that point to run with interrupts enabled. This is because the processor is executing in the context of idlethread whose 'md_spinlock_count' is already set to 1. Instead just let sched_throw() re-enable interrupts when it releases the spinlock. The original powerpc commit log for r212559 is available here: http://svn.freebsd.org/viewvc/base?view=revision&revision=212559 Modified: head/sys/mips/mips/mp_machdep.c Modified: head/sys/mips/mips/mp_machdep.c ============================================================================== --- head/sys/mips/mips/mp_machdep.c Tue Sep 14 01:40:59 2010 (r212592) +++ head/sys/mips/mips/mp_machdep.c Tue Sep 14 01:48:01 2010 (r212593) @@ -310,8 +310,6 @@ smp_init_secondary(u_int32_t cpuid) while (smp_started == 0) ; /* nothing */ - intr_enable(); - /* Start per-CPU event timers. */ cpu_initclocks_ap(); From owner-svn-src-head@FreeBSD.ORG Tue Sep 14 01:51:05 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E8CAB1065675; Tue, 14 Sep 2010 01:51:04 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D84988FC1B; Tue, 14 Sep 2010 01:51:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8E1p4J4054108; Tue, 14 Sep 2010 01:51:04 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8E1p49P054106; Tue, 14 Sep 2010 01:51:04 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201009140151.o8E1p49P054106@svn.freebsd.org> From: Ed Maste Date: Tue, 14 Sep 2010 01:51:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212594 - head/sys/dev/aac X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2010 01:51:05 -0000 Author: emaste Date: Tue Sep 14 01:51:04 2010 New Revision: 212594 URL: http://svn.freebsd.org/changeset/base/212594 Log: Avoid repeatedly spamming the console while a timed out command is waiting to complete. Instead, print one message after the timeout period expires, and one more when (if) the command eventually completes. MFC after: 1 month Modified: head/sys/dev/aac/aac.c Modified: head/sys/dev/aac/aac.c ============================================================================== --- head/sys/dev/aac/aac.c Tue Sep 14 01:48:01 2010 (r212593) +++ head/sys/dev/aac/aac.c Tue Sep 14 01:51:04 2010 (r212594) @@ -1129,6 +1129,11 @@ aac_complete(void *context, int pending) AAC_PRINT_FIB(sc, fib); break; } + if ((cm->cm_flags & AAC_CMD_TIMEDOUT) != 0) + device_printf(sc->aac_dev, + "COMMAND %p COMPLETED AFTER %d SECONDS\n", + cm, (int)(time_uptime-cm->cm_timestamp)); + aac_remove_busy(cm); aac_unmap_command(cm); @@ -2348,7 +2353,7 @@ aac_timeout(struct aac_softc *sc) deadline = time_uptime - AAC_CMD_TIMEOUT; TAILQ_FOREACH(cm, &sc->aac_busy, cm_link) { if ((cm->cm_timestamp < deadline) - /* && !(cm->cm_flags & AAC_CMD_TIMEDOUT) */) { + && !(cm->cm_flags & AAC_CMD_TIMEDOUT)) { cm->cm_flags |= AAC_CMD_TIMEDOUT; device_printf(sc->aac_dev, "COMMAND %p (TYPE %d) TIMEOUT AFTER %d SECONDS\n", From owner-svn-src-head@FreeBSD.ORG Tue Sep 14 03:18:12 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2508B1065673; Tue, 14 Sep 2010 03:18:12 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 144318FC13; Tue, 14 Sep 2010 03:18:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8E3IB3F062964; Tue, 14 Sep 2010 03:18:11 GMT (envelope-from grehan@svn.freebsd.org) Received: (from grehan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8E3IBaj062962; Tue, 14 Sep 2010 03:18:11 GMT (envelope-from grehan@svn.freebsd.org) Message-Id: <201009140318.o8E3IBaj062962@svn.freebsd.org> From: Peter Grehan Date: Tue, 14 Sep 2010 03:18:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212597 - head/sys/powerpc/aim X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2010 03:18:12 -0000 Author: grehan Date: Tue Sep 14 03:18:11 2010 New Revision: 212597 URL: http://svn.freebsd.org/changeset/base/212597 Log: Resurrect PSIM support by moving the cacheline size-detection warning printf outside of the MMU-disabled region. A call into OpenFirmware with the MMU off resulted in an internal PSIM assert. Modified: head/sys/powerpc/aim/machdep.c Modified: head/sys/powerpc/aim/machdep.c ============================================================================== --- head/sys/powerpc/aim/machdep.c Tue Sep 14 02:05:08 2010 (r212596) +++ head/sys/powerpc/aim/machdep.c Tue Sep 14 03:18:11 2010 (r212597) @@ -258,6 +258,7 @@ powerpc_init(vm_offset_t startkernel, vm char *env; register_t msr, scratch; uint8_t *cache_check; + int cacheline_warn; #ifndef __powerpc64__ int ppc64; #endif @@ -265,6 +266,7 @@ powerpc_init(vm_offset_t startkernel, vm end = 0; kmdp = NULL; trap_offset = 0; + cacheline_warn = 0; /* * Parse metadata if present and fetch parameters. Must be done @@ -360,7 +362,8 @@ powerpc_init(vm_offset_t startkernel, vm /* * Disable translation in case the vector area hasn't been - * mapped (G5). + * mapped (G5). Note that no OFW calls can be made until + * translation is re-enabled. */ msr = mfmsr(); @@ -387,7 +390,7 @@ powerpc_init(vm_offset_t startkernel, vm /* Work around psim bug */ if (cacheline_size == 0) { - printf("WARNING: cacheline size undetermined, setting to 32\n"); + cacheline_warn = 1; cacheline_size = 32; } @@ -496,6 +499,11 @@ powerpc_init(vm_offset_t startkernel, vm mtmsr(msr); isync(); + /* Warn if cachline size was not determined */ + if (cacheline_warn == 1) { + printf("WARNING: cacheline size undetermined, setting to 32\n"); + } + /* * Choose a platform module so we can get the physical memory map. */ From owner-svn-src-head@FreeBSD.ORG Tue Sep 14 04:48:04 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AC0A01065670; Tue, 14 Sep 2010 04:48:04 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 816C28FC19; Tue, 14 Sep 2010 04:48:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8E4m4PN068515; Tue, 14 Sep 2010 04:48:04 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8E4m48V068513; Tue, 14 Sep 2010 04:48:04 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201009140448.o8E4m48V068513@svn.freebsd.org> From: Alexander Motin Date: Tue, 14 Sep 2010 04:48:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212600 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2010 04:48:04 -0000 Author: mav Date: Tue Sep 14 04:48:04 2010 New Revision: 212600 URL: http://svn.freebsd.org/changeset/base/212600 Log: Add some foot shooting protection by checking singlemul value correctness. Rephrase sysctls descriptions. Suggested by: edmaste Modified: head/sys/kern/kern_clocksource.c Modified: head/sys/kern/kern_clocksource.c ============================================================================== --- head/sys/kern/kern_clocksource.c Tue Sep 14 04:22:27 2010 (r212599) +++ head/sys/kern/kern_clocksource.c Tue Sep 14 04:48:04 2010 (r212600) @@ -105,7 +105,7 @@ static int profiling = 0; /* Profiling static char timername[32]; /* Wanted timer. */ TUNABLE_STR("kern.eventtimer.timer", timername, sizeof(timername)); -static u_int singlemul = 0; /* Multiplier for periodic mode. */ +static int singlemul = 0; /* Multiplier for periodic mode. */ TUNABLE_INT("kern.eventtimer.singlemul", &singlemul); SYSCTL_INT(_kern_eventtimer, OID_AUTO, singlemul, CTLFLAG_RW, &singlemul, 0, "Multiplier for periodic mode"); @@ -425,6 +425,7 @@ setuptimer(void) periodic = 0; else if (!periodic && (timer->et_flags & ET_FLAGS_ONESHOT) == 0) periodic = 1; + singlemul = MIN(MAX(singlemul, 1), 20); freq = hz * singlemul; while (freq < (profiling ? profhz : stathz)) freq += hz; @@ -614,7 +615,7 @@ cpu_initclocks_bsp(void) * We want to run stathz in the neighborhood of 128hz. * We would like profhz to run as often as possible. */ - if (singlemul == 0) { + if (singlemul <= 0 || singlemul > 20) { if (hz >= 1500 || (hz % 128) == 0) singlemul = 1; else if (hz >= 750) @@ -844,7 +845,7 @@ sysctl_kern_eventtimer_timer(SYSCTL_HAND } SYSCTL_PROC(_kern_eventtimer, OID_AUTO, timer, CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_MPSAFE, - 0, 0, sysctl_kern_eventtimer_timer, "A", "Kernel event timer"); + 0, 0, sysctl_kern_eventtimer_timer, "A", "Chosen event timer"); /* * Report or change the active event timer periodicity. @@ -867,6 +868,6 @@ sysctl_kern_eventtimer_periodic(SYSCTL_H } SYSCTL_PROC(_kern_eventtimer, OID_AUTO, periodic, CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, - 0, 0, sysctl_kern_eventtimer_periodic, "I", "Kernel event timer periodic"); + 0, 0, sysctl_kern_eventtimer_periodic, "I", "Enable event timer periodic mode"); #endif From owner-svn-src-head@FreeBSD.ORG Tue Sep 14 04:57:31 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3B54A106566B; Tue, 14 Sep 2010 04:57:31 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 10B8C8FC15; Tue, 14 Sep 2010 04:57:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8E4vUI7068724; Tue, 14 Sep 2010 04:57:30 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8E4vUKM068723; Tue, 14 Sep 2010 04:57:30 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201009140457.o8E4vUKM068723@svn.freebsd.org> From: Alexander Motin Date: Tue, 14 Sep 2010 04:57:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212601 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2010 04:57:31 -0000 Author: mav Date: Tue Sep 14 04:57:30 2010 New Revision: 212601 URL: http://svn.freebsd.org/changeset/base/212601 Log: Replace spin lock with the set of atomics. It is impractical for one tc_ticktock() call to wait for another's completion -- just skip it. Modified: head/sys/kern/kern_clock.c Modified: head/sys/kern/kern_clock.c ============================================================================== --- head/sys/kern/kern_clock.c Tue Sep 14 04:48:04 2010 (r212600) +++ head/sys/kern/kern_clock.c Tue Sep 14 04:57:30 2010 (r212601) @@ -374,8 +374,7 @@ int ticks; int psratio; static DPCPU_DEFINE(int, pcputicks); /* Per-CPU version of ticks. */ -static struct mtx global_hardclock_mtx; -MTX_SYSINIT(global_hardclock_mtx, &global_hardclock_mtx, "ghc_mtx", MTX_SPIN); +static int global_hardclock_run = 0; /* * Initialize clock frequencies and start both clocks running. @@ -485,8 +484,10 @@ hardclock_anycpu(int cnt, int usermode) struct thread *td = curthread; struct proc *p = td->td_proc; int *t = DPCPU_PTR(pcputicks); - int flags; - int global, newticks; + int flags, global, newticks; +#ifdef SW_WATCHDOG + int i; +#endif /* SW_WATCHDOG */ /* * Update per-CPU and possibly global ticks values. @@ -535,19 +536,22 @@ hardclock_anycpu(int cnt, int usermode) callout_tick(); /* We are in charge to handle this tick duty. */ if (newticks > 0) { - mtx_lock_spin(&global_hardclock_mtx); - tc_ticktock(); + /* Dangerous and no need to call these things concurrently. */ + if (atomic_cmpset_acq_int(&global_hardclock_run, 0, 1)) { + tc_ticktock(); #ifdef DEVICE_POLLING - hardclock_device_poll(); /* This is very short and quick. */ + /* This is very short and quick. */ + hardclock_device_poll(); #endif /* DEVICE_POLLING */ + atomic_store_rel_int(&global_hardclock_run, 0); + } #ifdef SW_WATCHDOG if (watchdog_enabled > 0) { - watchdog_ticks -= newticks; - if (watchdog_ticks <= 0) + i = atomic_fetchadd_int(&watchdog_ticks, -newticks); + if (i > 0 && i <= newticks) watchdog_fire(); } #endif /* SW_WATCHDOG */ - mtx_unlock_spin(&global_hardclock_mtx); } if (curcpu == CPU_FIRST()) cpu_tick_calibration(); From owner-svn-src-head@FreeBSD.ORG Tue Sep 14 06:48:14 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 725F7106566C; Tue, 14 Sep 2010 06:48:14 +0000 (UTC) (envelope-from alc@rice.edu) Received: from mh1.mail.rice.edu (mh1.mail.rice.edu [128.42.201.20]) by mx1.freebsd.org (Postfix) with ESMTP id 397448FC1B; Tue, 14 Sep 2010 06:48:13 +0000 (UTC) Received: from mh1.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh1.mail.rice.edu (Postfix) with ESMTP id 77B1828F6BA; Tue, 14 Sep 2010 01:48:13 -0500 (CDT) X-Virus-Scanned: by amavis-2.6.4 at mh1.mail.rice.edu, auth channel Received: from mh1.mail.rice.edu ([127.0.0.1]) by mh1.mail.rice.edu (mh1.mail.rice.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id sruk1lgL2Kq0; Tue, 14 Sep 2010 01:48:13 -0500 (CDT) Received: from adsl-216-63-78-18.dsl.hstntx.swbell.net (adsl-216-63-78-18.dsl.hstntx.swbell.net [216.63.78.18]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) (Authenticated sender: alc) by mh1.mail.rice.edu (Postfix) with ESMTPSA id C242228F6B7; Tue, 14 Sep 2010 01:48:12 -0500 (CDT) Message-ID: <4C8F1AAC.4000301@rice.edu> Date: Tue, 14 Sep 2010 01:48:12 -0500 From: Alan Cox User-Agent: Thunderbird 2.0.0.24 (X11/20100725) MIME-Version: 1.0 To: Kostik Belousov References: <201009070023.o870Njtg072607@svn.freebsd.org> <20100907080446.GA2853@deviant.kiev.zoral.com.ua> <4C8E5FB5.9070009@rice.edu> <20100913191247.GN2465@deviant.kiev.zoral.com.ua> In-Reply-To: <20100913191247.GN2465@deviant.kiev.zoral.com.ua> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, Ryan Stone , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r212281 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2010 06:48:14 -0000 Kostik Belousov wrote: > On Mon, Sep 13, 2010 at 12:30:29PM -0500, Alan Cox wrote: > >> Kostik Belousov wrote: >> >>> On Tue, Sep 07, 2010 at 12:23:45AM +0000, Ryan Stone wrote: >>> >>> >>>> Author: rstone >>>> Date: Tue Sep 7 00:23:45 2010 >>>> New Revision: 212281 >>>> URL: http://svn.freebsd.org/changeset/base/212281 >>>> >>>> Log: >>>> In munmap() downgrade the vm_map_lock to a read lock before taking a >>>> read >>>> lock on the pmc-sx lock. This prevents a deadlock with >>>> pmc_log_process_mappings, which has an exclusive lock on pmc-sx and >>>> tries >>>> to get a read lock on a vm_map. Downgrading the vm_map_lock in munmap >>>> allows pmc_log_process_mappings to continue, preventing the deadlock. >>>> >>>> Without this change I could cause a deadlock on a multicore 8.1-RELEASE >>>> system by having one thread constantly mmap'ing and then munmap'ing a >>>> PROT_EXEC mapping in a loop while I repeatedly invoked and stopped >>>> pmcstat >>>> in system-wide sampling mode. >>>> >>>> Reviewed by: fabient >>>> Approved by: emaste (mentor) >>>> MFC after: 2 weeks >>>> >>>> Modified: >>>> head/sys/vm/vm_mmap.c >>>> >>>> Modified: head/sys/vm/vm_mmap.c >>>> ============================================================================== >>>> --- head/sys/vm/vm_mmap.c Mon Sep 6 23:52:04 2010 (r212280) >>>> +++ head/sys/vm/vm_mmap.c Tue Sep 7 00:23:45 2010 (r212281) >>>> @@ -579,6 +579,7 @@ munmap(td, uap) >>>> * Inform hwpmc if the address range being unmapped contains >>>> * an executable region. >>>> */ >>>> + pkm.pm_address = (uintptr_t) NULL; >>>> if (vm_map_lookup_entry(map, addr, &entry)) { >>>> for (; >>>> entry != &map->header && entry->start < addr + size; >>>> @@ -587,16 +588,23 @@ munmap(td, uap) >>>> entry->end, VM_PROT_EXECUTE) == TRUE) { >>>> pkm.pm_address = (uintptr_t) addr; >>>> pkm.pm_size = (size_t) size; >>>> - PMC_CALL_HOOK(td, PMC_FN_MUNMAP, >>>> - (void *) &pkm); >>>> break; >>>> } >>>> } >>>> } >>>> #endif >>>> - /* returns nothing but KERN_SUCCESS anyway */ >>>> vm_map_delete(map, addr, addr + size); >>>> + >>>> +#ifdef HWPMC_HOOKS >>>> + /* downgrade the lock to prevent a LOR with the pmc-sx lock */ >>>> + vm_map_lock_downgrade(map); >>>> + if (pkm.pm_address != (uintptr) NULL) >>>> + PMC_CALL_HOOK(td, PMC_FN_MUNMAP, (void *) &pkm); >>>> + vm_map_unlock_read(map); >>>> +#else >>>> vm_map_unlock(map); >>>> +#endif >>>> + /* vm_map_delete returns nothing but KERN_SUCCESS anyway */ >>>> return (0); >>>> } >>>> >>>> >>>> >>> Note that vm_map_unlock() is more then just dropping the lock on the map. >>> Due to ordering of the vnode lock before vm map lock, vm_map_unlock() >>> processes the deferred free entries after map lock is dropped. After your >>> change, the deferred list might keep entries for some time until next >>> unlock is performed. >>> >>> >>> >> I'm afraid that this understates the effect. Over the weekend, when I >> updated one of my amd64 machines to include this change, I found that >> the delay in object and page deallocation is leading to severe >> fragmentation within the physical memory allocator. As a result, the >> time spent in the kernel during a "buildworld" increased by about 8%. >> Moreover, superpage promotion by applications effectively stopped. >> >> For now, I think it would be best to back out r212281 and r212282. >> Ultimately, the fix may be to change the vm map synchronization >> primitives, and simply reinstate r212281 and r212282, but I'd like some >> time to consider the options. >> > > Did you noted the thread on current@ about r212281 ? The submitter > claims that the rev. causes panics in unrelated code pathes when > vnode_create_vobject() locks vm object lock. I cannot understand > how this can happen, with or without the rev. > > Yes, I saw it. I don't understand it either. Alan . From owner-svn-src-head@FreeBSD.ORG Tue Sep 14 08:48:07 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1B1491065672; Tue, 14 Sep 2010 08:48:07 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 09D548FC14; Tue, 14 Sep 2010 08:48:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8E8m6NX073408; Tue, 14 Sep 2010 08:48:06 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8E8m6V0073401; Tue, 14 Sep 2010 08:48:06 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201009140848.o8E8m6V0073401@svn.freebsd.org> From: Alexander Motin Date: Tue, 14 Sep 2010 08:48:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212603 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2010 08:48:07 -0000 Author: mav Date: Tue Sep 14 08:48:06 2010 New Revision: 212603 URL: http://svn.freebsd.org/changeset/base/212603 Log: Make kern_tc.c provide minimum frequency of tc_ticktock() calls, required to handle current timecounter wraps. Make kern_clocksource.c to honor that requirement, scheduling sleeps on first CPU for no more then specified period. Allow other CPUs to sleep up to 1/4 second (for any case). Modified: head/sys/kern/kern_clock.c head/sys/kern/kern_clocksource.c head/sys/kern/kern_tc.c head/sys/kern/kern_timeout.c head/sys/sys/callout.h head/sys/sys/timetc.h Modified: head/sys/kern/kern_clock.c ============================================================================== --- head/sys/kern/kern_clock.c Tue Sep 14 07:09:24 2010 (r212602) +++ head/sys/kern/kern_clock.c Tue Sep 14 08:48:06 2010 (r212603) @@ -457,7 +457,7 @@ hardclock(int usermode, uintfptr_t pc) atomic_add_int((volatile int *)&ticks, 1); hardclock_cpu(usermode); - tc_ticktock(); + tc_ticktock(1); cpu_tick_calibration(); /* * If no separate statistics clock is available, run it from here. @@ -538,7 +538,7 @@ hardclock_anycpu(int cnt, int usermode) if (newticks > 0) { /* Dangerous and no need to call these things concurrently. */ if (atomic_cmpset_acq_int(&global_hardclock_run, 0, 1)) { - tc_ticktock(); + tc_ticktock(newticks); #ifdef DEVICE_POLLING /* This is very short and quick. */ hardclock_device_poll(); Modified: head/sys/kern/kern_clocksource.c ============================================================================== --- head/sys/kern/kern_clocksource.c Tue Sep 14 07:09:24 2010 (r212602) +++ head/sys/kern/kern_clocksource.c Tue Sep 14 08:48:06 2010 (r212603) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -247,7 +248,10 @@ getnextcpuevent(struct bintime *event, i state = DPCPU_PTR(timerstate); *event = state->nexthard; if (idle) { /* If CPU is idle - ask callouts for how long. */ - skip = callout_tickstofirst() - 1; + skip = 4; + if (curcpu == CPU_FIRST() && tc_min_ticktock_freq > skip) + skip = tc_min_ticktock_freq; + skip = callout_tickstofirst(hz / skip) - 1; CTR2(KTR_SPARE2, "skip at %d: %d", curcpu, skip); tmp = hardperiod; bintime_mul(&tmp, skip); Modified: head/sys/kern/kern_tc.c ============================================================================== --- head/sys/kern/kern_tc.c Tue Sep 14 07:09:24 2010 (r212602) +++ head/sys/kern/kern_tc.c Tue Sep 14 08:48:06 2010 (r212603) @@ -87,6 +87,8 @@ static struct timehands *volatile timeha struct timecounter *timecounter = &dummy_timecounter; static struct timecounter *timecounters = &dummy_timecounter; +int tc_min_ticktock_freq = 1; + time_t time_second = 1; time_t time_uptime = 1; @@ -482,6 +484,8 @@ tc_windup(void) if (th->th_counter != timecounter) { th->th_counter = timecounter; th->th_offset_count = ncount; + tc_min_ticktock_freq = max(1, timecounter->tc_frequency / + (((uint64_t)timecounter->tc_counter_mask + 1) / 3)); } /*- @@ -767,11 +771,12 @@ static int tc_tick; SYSCTL_INT(_kern_timecounter, OID_AUTO, tick, CTLFLAG_RD, &tc_tick, 0, ""); void -tc_ticktock(void) +tc_ticktock(int cnt) { static int count; - if (++count < tc_tick) + count += cnt; + if (count < tc_tick) return; count = 0; tc_windup(); Modified: head/sys/kern/kern_timeout.c ============================================================================== --- head/sys/kern/kern_timeout.c Tue Sep 14 07:09:24 2010 (r212602) +++ head/sys/kern/kern_timeout.c Tue Sep 14 08:48:06 2010 (r212603) @@ -280,7 +280,7 @@ callout_tick(void) } int -callout_tickstofirst(void) +callout_tickstofirst(int limit) { struct callout_cpu *cc; struct callout *c; @@ -291,7 +291,7 @@ callout_tickstofirst(void) cc = CC_SELF(); mtx_lock_spin_flags(&cc->cc_lock, MTX_QUIET); curticks = cc->cc_ticks; - while( skip < ncallout && skip < hz/8 ) { + while( skip < ncallout && skip < limit ) { sc = &cc->cc_callwheel[ (curticks+skip) & callwheelmask ]; /* search scanning ticks */ TAILQ_FOREACH( c, sc, c_links.tqe ){ Modified: head/sys/sys/callout.h ============================================================================== --- head/sys/sys/callout.h Tue Sep 14 07:09:24 2010 (r212602) +++ head/sys/sys/callout.h Tue Sep 14 08:48:06 2010 (r212603) @@ -96,7 +96,7 @@ int callout_schedule_on(struct callout * #define callout_stop(c) _callout_stop_safe(c, 0) int _callout_stop_safe(struct callout *, int); void callout_tick(void); -int callout_tickstofirst(void); +int callout_tickstofirst(int limit); extern void (*callout_new_inserted)(int cpu, int ticks); #endif Modified: head/sys/sys/timetc.h ============================================================================== --- head/sys/sys/timetc.h Tue Sep 14 07:09:24 2010 (r212602) +++ head/sys/sys/timetc.h Tue Sep 14 08:48:06 2010 (r212603) @@ -65,11 +65,15 @@ struct timecounter { }; extern struct timecounter *timecounter; +extern int tc_min_ticktock_freq; /* + * Minimal tc_ticktock() call frequency, + * required to handle counter wraps. + */ u_int64_t tc_getfrequency(void); void tc_init(struct timecounter *tc); void tc_setclock(struct timespec *ts); -void tc_ticktock(void); +void tc_ticktock(int cnt); void cpu_tick_calibration(void); #ifdef SYSCTL_DECL From owner-svn-src-head@FreeBSD.ORG Tue Sep 14 10:26:49 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 680A4106567A; Tue, 14 Sep 2010 10:26:49 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 57B2B8FC16; Tue, 14 Sep 2010 10:26:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8EAQnYA075616; Tue, 14 Sep 2010 10:26:49 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8EAQnrN075614; Tue, 14 Sep 2010 10:26:49 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201009141026.o8EAQnrN075614@svn.freebsd.org> From: Alexander Motin Date: Tue, 14 Sep 2010 10:26:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212604 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2010 10:26:49 -0000 Author: mav Date: Tue Sep 14 10:26:49 2010 New Revision: 212604 URL: http://svn.freebsd.org/changeset/base/212604 Log: Fix panic on NULL dereference possible after r212541. Modified: head/sys/kern/kern_timeout.c Modified: head/sys/kern/kern_timeout.c ============================================================================== --- head/sys/kern/kern_timeout.c Tue Sep 14 08:48:06 2010 (r212603) +++ head/sys/kern/kern_timeout.c Tue Sep 14 10:26:49 2010 (r212604) @@ -672,7 +672,8 @@ retry: c->c_time = ticks + to_ticks; TAILQ_INSERT_TAIL(&cc->cc_callwheel[c->c_time & callwheelmask], c, c_links.tqe); - if ((c->c_time - cc->cc_firsttick) < 0) { + if ((c->c_time - cc->cc_firsttick) < 0 && + callout_new_inserted != NULL) { cc->cc_firsttick = c->c_time; (*callout_new_inserted)(cpu, to_ticks + (ticks - cc->cc_ticks)); From owner-svn-src-head@FreeBSD.ORG Tue Sep 14 10:27:32 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA813106567A; Tue, 14 Sep 2010 10:27:32 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9F5688FC26; Tue, 14 Sep 2010 10:27:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8EARWAg075672; Tue, 14 Sep 2010 10:27:32 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8EARW73075670; Tue, 14 Sep 2010 10:27:32 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201009141027.o8EARW73075670@svn.freebsd.org> From: Martin Matuska Date: Tue, 14 Sep 2010 10:27:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212605 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2010 10:27:32 -0000 Author: mm Date: Tue Sep 14 10:27:32 2010 New Revision: 212605 URL: http://svn.freebsd.org/changeset/base/212605 Log: Add missing vop_vector zfsctl_ops_shares Add missing locks around VOP_READDIR and VOP_GETATTR with z_shares_dir PR: kern/150544 Approved by: delphij (mentor) Obtained from: perforce (pjd) MFC after: 1 day Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Tue Sep 14 10:26:49 2010 (r212604) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Tue Sep 14 10:27:32 2010 (r212605) @@ -1101,8 +1101,9 @@ zfsctl_shares_readdir(ap) return (ENOTSUP); } if ((error = zfs_zget(zfsvfs, zfsvfs->z_shares_dir, &dzp)) == 0) { + vn_lock(ZTOV(dzp), LK_SHARED | LK_RETRY); error = VOP_READDIR(ZTOV(dzp), uiop, cr, eofp, ap->a_ncookies, ap->a_cookies); - VN_RELE(ZTOV(dzp)); + VN_URELE(ZTOV(dzp)); } else { *eofp = 1; error = ENOENT; @@ -1149,6 +1150,7 @@ zfsctl_mknode_shares(vnode_t *pvp) NULL, NULL); sdp = vp->v_data; sdp->zc_cmtime = ((zfsctl_node_t *)pvp->v_data)->zc_cmtime; + VOP_UNLOCK(vp, 0); return (vp); } @@ -1176,8 +1178,9 @@ zfsctl_shares_getattr(ap) return (ENOTSUP); } if ((error = zfs_zget(zfsvfs, zfsvfs->z_shares_dir, &dzp)) == 0) { + vn_lock(ZTOV(dzp), LK_SHARED | LK_RETRY); error = VOP_GETATTR(ZTOV(dzp), vap, cr); - VN_RELE(ZTOV(dzp)); + VN_URELE(ZTOV(dzp)); } ZFS_EXIT(zfsvfs); return (error); @@ -1253,6 +1256,20 @@ static struct vop_vector zfsctl_ops_snap .vop_fid = zfsctl_common_fid, }; +static struct vop_vector zfsctl_ops_shares = { + .vop_default = &default_vnodeops, + .vop_open = zfsctl_common_open, + .vop_close = zfsctl_common_close, + .vop_ioctl = VOP_EINVAL, + .vop_getattr = zfsctl_shares_getattr, + .vop_access = zfsctl_common_access, + .vop_readdir = zfsctl_shares_readdir, + .vop_lookup = zfsctl_shares_lookup, + .vop_inactive = gfs_vop_inactive, + .vop_reclaim = zfsctl_common_reclaim, + .vop_fid = zfsctl_shares_fid, +}; + /* * pvp is the GFS vnode '.zfs/snapshot'. * From owner-svn-src-head@FreeBSD.ORG Tue Sep 14 11:00:32 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0C571106566B; Tue, 14 Sep 2010 11:00:32 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 780788FC15; Tue, 14 Sep 2010 11:00:31 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id o8EB0MOV002316 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 14 Sep 2010 14:00:22 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id o8EB0MZx012820; Tue, 14 Sep 2010 14:00:22 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id o8EB0Mim012819; Tue, 14 Sep 2010 14:00:22 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 14 Sep 2010 14:00:22 +0300 From: Kostik Belousov To: Alan Cox Message-ID: <20100914110022.GC2465@deviant.kiev.zoral.com.ua> References: <201009070023.o870Njtg072607@svn.freebsd.org> <20100907080446.GA2853@deviant.kiev.zoral.com.ua> <4C8E5FB5.9070009@rice.edu> <20100913191247.GN2465@deviant.kiev.zoral.com.ua> <4C8F1AAC.4000301@rice.edu> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="mpBUfgpRCnEyunvv" Content-Disposition: inline In-Reply-To: <4C8F1AAC.4000301@rice.edu> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-2.7 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_05, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, Ryan Stone , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r212281 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2010 11:00:32 -0000 --mpBUfgpRCnEyunvv Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Sep 14, 2010 at 01:48:12AM -0500, Alan Cox wrote: > Kostik Belousov wrote: > >Did you noted the thread on current@ about r212281 ? The submitter > >claims that the rev. causes panics in unrelated code pathes when > >vnode_create_vobject() locks vm object lock. I cannot understand > >how this can happen, with or without the rev. > > > > =20 >=20 > Yes, I saw it. I don't understand it either. >=20 > Alan > . As noted by Peter Holm, the report indicates that fuse.ko module was loaded. I believe this is another fuse-induced kernel memory corruption. --mpBUfgpRCnEyunvv Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkyPVcYACgkQC3+MBN1Mb4g+cQCg73gd+56ZVz2P1wumAoS+iQ+o /HYAoLTvu+C0av3JZud+aILR1NhqXd7b =ds6I -----END PGP SIGNATURE----- --mpBUfgpRCnEyunvv-- From owner-svn-src-head@FreeBSD.ORG Tue Sep 14 11:13:47 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1CAE91065672; Tue, 14 Sep 2010 11:13:47 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0BA5B8FC17; Tue, 14 Sep 2010 11:13:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8EBDk8Y079872; Tue, 14 Sep 2010 11:13:46 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8EBDkBt079867; Tue, 14 Sep 2010 11:13:46 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201009141113.o8EBDkBt079867@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Tue, 14 Sep 2010 11:13:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212606 - in head/sbin/geom: class/part core X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2010 11:13:47 -0000 Author: pjd Date: Tue Sep 14 11:13:46 2010 New Revision: 212606 URL: http://svn.freebsd.org/changeset/base/212606 Log: Introduce special G_VAL_OPTIONAL define, which when given in value field tells geom(8) to ignore it when it is not given and don't try to obtain default value. Modified: head/sbin/geom/class/part/geom_part.c head/sbin/geom/core/geom.c head/sbin/geom/core/geom.h Modified: head/sbin/geom/class/part/geom_part.c ============================================================================== --- head/sbin/geom/class/part/geom_part.c Tue Sep 14 10:27:32 2010 (r212605) +++ head/sbin/geom/class/part/geom_part.c Tue Sep 14 11:13:46 2010 (r212606) @@ -90,16 +90,16 @@ struct g_command PUBSYM(class_commands)[ { 'b', "start", GPART_AUTOFILL, G_TYPE_STRING }, { 's', "size", GPART_AUTOFILL, G_TYPE_STRING }, { 't', "type", NULL, G_TYPE_STRING }, - { 'i', GPART_PARAM_INDEX, "", G_TYPE_ASCNUM }, - { 'l', "label", "", G_TYPE_STRING }, + { 'i', GPART_PARAM_INDEX, G_VAL_OPTIONAL, G_TYPE_ASCNUM }, + { 'l', "label", G_VAL_OPTIONAL, G_TYPE_STRING }, { 'f', "flags", GPART_FLAGS, G_TYPE_STRING }, G_OPT_SENTINEL }, "[-b start] [-s size] -t type [-i index] [-l label] [-f flags] geom" }, { "bootcode", 0, gpart_bootcode, { - { 'b', GPART_PARAM_BOOTCODE, "", G_TYPE_STRING }, - { 'p', GPART_PARAM_PARTCODE, "", G_TYPE_STRING }, - { 'i', GPART_PARAM_INDEX, "", G_TYPE_ASCNUM }, + { 'b', GPART_PARAM_BOOTCODE, G_VAL_OPTIONAL, G_TYPE_STRING }, + { 'p', GPART_PARAM_PARTCODE, G_VAL_OPTIONAL, G_TYPE_STRING }, + { 'i', GPART_PARAM_INDEX, G_VAL_OPTIONAL, G_TYPE_ASCNUM }, { 'f', "flags", GPART_FLAGS, G_TYPE_STRING }, G_OPT_SENTINEL }, "bootcode [-b bootcode] [-p partcode] [-i index] [-f flags] geom" @@ -109,7 +109,7 @@ struct g_command PUBSYM(class_commands)[ }, { "create", 0, gpart_issue, { { 's', "scheme", NULL, G_TYPE_STRING }, - { 'n', "entries", "", G_TYPE_ASCNUM }, + { 'n', "entries", G_VAL_OPTIONAL, G_TYPE_ASCNUM }, { 'f', "flags", GPART_FLAGS, G_TYPE_STRING }, G_OPT_SENTINEL }, "-s scheme [-n entries] [-f flags] provider" @@ -127,8 +127,8 @@ struct g_command PUBSYM(class_commands)[ }, { "modify", 0, gpart_issue, { { 'i', GPART_PARAM_INDEX, NULL, G_TYPE_ASCNUM }, - { 'l', "label", "", G_TYPE_STRING }, - { 't', "type", "", G_TYPE_STRING }, + { 'l', "label", G_VAL_OPTIONAL, G_TYPE_STRING }, + { 't', "type", G_VAL_OPTIONAL, G_TYPE_STRING }, { 'f', "flags", GPART_FLAGS, G_TYPE_STRING }, G_OPT_SENTINEL }, "-i index [-l label] [-t type] [-f flags] geom" Modified: head/sbin/geom/core/geom.c ============================================================================== --- head/sbin/geom/core/geom.c Tue Sep 14 10:27:32 2010 (r212605) +++ head/sbin/geom/core/geom.c Tue Sep 14 11:13:46 2010 (r212606) @@ -374,9 +374,8 @@ parse_arguments(struct g_command *cmd, s warnx("Option '%c' not specified.", opt->go_char); usage(); - } else if (G_OPT_TYPE(opt) == G_TYPE_ASCNUM && - *(const char *)opt->go_val == '\0') { - ; /* add nothing. */ + } else if (opt->go_val == G_VAL_OPTIONAL) { + /* add nothing. */ } else { set_option(req, opt, opt->go_val); } Modified: head/sbin/geom/core/geom.h ============================================================================== --- head/sbin/geom/core/geom.h Tue Sep 14 10:27:32 2010 (r212605) +++ head/sbin/geom/core/geom.h Tue Sep 14 11:13:46 2010 (r212606) @@ -53,6 +53,8 @@ #define G_OPT_NUM(opt) (((opt)->go_type & G_TYPE_NUMMASK) >> G_TYPE_NUMSHIFT) #define G_OPT_NUMINC(opt) ((opt)->go_type += (1 << G_TYPE_NUMSHIFT)) +#define G_VAL_OPTIONAL ((void *)-1) + #define G_OPT_SENTINEL { '\0', NULL, NULL, G_TYPE_NONE } #define G_NULL_OPTS { G_OPT_SENTINEL } #define G_CMD_SENTINEL { NULL, 0, NULL, G_NULL_OPTS, NULL } From owner-svn-src-head@FreeBSD.ORG Tue Sep 14 11:19:22 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 13B321065742; Tue, 14 Sep 2010 11:19:22 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 037AE8FC18; Tue, 14 Sep 2010 11:19:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8EBJLDv080005; Tue, 14 Sep 2010 11:19:21 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8EBJLKU080003; Tue, 14 Sep 2010 11:19:21 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201009141119.o8EBJLKU080003@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Tue, 14 Sep 2010 11:19:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212607 - head/sbin/geom/core X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2010 11:19:22 -0000 Author: pjd Date: Tue Sep 14 11:19:21 2010 New Revision: 212607 URL: http://svn.freebsd.org/changeset/base/212607 Log: Remove dot which shouldn't be here, as err(3) will attach error message at the end of the string. Modified: head/sbin/geom/core/geom.c Modified: head/sbin/geom/core/geom.c ============================================================================== --- head/sbin/geom/core/geom.c Tue Sep 14 11:13:46 2010 (r212606) +++ head/sbin/geom/core/geom.c Tue Sep 14 11:19:21 2010 (r212607) @@ -262,7 +262,7 @@ set_option(struct gctl_req *req, struct if (G_OPT_TYPE(opt) == G_TYPE_NUMBER || G_OPT_TYPE(opt) == G_TYPE_ASCNUM) { if (expand_number(val, &number) == -1) { - err(EXIT_FAILURE, "Invalid value for '%c' argument.", + err(EXIT_FAILURE, "Invalid value for '%c' argument", opt->go_char); } if (G_OPT_TYPE(opt) == G_TYPE_NUMBER) { From owner-svn-src-head@FreeBSD.ORG Tue Sep 14 11:36:26 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B72EE1065696; Tue, 14 Sep 2010 11:36:26 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A6D2E8FC13; Tue, 14 Sep 2010 11:36:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8EBaQ8h080419; Tue, 14 Sep 2010 11:36:26 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8EBaQKV080417; Tue, 14 Sep 2010 11:36:26 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201009141136.o8EBaQKV080417@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Tue, 14 Sep 2010 11:36:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212608 - head/sbin/geom/class/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2010 11:36:26 -0000 Author: pjd Date: Tue Sep 14 11:36:26 2010 New Revision: 212608 URL: http://svn.freebsd.org/changeset/base/212608 Log: All gpart(8) subcommands apart from the 'bootcode' subcommand handle given geom/provider names with and without /dev/ prefix. Teach the 'bootcode' subcommand to handle /dev/ names as well. Modified: head/sbin/geom/class/part/geom_part.c Modified: head/sbin/geom/class/part/geom_part.c ============================================================================== --- head/sbin/geom/class/part/geom_part.c Tue Sep 14 11:19:21 2010 (r212607) +++ head/sbin/geom/class/part/geom_part.c Tue Sep 14 11:36:26 2010 (r212608) @@ -183,6 +183,8 @@ find_geom(struct gclass *classp, const c { struct ggeom *gp; + if (strncmp(name, _PATH_DEV, strlen(_PATH_DEV)) == 0) + name += strlen(_PATH_DEV); LIST_FOREACH(gp, &classp->lg_geom, lg_geom) { if (strcmp(gp->lg_name, name) == 0) return (gp); From owner-svn-src-head@FreeBSD.ORG Tue Sep 14 11:42:07 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B47441065674; Tue, 14 Sep 2010 11:42:07 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A42C88FC08; Tue, 14 Sep 2010 11:42:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8EBg7S3080553; Tue, 14 Sep 2010 11:42:07 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8EBg7Lk080551; Tue, 14 Sep 2010 11:42:07 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201009141142.o8EBg7Lk080551@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Tue, 14 Sep 2010 11:42:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212609 - head/sys/geom/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2010 11:42:07 -0000 Author: pjd Date: Tue Sep 14 11:42:07 2010 New Revision: 212609 URL: http://svn.freebsd.org/changeset/base/212609 Log: Simplify the code a bit. Modified: head/sys/geom/part/g_part.c Modified: head/sys/geom/part/g_part.c ============================================================================== --- head/sys/geom/part/g_part.c Tue Sep 14 11:36:26 2010 (r212608) +++ head/sys/geom/part/g_part.c Tue Sep 14 11:42:07 2010 (r212609) @@ -297,17 +297,14 @@ g_part_new_provider(struct g_geom *gp, s } static int -g_part_parm_geom(const char *rawname, struct g_geom **v) +g_part_parm_geom(const char *name, struct g_geom **v) { struct g_geom *gp; - const char *pname; - if (strncmp(rawname, _PATH_DEV, strlen(_PATH_DEV)) == 0) - pname = rawname + strlen(_PATH_DEV); - else - pname = rawname; + if (strncmp(name, _PATH_DEV, strlen(_PATH_DEV)) == 0) + name += strlen(_PATH_DEV); LIST_FOREACH(gp, &g_part_class.geom, geom) { - if (!strcmp(pname, gp->name)) + if (!strcmp(name, gp->name)) break; } if (gp == NULL) @@ -317,14 +314,13 @@ g_part_parm_geom(const char *rawname, st } static int -g_part_parm_provider(const char *pname, struct g_provider **v) +g_part_parm_provider(const char *name, struct g_provider **v) { struct g_provider *pp; - if (strncmp(pname, _PATH_DEV, strlen(_PATH_DEV)) == 0) - pp = g_provider_by_name(pname + strlen(_PATH_DEV)); - else - pp = g_provider_by_name(pname); + if (strncmp(name, _PATH_DEV, strlen(_PATH_DEV)) == 0) + name += strlen(_PATH_DEV); + pp = g_provider_by_name(name); if (pp == NULL) return (EINVAL); *v = pp; From owner-svn-src-head@FreeBSD.ORG Tue Sep 14 12:02:45 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E5F8F1065670; Tue, 14 Sep 2010 12:02:45 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 813928FC25; Tue, 14 Sep 2010 12:02:45 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 1CB2C45CA6; Tue, 14 Sep 2010 14:02:44 +0200 (CEST) Received: from localhost (pdawidek.whl [10.0.1.1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id A5E7545685; Tue, 14 Sep 2010 14:02:38 +0200 (CEST) Date: Tue, 14 Sep 2010 14:02:24 +0200 From: Pawel Jakub Dawidek To: Alexander Best Message-ID: <20100914120224.GJ1730@garage.freebsd.pl> References: <201009131348.o8DDmJL8004159@svn.freebsd.org> <20100913150654.GA23703@freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="YrQNB5Deg1WGKZi3" Content-Disposition: inline In-Reply-To: <20100913150654.GA23703@freebsd.org> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 9.0-CURRENT amd64 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-5.9 required=4.5 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.0.4 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r212554 - in head: sbin/geom/class/cache sbin/geom/class/concat sbin/geom/class/eli sbin/geom/class/journal sbin/geom/class/label sbin/geom/class/mirror sbin/geom/class/mountver sbin/ge... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2010 12:02:46 -0000 --YrQNB5Deg1WGKZi3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Sep 13, 2010 at 03:06:55PM +0000, Alexander Best wrote: > hi there, >=20 > could you take a quick peek at PR #150239 to see if the patch for g_part.= c is a > reasonable change? Yes, the current output was confusing to me as well. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --YrQNB5Deg1WGKZi3 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkyPZFAACgkQForvXbEpPzR96gCguSGPmCXZJ7VbTh4qWJJTQSKM 8QUAoK/4LZQW1NB7JhWt+E6+9XzP83kb =ouPM -----END PGP SIGNATURE----- --YrQNB5Deg1WGKZi3-- From owner-svn-src-head@FreeBSD.ORG Tue Sep 14 12:12:07 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E0D25106564A; Tue, 14 Sep 2010 12:12:07 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D0B938FC08; Tue, 14 Sep 2010 12:12:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8ECC7HF081145; Tue, 14 Sep 2010 12:12:07 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8ECC73X081143; Tue, 14 Sep 2010 12:12:07 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201009141212.o8ECC73X081143@svn.freebsd.org> From: Glen Barber Date: Tue, 14 Sep 2010 12:12:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212610 - head/sbin/newfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2010 12:12:08 -0000 Author: gjb (doc committer) Date: Tue Sep 14 12:12:07 2010 New Revision: 212610 URL: http://svn.freebsd.org/changeset/base/212610 Log: Synchronize newfs(8) manual with code. PR: 61716 Submitted by: Radim Kolar Patch by: arundel Approved by: keramida (mentor) MFC after: 1 week Modified: head/sbin/newfs/newfs.8 Modified: head/sbin/newfs/newfs.8 ============================================================================== --- head/sbin/newfs/newfs.8 Tue Sep 14 11:42:07 2010 (r212609) +++ head/sbin/newfs/newfs.8 Tue Sep 14 12:12:07 2010 (r212610) @@ -28,7 +28,7 @@ .\" @(#)newfs.8 8.6 (Berkeley) 5/3/95 .\" $FreeBSD$ .\" -.Dd March 21, 2008 +.Dd September 14, 2010 .Dt NEWFS 8 .Os .Sh NAME @@ -125,8 +125,9 @@ and the number of bytes per inode. .It Fl d Ar max-extent-size The file system may choose to store large files using extents. This parameter specifies the largest extent size that may be used. -It is presently limited to its default value which is 16 times -the file system blocksize. +The default value is the file system blocksize. +It is presently limited to a maximum value of 16 times the +file system blocksize and a minimum value of the file system blocksize. .It Fl e Ar maxbpg Indicate the maximum number of blocks any single file can allocate out of a cylinder group before it is forced to begin From owner-svn-src-head@FreeBSD.ORG Tue Sep 14 12:12:19 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1470D1065670; Tue, 14 Sep 2010 12:12:19 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0414F8FC14; Tue, 14 Sep 2010 12:12:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8ECCI1l081184; Tue, 14 Sep 2010 12:12:18 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8ECCInd081182; Tue, 14 Sep 2010 12:12:18 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201009141212.o8ECCInd081182@svn.freebsd.org> From: Martin Matuska Date: Tue, 14 Sep 2010 12:12:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212611 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2010 12:12:19 -0000 Author: mm Date: Tue Sep 14 12:12:18 2010 New Revision: 212611 URL: http://svn.freebsd.org/changeset/base/212611 Log: Remove duplicated VFS_HOLD due to a mismerge. PR: kern/150544 Approved by: delphij (mentor) MFC after: 1 day Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Tue Sep 14 12:12:07 2010 (r212610) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Tue Sep 14 12:12:18 2010 (r212611) @@ -1226,13 +1226,6 @@ zfs_mount(vfs_t *vfsp) if (error == 0 && ((zfsvfs_t *)vfsp->vfs_data)->z_issnap) VFS_HOLD(mvp->v_vfsp); - /* - * Add an extra VFS_HOLD on our parent vfs so that it can't - * disappear due to a forced unmount. - */ - if (error == 0 && ((zfsvfs_t *)vfsp->vfs_data)->z_issnap) - VFS_HOLD(mvp->v_vfsp); - out: return (error); } From owner-svn-src-head@FreeBSD.ORG Tue Sep 14 15:02:35 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4A126106564A; Tue, 14 Sep 2010 15:02:35 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail01.syd.optusnet.com.au (mail01.syd.optusnet.com.au [211.29.132.182]) by mx1.freebsd.org (Postfix) with ESMTP id D85768FC12; Tue, 14 Sep 2010 15:02:34 +0000 (UTC) Received: from c122-107-116-249.carlnfd1.nsw.optusnet.com.au (c122-107-116-249.carlnfd1.nsw.optusnet.com.au [122.107.116.249]) by mail01.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o8EF2VYC004248 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 15 Sep 2010 01:02:32 +1000 Date: Wed, 15 Sep 2010 01:02:31 +1000 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Pawel Jakub Dawidek In-Reply-To: <201009141119.o8EBJLKU080003@svn.freebsd.org> Message-ID: <20100915003923.B907@delplex.bde.org> References: <201009141119.o8EBJLKU080003@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r212607 - head/sbin/geom/core X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2010 15:02:35 -0000 On Tue, 14 Sep 2010, Pawel Jakub Dawidek wrote: > Log: > Remove dot which shouldn't be here, as err(3) will attach error message > at the end of the string. In KNF, error messages are neither capitalized or terminated by a dot, partly because of this. > Modified: head/sbin/geom/core/geom.c > ============================================================================== > --- head/sbin/geom/core/geom.c Tue Sep 14 11:13:46 2010 (r212606) > +++ head/sbin/geom/core/geom.c Tue Sep 14 11:19:21 2010 (r212607) > @@ -262,7 +262,7 @@ set_option(struct gctl_req *req, struct > if (G_OPT_TYPE(opt) == G_TYPE_NUMBER || > G_OPT_TYPE(opt) == G_TYPE_ASCNUM) { > if (expand_number(val, &number) == -1) { > - err(EXIT_FAILURE, "Invalid value for '%c' argument.", > + err(EXIT_FAILURE, "Invalid value for '%c' argument", > opt->go_char); > } > if (G_OPT_TYPE(opt) == G_TYPE_NUMBER) { > This message is still capitalized. Most other error messages in sbin/geom have same bugs. Dots too, though this fixes the last dot for err(). For errx() and warnx(), you can supply the dot without ensuring the punctuation/grammar error ".:", but this is still a style bug since it is not KNF and it is silly for the shorter error messages without an errno string to be capitalized while longer ones with an errno cannot be since err() has a fixed format not including the dot. For the capitalization, a capital letter after the prefix ": " is just a style bug. I think capitalization after ": " looks strange, especially after starting with a lower case program name. Then the errno string messes up the formatting a bit by always being capitalized. In bin/*/*.c 1 month ago, the KNF rule about not capitializing err(1, "Foo") is followed in approx. 66 lines and broken in just 7 lines (1 in cp and 6 in pkill), partly because of tree sweeps to unbreak this. In Lite2 it was followed in approx. 29 lines and broken in just 1 line (in rmail). Bruce From owner-svn-src-head@FreeBSD.ORG Tue Sep 14 16:19:09 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B56CC106564A; Tue, 14 Sep 2010 16:19:09 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A420D8FC08; Tue, 14 Sep 2010 16:19:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8EGJ9Lw086165; Tue, 14 Sep 2010 16:19:09 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8EGJ9jS086163; Tue, 14 Sep 2010 16:19:09 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201009141619.o8EGJ9jS086163@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Tue, 14 Sep 2010 16:19:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212613 - head/sbin/geom/class/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2010 16:19:09 -0000 Author: pjd Date: Tue Sep 14 16:19:09 2010 New Revision: 212613 URL: http://svn.freebsd.org/changeset/base/212613 Log: Update two last places where "arg0" should be used instead of "geom". Modified: head/sbin/geom/class/part/geom_part.c Modified: head/sbin/geom/class/part/geom_part.c ============================================================================== --- head/sbin/geom/class/part/geom_part.c Tue Sep 14 14:56:34 2010 (r212612) +++ head/sbin/geom/class/part/geom_part.c Tue Sep 14 16:19:09 2010 (r212613) @@ -302,7 +302,7 @@ gpart_autofill_resize(struct gctl_req *r cp = find_class(&mesh, s); if (cp == NULL) errx(EXIT_FAILURE, "Class %s not found.", s); - s = gctl_get_ascii(req, "geom"); + s = gctl_get_ascii(req, "arg0"); if (s == NULL) abort(); gp = find_geom(cp, s); @@ -411,7 +411,7 @@ gpart_autofill(struct gctl_req *req) cp = find_class(&mesh, s); if (cp == NULL) errx(EXIT_FAILURE, "Class %s not found.", s); - s = gctl_get_ascii(req, "geom"); + s = gctl_get_ascii(req, "arg0"); if (s == NULL) abort(); gp = find_geom(cp, s); From owner-svn-src-head@FreeBSD.ORG Tue Sep 14 16:21:13 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6C75E1065670; Tue, 14 Sep 2010 16:21:13 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 596E48FC23; Tue, 14 Sep 2010 16:21:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8EGLDVv086251; Tue, 14 Sep 2010 16:21:13 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8EGLDhr086248; Tue, 14 Sep 2010 16:21:13 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201009141621.o8EGLDhr086248@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Tue, 14 Sep 2010 16:21:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212614 - in head: sbin/geom/class/part sys/geom/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2010 16:21:13 -0000 Author: pjd Date: Tue Sep 14 16:21:13 2010 New Revision: 212614 URL: http://svn.freebsd.org/changeset/base/212614 Log: - Change all places where G_TYPE_ASCNUM is used to G_TYPE_NUMBER. It turns out the new type wasn't really needed. - Reorganize code a little bit. Modified: head/sbin/geom/class/part/geom_part.c head/sys/geom/part/g_part.c Modified: head/sbin/geom/class/part/geom_part.c ============================================================================== --- head/sbin/geom/class/part/geom_part.c Tue Sep 14 16:19:09 2010 (r212613) +++ head/sbin/geom/class/part/geom_part.c Tue Sep 14 16:21:13 2010 (r212614) @@ -90,7 +90,7 @@ struct g_command PUBSYM(class_commands)[ { 'b', "start", GPART_AUTOFILL, G_TYPE_STRING }, { 's', "size", GPART_AUTOFILL, G_TYPE_STRING }, { 't', "type", NULL, G_TYPE_STRING }, - { 'i', GPART_PARAM_INDEX, G_VAL_OPTIONAL, G_TYPE_ASCNUM }, + { 'i', GPART_PARAM_INDEX, G_VAL_OPTIONAL, G_TYPE_NUMBER }, { 'l', "label", G_VAL_OPTIONAL, G_TYPE_STRING }, { 'f', "flags", GPART_FLAGS, G_TYPE_STRING }, G_OPT_SENTINEL }, @@ -99,7 +99,7 @@ struct g_command PUBSYM(class_commands)[ { "bootcode", 0, gpart_bootcode, { { 'b', GPART_PARAM_BOOTCODE, G_VAL_OPTIONAL, G_TYPE_STRING }, { 'p', GPART_PARAM_PARTCODE, G_VAL_OPTIONAL, G_TYPE_STRING }, - { 'i', GPART_PARAM_INDEX, G_VAL_OPTIONAL, G_TYPE_ASCNUM }, + { 'i', GPART_PARAM_INDEX, G_VAL_OPTIONAL, G_TYPE_NUMBER }, { 'f', "flags", GPART_FLAGS, G_TYPE_STRING }, G_OPT_SENTINEL }, "bootcode [-b bootcode] [-p partcode] [-i index] [-f flags] geom" @@ -109,13 +109,13 @@ struct g_command PUBSYM(class_commands)[ }, { "create", 0, gpart_issue, { { 's', "scheme", NULL, G_TYPE_STRING }, - { 'n', "entries", G_VAL_OPTIONAL, G_TYPE_ASCNUM }, + { 'n', "entries", G_VAL_OPTIONAL, G_TYPE_NUMBER }, { 'f', "flags", GPART_FLAGS, G_TYPE_STRING }, G_OPT_SENTINEL }, "-s scheme [-n entries] [-f flags] provider" }, { "delete", 0, gpart_issue, { - { 'i', GPART_PARAM_INDEX, NULL, G_TYPE_ASCNUM }, + { 'i', GPART_PARAM_INDEX, NULL, G_TYPE_NUMBER }, { 'f', "flags", GPART_FLAGS, G_TYPE_STRING }, G_OPT_SENTINEL }, "-i index [-f flags] geom" @@ -126,7 +126,7 @@ struct g_command PUBSYM(class_commands)[ "[-f flags] geom" }, { "modify", 0, gpart_issue, { - { 'i', GPART_PARAM_INDEX, NULL, G_TYPE_ASCNUM }, + { 'i', GPART_PARAM_INDEX, NULL, G_TYPE_NUMBER }, { 'l', "label", G_VAL_OPTIONAL, G_TYPE_STRING }, { 't', "type", G_VAL_OPTIONAL, G_TYPE_STRING }, { 'f', "flags", GPART_FLAGS, G_TYPE_STRING }, @@ -135,7 +135,7 @@ struct g_command PUBSYM(class_commands)[ }, { "set", 0, gpart_issue, { { 'a', "attrib", NULL, G_TYPE_STRING }, - { 'i', GPART_PARAM_INDEX, NULL, G_TYPE_ASCNUM }, + { 'i', GPART_PARAM_INDEX, NULL, G_TYPE_NUMBER }, { 'f', "flags", GPART_FLAGS, G_TYPE_STRING }, G_OPT_SENTINEL }, "-a attrib -i index [-f flags] geom" @@ -151,14 +151,14 @@ struct g_command PUBSYM(class_commands)[ }, { "unset", 0, gpart_issue, { { 'a', "attrib", NULL, G_TYPE_STRING }, - { 'i', GPART_PARAM_INDEX, NULL, G_TYPE_ASCNUM }, + { 'i', GPART_PARAM_INDEX, NULL, G_TYPE_NUMBER }, { 'f', "flags", GPART_FLAGS, G_TYPE_STRING }, G_OPT_SENTINEL }, "-a attrib -i index [-f flags] geom" }, { "resize", 0, gpart_issue, { { 's', "size", GPART_AUTOFILL, G_TYPE_STRING }, - { 'i', GPART_PARAM_INDEX, NULL, G_TYPE_ASCNUM }, + { 'i', GPART_PARAM_INDEX, NULL, G_TYPE_NUMBER }, { 'f', "flags", GPART_FLAGS, G_TYPE_STRING }, G_OPT_SENTINEL }, "[-s size] -i index [-f flags] geom" Modified: head/sys/geom/part/g_part.c ============================================================================== --- head/sys/geom/part/g_part.c Tue Sep 14 16:19:09 2010 (r212613) +++ head/sys/geom/part/g_part.c Tue Sep 14 16:21:13 2010 (r212614) @@ -297,86 +297,155 @@ g_part_new_provider(struct g_geom *gp, s } static int -g_part_parm_geom(const char *name, struct g_geom **v) +g_part_parm_geom(struct gctl_req *req, const char *name, struct g_geom **v) { struct g_geom *gp; + const char *gname; - if (strncmp(name, _PATH_DEV, strlen(_PATH_DEV)) == 0) - name += strlen(_PATH_DEV); + gname = gctl_get_asciiparam(req, name); + if (gname == NULL) + return (ENOATTR); + if (strncmp(gname, _PATH_DEV, strlen(_PATH_DEV)) == 0) + gname += strlen(_PATH_DEV); LIST_FOREACH(gp, &g_part_class.geom, geom) { - if (!strcmp(name, gp->name)) + if (!strcmp(gname, gp->name)) break; } - if (gp == NULL) + if (gp == NULL) { + gctl_error(req, "%d %s '%s'", EINVAL, name, gname); return (EINVAL); + } *v = gp; return (0); } static int -g_part_parm_provider(const char *name, struct g_provider **v) +g_part_parm_provider(struct gctl_req *req, const char *name, + struct g_provider **v) { struct g_provider *pp; + const char *pname; - if (strncmp(name, _PATH_DEV, strlen(_PATH_DEV)) == 0) - name += strlen(_PATH_DEV); - pp = g_provider_by_name(name); - if (pp == NULL) + pname = gctl_get_asciiparam(req, name); + if (pname == NULL) + return (ENOATTR); + if (strncmp(pname, _PATH_DEV, strlen(_PATH_DEV)) == 0) + pname += strlen(_PATH_DEV); + pp = g_provider_by_name(pname); + if (pp == NULL) { + gctl_error(req, "%d %s '%s'", EINVAL, name, pname); return (EINVAL); + } *v = pp; return (0); } static int -g_part_parm_quad(const char *p, quad_t *v) +g_part_parm_quad(struct gctl_req *req, const char *name, quad_t *v) { + const char *p; char *x; quad_t q; + p = gctl_get_asciiparam(req, name); + if (p == NULL) + return (ENOATTR); q = strtoq(p, &x, 0); - if (*x != '\0' || q < 0) + if (*x != '\0' || q < 0) { + gctl_error(req, "%d %s '%s'", EINVAL, name, p); return (EINVAL); + } *v = q; return (0); } static int -g_part_parm_scheme(const char *p, struct g_part_scheme **v) +g_part_parm_scheme(struct gctl_req *req, const char *name, + struct g_part_scheme **v) { struct g_part_scheme *s; + const char *p; + p = gctl_get_asciiparam(req, name); + if (p == NULL) + return (ENOATTR); TAILQ_FOREACH(s, &g_part_schemes, scheme_list) { if (s == &g_part_null_scheme) continue; if (!strcasecmp(s->name, p)) break; } - if (s == NULL) + if (s == NULL) { + gctl_error(req, "%d %s '%s'", EINVAL, name, p); return (EINVAL); + } *v = s; return (0); } static int -g_part_parm_str(const char *p, const char **v) +g_part_parm_str(struct gctl_req *req, const char *name, const char **v) { + const char *p; - if (p[0] == '\0') + p = gctl_get_asciiparam(req, name); + if (p == NULL) + return (ENOATTR); + /* An empty label is always valid. */ + if (strcmp(name, "label") != 0 && p[0] == '\0') { + gctl_error(req, "%d %s '%s'", EINVAL, name, p); return (EINVAL); + } *v = p; return (0); } static int -g_part_parm_uint(const char *p, u_int *v) +g_part_parm_intmax(struct gctl_req *req, const char *name, u_int *v) { - char *x; - long l; + const intmax_t *p; + int size; - l = strtol(p, &x, 0); - if (*x != '\0' || l < 0 || l > INT_MAX) + p = gctl_get_param(req, name, &size); + if (p == NULL) + return (ENOATTR); + if (size != sizeof(*p) || *p < 0 || *p > INT_MAX) { + gctl_error(req, "%d %s '%jd'", EINVAL, name, *p); return (EINVAL); - *v = (unsigned int)l; + } + *v = (u_int)*p; + return (0); +} + +static int +g_part_parm_uint32(struct gctl_req *req, const char *name, u_int *v) +{ + const uint32_t *p; + int size; + + p = gctl_get_param(req, name, &size); + if (p == NULL) + return (ENOATTR); + if (size != sizeof(*p) || *p > INT_MAX) { + gctl_error(req, "%d %s '%u'", EINVAL, name, (unsigned int)*p); + return (EINVAL); + } + *v = (u_int)*p; + return (0); +} + +static int +g_part_parm_bootcode(struct gctl_req *req, const char *name, const void **v, + unsigned int *s) +{ + const void *p; + int size; + + p = gctl_get_param(req, name, &size); + if (p == NULL) + return (ENOATTR); + *v = p; + *s = size; return (0); } @@ -679,7 +748,7 @@ g_part_ctl_create(struct gctl_req *req, g_topology_assert(); /* Check that there isn't already a g_part geom on the provider. */ - error = g_part_parm_geom(pp->name, &gp); + error = g_part_parm_geom(req, "provider", &gp); if (!error) { null = gp->softc; if (null->gpt_scheme != &g_part_null_scheme) { @@ -1225,11 +1294,10 @@ g_part_ctlreq(struct gctl_req *req, stru struct g_part_parms gpp; struct g_part_table *table; struct gctl_req_arg *ap; - const char *p; enum g_part_ctl ctlreq; unsigned int i, mparms, oparms, parm; int auto_commit, close_on_error; - int error, len, modifies; + int error, modifies; G_PART_TRACE((G_T_TOPOLOGY, "%s(%s,%s)", __func__, mp->name, verb)); g_topology_assert(); @@ -1381,69 +1449,64 @@ g_part_ctlreq(struct gctl_req *req, stru gctl_error(req, "%d param '%s'", EINVAL, ap->name); return; } - if (parm == G_PART_PARM_BOOTCODE) - p = gctl_get_param(req, ap->name, &len); - else - p = gctl_get_asciiparam(req, ap->name); - if (p == NULL) { - gctl_error(req, "%d param '%s'", ENOATTR, ap->name); - return; - } switch (parm) { case G_PART_PARM_ATTRIB: - error = g_part_parm_str(p, &gpp.gpp_attrib); + error = g_part_parm_str(req, ap->name, &gpp.gpp_attrib); break; case G_PART_PARM_BOOTCODE: - gpp.gpp_codeptr = p; - gpp.gpp_codesize = len; - error = 0; + error = g_part_parm_bootcode(req, ap->name, + &gpp.gpp_codeptr, &gpp.gpp_codesize); break; case G_PART_PARM_ENTRIES: - error = g_part_parm_uint(p, &gpp.gpp_entries); + error = g_part_parm_intmax(req, ap->name, + &gpp.gpp_entries); break; case G_PART_PARM_FLAGS: - if (p[0] == '\0') - continue; - error = g_part_parm_str(p, &gpp.gpp_flags); + error = g_part_parm_str(req, ap->name, &gpp.gpp_flags); break; case G_PART_PARM_GEOM: - error = g_part_parm_geom(p, &gpp.gpp_geom); + error = g_part_parm_geom(req, ap->name, &gpp.gpp_geom); break; case G_PART_PARM_INDEX: - error = g_part_parm_uint(p, &gpp.gpp_index); + error = g_part_parm_intmax(req, ap->name, &gpp.gpp_index); break; case G_PART_PARM_LABEL: - /* An empty label is always valid. */ - gpp.gpp_label = p; - error = 0; + error = g_part_parm_str(req, ap->name, &gpp.gpp_label); break; case G_PART_PARM_OUTPUT: error = 0; /* Write-only parameter */ break; case G_PART_PARM_PROVIDER: - error = g_part_parm_provider(p, &gpp.gpp_provider); + error = g_part_parm_provider(req, ap->name, + &gpp.gpp_provider); break; case G_PART_PARM_SCHEME: - error = g_part_parm_scheme(p, &gpp.gpp_scheme); + error = g_part_parm_scheme(req, ap->name, + &gpp.gpp_scheme); break; case G_PART_PARM_SIZE: - error = g_part_parm_quad(p, &gpp.gpp_size); + error = g_part_parm_quad(req, ap->name, &gpp.gpp_size); break; case G_PART_PARM_START: - error = g_part_parm_quad(p, &gpp.gpp_start); + error = g_part_parm_quad(req, ap->name, &gpp.gpp_start); break; case G_PART_PARM_TYPE: - error = g_part_parm_str(p, &gpp.gpp_type); + error = g_part_parm_str(req, ap->name, &gpp.gpp_type); break; case G_PART_PARM_VERSION: - error = g_part_parm_uint(p, &gpp.gpp_version); + error = g_part_parm_uint32(req, ap->name, + &gpp.gpp_version); break; default: error = EDOOFUS; + gctl_error(req, "%d %s", error, ap->name); break; } - if (error) { - gctl_error(req, "%d %s '%s'", error, ap->name, p); + if (error != 0) { + if (error == ENOATTR) { + gctl_error(req, "%d param '%s'", error, + ap->name); + } return; } gpp.gpp_parms |= parm; From owner-svn-src-head@FreeBSD.ORG Tue Sep 14 16:22:22 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ED97A1065679; Tue, 14 Sep 2010 16:22:22 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DCBC28FC22; Tue, 14 Sep 2010 16:22:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8EGMMlg086326; Tue, 14 Sep 2010 16:22:22 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8EGMMRP086323; Tue, 14 Sep 2010 16:22:22 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201009141622.o8EGMMRP086323@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Tue, 14 Sep 2010 16:22:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212615 - head/sbin/geom/core X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2010 16:22:23 -0000 Author: pjd Date: Tue Sep 14 16:22:22 2010 New Revision: 212615 URL: http://svn.freebsd.org/changeset/base/212615 Log: Remove now unused G_TYPE_ASCNUM. Modified: head/sbin/geom/core/geom.c head/sbin/geom/core/geom.h Modified: head/sbin/geom/core/geom.c ============================================================================== --- head/sbin/geom/core/geom.c Tue Sep 14 16:21:13 2010 (r212614) +++ head/sbin/geom/core/geom.c Tue Sep 14 16:22:22 2010 (r212615) @@ -259,8 +259,7 @@ set_option(struct gctl_req *req, struct optname = opt->go_name; } - if (G_OPT_TYPE(opt) == G_TYPE_NUMBER || - G_OPT_TYPE(opt) == G_TYPE_ASCNUM) { + if (G_OPT_TYPE(opt) == G_TYPE_NUMBER) { if (expand_number(val, &number) == -1) { err(EXIT_FAILURE, "Invalid value for '%c' argument", opt->go_char); Modified: head/sbin/geom/core/geom.h ============================================================================== --- head/sbin/geom/core/geom.h Tue Sep 14 16:21:13 2010 (r212614) +++ head/sbin/geom/core/geom.h Tue Sep 14 16:22:22 2010 (r212615) @@ -38,7 +38,6 @@ #define G_TYPE_BOOL 0x01 #define G_TYPE_STRING 0x02 #define G_TYPE_NUMBER 0x03 -#define G_TYPE_ASCNUM 0x04 #define G_TYPE_MASK 0x0f #define G_TYPE_DONE 0x10 #define G_TYPE_MULTI 0x20 From owner-svn-src-head@FreeBSD.ORG Tue Sep 14 17:22:07 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5465D1065674; Tue, 14 Sep 2010 17:22:07 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 42ECC8FC26; Tue, 14 Sep 2010 17:22:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8EHM7TR087611; Tue, 14 Sep 2010 17:22:07 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8EHM7Vw087609; Tue, 14 Sep 2010 17:22:07 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201009141722.o8EHM7Vw087609@svn.freebsd.org> From: "Kenneth D. Merry" Date: Tue, 14 Sep 2010 17:22:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212616 - head/sys/dev/mps X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2010 17:22:07 -0000 Author: ken Date: Tue Sep 14 17:22:06 2010 New Revision: 212616 URL: http://svn.freebsd.org/changeset/base/212616 Log: MFp4: (//depot/projects/mps/...) Report data overruns properly. Submitted by: scottl Modified: head/sys/dev/mps/mps_sas.c Modified: head/sys/dev/mps/mps_sas.c ============================================================================== --- head/sys/dev/mps/mps_sas.c Tue Sep 14 16:22:22 2010 (r212615) +++ head/sys/dev/mps/mps_sas.c Tue Sep 14 17:22:06 2010 (r212616) @@ -1219,11 +1219,9 @@ mpssas_scsiio_complete(struct mps_softc ccb->ccb_h.status = CAM_REQ_CMP; break; case MPI2_IOCSTATUS_SCSI_DATA_OVERRUN: - /* - * XXX any way to report this? - */ + /* resid is ignored for this condition */ ccb->csio.resid = 0; - ccb->ccb_h.status = CAM_REQ_CMP; + ccb->ccb_h.status = CAM_DATA_RUN_ERR; break; case MPI2_IOCSTATUS_SCSI_INVALID_DEVHANDLE: case MPI2_IOCSTATUS_SCSI_DEVICE_NOT_THERE: From owner-svn-src-head@FreeBSD.ORG Tue Sep 14 18:04:05 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A0BF8106566B; Tue, 14 Sep 2010 18:04:05 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8D4E08FC08; Tue, 14 Sep 2010 18:04:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8EI45M7088470; Tue, 14 Sep 2010 18:04:05 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8EI45kp088466; Tue, 14 Sep 2010 18:04:05 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201009141804.o8EI45kp088466@svn.freebsd.org> From: Kirk McKusick Date: Tue, 14 Sep 2010 18:04:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212617 - head/sys/ufs/ffs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2010 18:04:05 -0000 Author: mckusick Date: Tue Sep 14 18:04:05 2010 New Revision: 212617 URL: http://svn.freebsd.org/changeset/base/212617 Log: Update comments in soft updates code to more fully describe the addition of journalling. Only functional change is to tighten a KASSERT. Reviewed by: jeff Roberson Modified: head/sys/ufs/ffs/ffs_softdep.c head/sys/ufs/ffs/fs.h head/sys/ufs/ffs/softdep.h Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Tue Sep 14 17:22:06 2010 (r212616) +++ head/sys/ufs/ffs/ffs_softdep.c Tue Sep 14 18:04:05 2010 (r212617) @@ -2378,7 +2378,8 @@ remove_from_journal(wk) /* * We emulate a TAILQ to save space in most structures which do not * require TAILQ semantics. Here we must update the tail position - * when removing the tail which is not the final entry. + * when removing the tail which is not the final entry. This works + * only if the worklist linkage are at the beginning of the structure. */ if (ump->softdep_journal_tail == wk) ump->softdep_journal_tail = @@ -2605,7 +2606,7 @@ jremref_write(jremref, jseg, data) inoref_write(&jremref->jr_ref, jseg, rec); } -static void +static void jmvref_write(jmvref, jseg, data) struct jmvref *jmvref; struct jseg *jseg; @@ -2906,9 +2907,9 @@ complete_jseg(jseg) waiting = wk->wk_state & IOWAITING; wk->wk_state &= ~(IOSTARTED | IOWAITING); wk->wk_state |= COMPLETE; - KASSERT(i < jseg->js_cnt, + KASSERT(i++ < jseg->js_cnt, ("handle_written_jseg: overflow %d >= %d", - i, jseg->js_cnt)); + i - 1, jseg->js_cnt)); switch (wk->wk_type) { case D_JADDREF: handle_written_jaddref(WK_JADDREF(wk)); @@ -7492,7 +7493,7 @@ handle_written_sbdep(sbdep, bp) if (inodedep_lookup(mp, fs->fs_sujfree, 0, &inodedep) == 0) panic("handle_written_sbdep: lost inodedep"); /* - * Now that we have a record of this indode in stable store allow it + * Now that we have a record of this inode in stable store allow it * to be written to free up pending work. Inodes may see a lot of * write activity after they are unlinked which we must not hold up. */ @@ -7509,8 +7510,7 @@ handle_written_sbdep(sbdep, bp) } /* - * Mark an inodedep has unlinked and insert it into the in-memory unlinked - * list. + * Mark an inodedep as unlinked and insert it into the in-memory unlinked list. */ static void unlinked_inodedep(mp, inodedep) @@ -7576,7 +7576,7 @@ clear_unlinked_inodedep(inodedep) * link before us, whether it be the superblock or an inode. * Unfortunately the list may change while we're waiting * on the buf lock for either resource so we must loop until - * we lock. the right one. If both the superblock and an + * we lock the right one. If both the superblock and an * inode point to this inode we must clear the inode first * followed by the superblock. */ @@ -9094,7 +9094,7 @@ handle_jwork(wkhd) /* * Handle the bufwait list on an inode when it is safe to release items * held there. This normally happens after an inode block is written but - * may be delayed and handle later if there are pending journal items that + * may be delayed and handled later if there are pending journal items that * are not yet safe to be released. */ static struct freefile * Modified: head/sys/ufs/ffs/fs.h ============================================================================== --- head/sys/ufs/ffs/fs.h Tue Sep 14 17:22:06 2010 (r212616) +++ head/sys/ufs/ffs/fs.h Tue Sep 14 18:04:05 2010 (r212617) @@ -661,7 +661,7 @@ lbn_level(ufs_lbn_t lbn) /* * Size of the segment record header. There is at most one for each disk - * block n the journal. The segment header is followed by an array of + * block in the journal. The segment header is followed by an array of * records. fsck depends on the first element in each record being 'op' * and the second being 'ino'. Segments may span multiple disk blocks but * the header is present on each. Modified: head/sys/ufs/ffs/softdep.h ============================================================================== --- head/sys/ufs/ffs/softdep.h Tue Sep 14 17:22:06 2010 (r212616) +++ head/sys/ufs/ffs/softdep.h Tue Sep 14 18:04:05 2010 (r212617) @@ -107,6 +107,15 @@ * * The ONWORKLIST flag shows whether the structure is currently linked * onto a worklist. + * + * The UNLINK* flags track the progress of updating the on-disk linked + * list of active but unlinked inodes. When an inode is first unlinked + * it is marked as UNLINKED. When its on-disk di_freelink has been + * written its UNLINKNEXT flags is set. When its predecessor in the + * list has its di_freelink pointing at us its UNLINKPREV is set. + * When the on-disk list can reach it from the superblock, its + * UNLINKONLIST flag is set. Once all of these flags are set, it + * is safe to let its last name be removed. */ #define ATTACHED 0x000001 #define UNDONE 0x000002 @@ -353,20 +362,22 @@ struct bmsafemap { * or fragment is allocated from a cylinder group. Its state is set to * DEPCOMPLETE when its cylinder group map is written. It is converted to * an allocdirect or allocindir allocation once the allocator calls the - * appropriate setup function. + * appropriate setup function. It will initially be linked onto a bmsafemap + * list. Once converted it can be linked onto the lists described for + * allocdirect or allocindir as described below. */ struct newblk { - struct worklist nb_list; + struct worklist nb_list; /* See comment above. */ # define nb_state nb_list.wk_state - LIST_ENTRY(newblk) nb_hash; /* hashed lookup */ - LIST_ENTRY(newblk) nb_deps; /* bmsafemap's list of newblks */ + LIST_ENTRY(newblk) nb_hash; /* Hashed lookup. */ + LIST_ENTRY(newblk) nb_deps; /* Bmsafemap's list of newblks. */ struct jnewblk *nb_jnewblk; /* New block journal entry. */ - struct bmsafemap *nb_bmsafemap;/* cylgrp dep (if pending) */ - struct freefrag *nb_freefrag; /* fragment to be freed (if any) */ + struct bmsafemap *nb_bmsafemap;/* Cylgrp dep (if pending). */ + struct freefrag *nb_freefrag; /* Fragment to be freed (if any). */ struct indirdephd nb_indirdeps; /* Children indirect blocks. */ - struct workhead nb_newdirblk; /* dir block to notify when written */ + struct workhead nb_newdirblk; /* Dir block to notify when written. */ struct workhead nb_jwork; /* Journal work pending. */ - ufs2_daddr_t nb_newblkno; /* new value of block pointer */ + ufs2_daddr_t nb_newblkno; /* New value of block pointer. */ }; /* @@ -517,16 +528,16 @@ struct freeblks { /* * A "freework" structure handles the release of a tree of blocks or a single * block. Each indirect block in a tree is allocated its own freework - * structure so that the indrect block may be freed only when all of its + * structure so that the indirect block may be freed only when all of its * children are freed. In this way we enforce the rule that an allocated * block must have a valid path to a root that is journaled. Each child * block acquires a reference and when the ref hits zero the parent ref * is decremented. If there is no parent the freeblks ref is decremented. */ struct freework { - struct worklist fw_list; + struct worklist fw_list; /* Delayed worklist. */ # define fw_state fw_list.wk_state - LIST_ENTRY(freework) fw_next; /* Queue for freeblksk. */ + LIST_ENTRY(freework) fw_next; /* Queue for freeblk list. */ struct freeblks *fw_freeblks; /* Root of operation. */ struct freework *fw_parent; /* Parent indirect. */ ufs2_daddr_t fw_blkno; /* Our block #. */ @@ -545,7 +556,7 @@ struct freework { * to be freed as well. */ struct freedep { - struct worklist fd_list; + struct worklist fd_list; /* Delayed worklist. */ struct freework *fd_freework; /* Parent freework. */ }; @@ -705,10 +716,10 @@ struct newdirblk { * so they may easily be queued in-order on the inodedep. */ struct inoref { - struct worklist if_list; + struct worklist if_list; /* Journal pending or jseg entries. */ # define if_state if_list.wk_state TAILQ_ENTRY(inoref) if_deps; /* Links for inodedep. */ - struct jsegdep *if_jsegdep; + struct jsegdep *if_jsegdep; /* Will track our journal record. */ off_t if_diroff; /* Directory offset. */ ino_t if_ino; /* Inode number. */ ino_t if_parent; /* Parent inode number. */ @@ -731,8 +742,8 @@ struct inoref { * ultimately released when the file is freed or the link is dropped again. */ struct jaddref { - struct inoref ja_ref; -# define ja_list ja_ref.if_list /* Journal pending or jseg entries. */ + struct inoref ja_ref; /* see inoref above. */ +# define ja_list ja_ref.if_list /* Jrnl pending, id_inowait, dm_jwork.*/ # define ja_state ja_ref.if_list.wk_state LIST_ENTRY(jaddref) ja_bmdeps; /* Links for bmsafemap. */ union { @@ -754,21 +765,28 @@ struct jaddref { * may proceed as normal. */ struct jremref { - struct inoref jr_ref; -# define jr_list jr_ref.if_list /* Journal pending or jseg entries. */ + struct inoref jr_ref; /* see inoref above. */ +# define jr_list jr_ref.if_list /* Linked to softdep_journal_pending. */ # define jr_state jr_ref.if_list.wk_state - LIST_ENTRY(jremref) jr_deps; /* Links for pagdep. */ + LIST_ENTRY(jremref) jr_deps; /* Links for dirrem. */ struct dirrem *jr_dirrem; /* Back pointer to dirrem. */ }; +/* + * A "jmvref" structure tracks a name relocations within the same + * directory block that occur as a result of directory compaction. + * It prevents the updated directory entry from being written to disk + * until the journal entry is written. Once the journal has been + * written the compacted directory may be written to disk. + */ struct jmvref { - struct worklist jm_list; - LIST_ENTRY(jmvref) jm_deps; - struct pagedep *jm_pagedep; - ino_t jm_parent; - ino_t jm_ino; - off_t jm_oldoff; - off_t jm_newoff; + struct worklist jm_list; /* Linked to softdep_journal_pending. */ + LIST_ENTRY(jmvref) jm_deps; /* Jmvref on pagedep. */ + struct pagedep *jm_pagedep; /* Back pointer to pagedep. */ + ino_t jm_parent; /* Containing directory inode number. */ + ino_t jm_ino; /* Inode number of our entry. */ + off_t jm_oldoff; /* Our old offset in directory. */ + off_t jm_newoff; /* Our new offset in directory. */ }; /* @@ -780,36 +798,37 @@ struct jmvref { * write the jnewblk structure is maintained to prevent the bitmaps from * reaching the disk. Ultimately the jnewblk structure will be passed * to the free routine as the in memory cg is modified back to the free - * state at which time it can be released. + * state at which time it can be released. It may be held on any of the + * fx_jwork, fw_jwork, fb_jwork, ff_jwork, nb_jwork, or ir_jwork lists. */ struct jnewblk { - struct worklist jn_list; + struct worklist jn_list; /* See lists above. */ # define jn_state jn_list.wk_state - struct jsegdep *jn_jsegdep; - LIST_ENTRY(jnewblk) jn_deps; /* All jnewblks on bmsafemap */ - struct newblk *jn_newblk; - ino_t jn_ino; - ufs_lbn_t jn_lbn; - ufs2_daddr_t jn_blkno; - int jn_oldfrags; - int jn_frags; + struct jsegdep *jn_jsegdep; /* Will track our journal record. */ + LIST_ENTRY(jnewblk) jn_deps; /* Jnewblks on sm_jnewblkhd. */ + struct newblk *jn_newblk; /* Back pointer to newblk. */ + ino_t jn_ino; /* Ino to which allocated. */ + ufs_lbn_t jn_lbn; /* Lbn to which allocated. */ + ufs2_daddr_t jn_blkno; /* Blkno allocated */ + int jn_oldfrags; /* Previous fragments when extended. */ + int jn_frags; /* Number of fragments. */ }; /* * A "jfreeblk" structure tracks the journal write for freeing a block * or tree of blocks. The block pointer must not be cleared in the inode - * or indirect prior to the jfreeblk being written. + * or indirect prior to the jfreeblk being written to the journal. */ struct jfreeblk { - struct worklist jf_list; + struct worklist jf_list; /* Linked to softdep_journal_pending. */ # define jf_state jf_list.wk_state - struct jsegdep *jf_jsegdep; - struct freeblks *jf_freeblks; - LIST_ENTRY(jfreeblk) jf_deps; - ino_t jf_ino; - ufs_lbn_t jf_lbn; - ufs2_daddr_t jf_blkno; - int jf_frags; + struct jsegdep *jf_jsegdep; /* Will track our journal record. */ + struct freeblks *jf_freeblks; /* Back pointer to freeblks. */ + LIST_ENTRY(jfreeblk) jf_deps; /* Jfreeblk on fb_jfreeblkhd. */ + ino_t jf_ino; /* Ino from which blocks freed. */ + ufs_lbn_t jf_lbn; /* Lbn from which blocks freed. */ + ufs2_daddr_t jf_blkno; /* Blkno being freed. */ + int jf_frags; /* Number of frags being freed. */ }; /* @@ -818,14 +837,14 @@ struct jfreeblk { * freeblks operation. */ struct jfreefrag { - struct worklist fr_list; + struct worklist fr_list; /* Linked to softdep_journal_pending. */ # define fr_state fr_list.wk_state - struct jsegdep *fr_jsegdep; - struct freefrag *fr_freefrag; - ino_t fr_ino; - ufs_lbn_t fr_lbn; - ufs2_daddr_t fr_blkno; - int fr_frags; + struct jsegdep *fr_jsegdep; /* Will track our journal record. */ + struct freefrag *fr_freefrag; /* Back pointer to freefrag. */ + ino_t fr_ino; /* Ino from which frag freed. */ + ufs_lbn_t fr_lbn; /* Lbn from which frag freed. */ + ufs2_daddr_t fr_blkno; /* Blkno being freed. */ + int fr_frags; /* Size of frag being freed. */ }; /* @@ -835,42 +854,45 @@ struct jfreefrag { * is complete and the truncated inode is fsync'd. */ struct jtrunc { - struct worklist jt_list; - struct jsegdep *jt_jsegdep; - ino_t jt_ino; - off_t jt_size; - int jt_extsize; + struct worklist jt_list; /* Linked to softdep_journal_pending. */ + struct jsegdep *jt_jsegdep; /* Will track our journal record. */ + ino_t jt_ino; /* Ino being truncated. */ + off_t jt_size; /* Final file size. */ + int jt_extsize; /* Final extent size. */ }; /* * A "jsegdep" structure tracks a single reference to a written journal * segment so the journal space can be reclaimed when all dependencies - * have been written. + * have been written. It can hang off of id_inowait, dm_jwork, da_jwork, + * nb_jwork, ff_jwork, or fb_jwork lists. */ struct jsegdep { - struct worklist jd_list; + struct worklist jd_list; /* See above for lists. */ # define jd_state jd_list.wk_state - struct jseg *jd_seg; + struct jseg *jd_seg; /* Our journal record. */ }; /* * A "jseg" structure contains all of the journal records written in a - * single disk write. jaddref and jremref structures are linked into + * single disk write. The jaddref and jremref structures are linked into * js_entries so thay may be completed when the write completes. The - * js_deps array contains as many entries as there are ref counts to - * reduce the number of allocations required per journal write to one. + * js_entries also include the write dependency structures: jmvref, + * jnewblk, jfreeblk, jfreefrag, and jtrunc. The js_refs field counts + * the number of entries on the js_entries list. Thus there is a single + * jseg entry to describe each journal write. */ struct jseg { struct worklist js_list; /* b_deps link for journal */ # define js_state js_list.wk_state struct workhead js_entries; /* Entries awaiting write */ - TAILQ_ENTRY(jseg) js_next; + TAILQ_ENTRY(jseg) js_next; /* List of all unfinished segments. */ struct jblocks *js_jblocks; /* Back pointer to block/seg list */ struct buf *js_buf; /* Buffer while unwritten */ - uint64_t js_seq; - int js_size; /* Allocated size in bytes */ - int js_cnt; /* Total items allocated */ - int js_refs; /* Count of items pending completion */ + uint64_t js_seq; /* Journal record sequence number. */ + int js_size; /* Size of journal record in bytes. */ + int js_cnt; /* Total items allocated. */ + int js_refs; /* Count of js_entries items. */ }; /* @@ -878,10 +900,11 @@ struct jseg { * superblock writes. This makes sure the superblock is always pointing at * the first possible unlinked inode for the suj recovery process. If a * block write completes and we discover a new head is available the buf - * is dirtied and the dep is kept. + * is dirtied and the dep is kept. See the description of the UNLINK* + * flags above for more details. */ struct sbdep { struct worklist sb_list; /* b_dep linkage */ struct fs *sb_fs; /* Filesystem pointer within buf. */ - struct ufsmount *sb_ump; + struct ufsmount *sb_ump; /* Our mount structure */ }; From owner-svn-src-head@FreeBSD.ORG Tue Sep 14 18:58:52 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3E7CE106566C; Tue, 14 Sep 2010 18:58:52 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2C9D18FC20; Tue, 14 Sep 2010 18:58:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8EIwq27089844; Tue, 14 Sep 2010 18:58:52 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8EIwqNP089842; Tue, 14 Sep 2010 18:58:52 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201009141858.o8EIwqNP089842@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 14 Sep 2010 18:58:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212618 - head/sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2010 18:58:52 -0000 Author: kib Date: Tue Sep 14 18:58:51 2010 New Revision: 212618 URL: http://svn.freebsd.org/changeset/base/212618 Log: Rename the field to not confuse readers. The bytes are actually used. Discussed with: rmacklem MFC after: 1 week Modified: head/sys/sys/mount.h Modified: head/sys/sys/mount.h ============================================================================== --- head/sys/sys/mount.h Tue Sep 14 18:04:05 2010 (r212617) +++ head/sys/sys/mount.h Tue Sep 14 18:58:51 2010 (r212618) @@ -56,7 +56,7 @@ typedef struct fsid { int32_t val[2]; } struct fid { u_short fid_len; /* length of data in bytes */ - u_short fid_reserved; /* force longword alignment */ + u_short fid_data0; /* force longword alignment */ char fid_data[MAXFIDSZ]; /* data (variable length) */ }; From owner-svn-src-head@FreeBSD.ORG Tue Sep 14 19:35:43 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DA85E106566B; Tue, 14 Sep 2010 19:35:43 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C84548FC1F; Tue, 14 Sep 2010 19:35:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8EJZhWH090638; Tue, 14 Sep 2010 19:35:43 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8EJZhxp090635; Tue, 14 Sep 2010 19:35:43 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201009141935.o8EJZhxp090635@svn.freebsd.org> From: Marius Strobl Date: Tue, 14 Sep 2010 19:35:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212619 - head/sys/sparc64/sparc64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2010 19:35:44 -0000 Author: marius Date: Tue Sep 14 19:35:43 2010 New Revision: 212619 URL: http://svn.freebsd.org/changeset/base/212619 Log: Remove redundant raising of the PIL to PIL_TICK as the respective locore code already did that. Modified: head/sys/sparc64/sparc64/machdep.c head/sys/sparc64/sparc64/mp_machdep.c Modified: head/sys/sparc64/sparc64/machdep.c ============================================================================== --- head/sys/sparc64/sparc64/machdep.c Tue Sep 14 18:58:51 2010 (r212618) +++ head/sys/sparc64/sparc64/machdep.c Tue Sep 14 19:35:43 2010 (r212619) @@ -587,7 +587,6 @@ sparc64_init(caddr_t mdp, u_long o1, u_l * enable them. */ intr_init2(); - wrpr(pil, 0, PIL_TICK); wrpr(pstate, 0, PSTATE_KERNEL); /* Modified: head/sys/sparc64/sparc64/mp_machdep.c ============================================================================== --- head/sys/sparc64/sparc64/mp_machdep.c Tue Sep 14 18:58:51 2010 (r212618) +++ head/sys/sparc64/sparc64/mp_machdep.c Tue Sep 14 19:35:43 2010 (r212619) @@ -446,7 +446,6 @@ cpu_mp_bootstrap(struct pcpu *pc) cpu_setregs(pc); /* Enable interrupts. */ - wrpr(pil, 0, PIL_TICK); wrpr(pstate, 0, PSTATE_KERNEL); smp_cpus++; From owner-svn-src-head@FreeBSD.ORG Tue Sep 14 20:31:09 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BD0DF106566B; Tue, 14 Sep 2010 20:31:09 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 904428FC16; Tue, 14 Sep 2010 20:31:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8EKV9f2091800; Tue, 14 Sep 2010 20:31:09 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8EKV9mP091797; Tue, 14 Sep 2010 20:31:09 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201009142031.o8EKV9mP091797@svn.freebsd.org> From: Marius Strobl Date: Tue, 14 Sep 2010 20:31:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212620 - in head/sys: sparc64/sparc64 sun4v/sun4v X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2010 20:31:09 -0000 Author: marius Date: Tue Sep 14 20:31:09 2010 New Revision: 212620 URL: http://svn.freebsd.org/changeset/base/212620 Log: Remove a KASSERT which will also trigger for perfectly valid combinations of small maxsize and "large" (including BUS_SPACE_UNRESTRICTED) nsegments parameters. Generally using a presz of 0 (which indeed might indicate the use of bogus parameters for DMA tag creation) is not fatal, it just means that no additional DVMA space will be preallocated. Modified: head/sys/sparc64/sparc64/iommu.c head/sys/sun4v/sun4v/hviommu.c Modified: head/sys/sparc64/sparc64/iommu.c ============================================================================== --- head/sys/sparc64/sparc64/iommu.c Tue Sep 14 19:35:43 2010 (r212619) +++ head/sys/sparc64/sparc64/iommu.c Tue Sep 14 20:31:09 2010 (r212620) @@ -874,9 +874,6 @@ iommu_dvmamap_create(bus_dma_tag_t dt, i */ maxpre = imin(dt->dt_nsegments, IOMMU_MAX_PRE_SEG); presz = dt->dt_maxsize / maxpre; - KASSERT(presz != 0, ("%s: bogus preallocation size , nsegments = %d, " - "maxpre = %d, maxsize = %lu", __func__, dt->dt_nsegments, maxpre, - dt->dt_maxsize)); for (i = 1; i < maxpre && totsz < IOMMU_MAX_PRE; i++) { currsz = round_io_page(ulmin(presz, IOMMU_MAX_PRE - totsz)); error = iommu_dvma_valloc(dt, is, *mapp, currsz); Modified: head/sys/sun4v/sun4v/hviommu.c ============================================================================== --- head/sys/sun4v/sun4v/hviommu.c Tue Sep 14 19:35:43 2010 (r212619) +++ head/sys/sun4v/sun4v/hviommu.c Tue Sep 14 20:31:09 2010 (r212620) @@ -513,9 +513,6 @@ hviommu_dvmamap_create(bus_dma_tag_t dt, */ maxpre = imin(dt->dt_nsegments, IOMMU_MAX_PRE_SEG); presz = dt->dt_maxsize / maxpre; - KASSERT(presz != 0, ("hviommu_dvmamap_create: bogus preallocation size " - ", nsegments = %d, maxpre = %d, maxsize = %lu", dt->dt_nsegments, - maxpre, dt->dt_maxsize)); for (i = 1; i < maxpre && totsz < IOMMU_MAX_PRE; i++) { currsz = round_io_page(ulmin(presz, IOMMU_MAX_PRE - totsz)); error = hviommu_dvma_valloc(dt, him, *mapp, currsz); From owner-svn-src-head@FreeBSD.ORG Tue Sep 14 20:41:07 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 54995106566C; Tue, 14 Sep 2010 20:41:07 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4292E8FC0A; Tue, 14 Sep 2010 20:41:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8EKf7aP092176; Tue, 14 Sep 2010 20:41:07 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8EKf7RB092174; Tue, 14 Sep 2010 20:41:07 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201009142041.o8EKf7RB092174@svn.freebsd.org> From: Marius Strobl Date: Tue, 14 Sep 2010 20:41:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212621 - head/sys/dev/usb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2010 20:41:07 -0000 Author: marius Date: Tue Sep 14 20:41:06 2010 New Revision: 212621 URL: http://svn.freebsd.org/changeset/base/212621 Log: Use saner nsegments and maxsegsz parameters when creating certain DMA tags; tags for 1-byte allocations cannot possibly be split across 2 segments and maxsegsz must not exceed maxsize. Modified: head/sys/dev/usb/usb_busdma.c Modified: head/sys/dev/usb/usb_busdma.c ============================================================================== --- head/sys/dev/usb/usb_busdma.c Tue Sep 14 20:31:09 2010 (r212620) +++ head/sys/dev/usb/usb_busdma.c Tue Sep 14 20:41:06 2010 (r212621) @@ -366,9 +366,9 @@ usb_dma_tag_create(struct usb_dma_tag *u /* filter */ NULL, /* filterarg */ NULL, /* maxsize */ size, - /* nsegments */ (align == 1) ? + /* nsegments */ (align == 1 && size > 1) ? (2 + (size / USB_PAGE_SIZE)) : 1, - /* maxsegsz */ (align == 1) ? + /* maxsegsz */ (align == 1 && size > USB_PAGE_SIZE) ? USB_PAGE_SIZE : size, /* flags */ BUS_DMA_KEEP_PG_OFFSET, /* lockfn */ &usb_dma_lock_cb, From owner-svn-src-head@FreeBSD.ORG Tue Sep 14 20:54:23 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 165341065693; Tue, 14 Sep 2010 20:54:23 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 04BC58FC29; Tue, 14 Sep 2010 20:54:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8EKsMbD092466; Tue, 14 Sep 2010 20:54:22 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8EKsMPS092464; Tue, 14 Sep 2010 20:54:22 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201009142054.o8EKsMPS092464@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Tue, 14 Sep 2010 20:54:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212622 - head/sbin/geom/core X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2010 20:54:23 -0000 Author: pjd Date: Tue Sep 14 20:54:22 2010 New Revision: 212622 URL: http://svn.freebsd.org/changeset/base/212622 Log: Remove dead code. Modified: head/sbin/geom/core/geom.c Modified: head/sbin/geom/core/geom.c ============================================================================== --- head/sbin/geom/core/geom.c Tue Sep 14 20:41:06 2010 (r212621) +++ head/sbin/geom/core/geom.c Tue Sep 14 20:54:22 2010 (r212622) @@ -264,21 +264,12 @@ set_option(struct gctl_req *req, struct err(EXIT_FAILURE, "Invalid value for '%c' argument", opt->go_char); } - if (G_OPT_TYPE(opt) == G_TYPE_NUMBER) { - ptr = malloc(sizeof(intmax_t)); - if (ptr == NULL) - errx(EXIT_FAILURE, "No memory."); - *(intmax_t *)ptr = number; - opt->go_val = ptr; - gctl_ro_param(req, optname, sizeof(intmax_t), - opt->go_val); - } else { - asprintf((void *)(&ptr), "%jd", number); - if (ptr == NULL) - errx(EXIT_FAILURE, "No memory."); - opt->go_val = ptr; - gctl_ro_param(req, optname, -1, opt->go_val); - } + ptr = malloc(sizeof(intmax_t)); + if (ptr == NULL) + errx(EXIT_FAILURE, "No memory."); + *(intmax_t *)ptr = number; + opt->go_val = ptr; + gctl_ro_param(req, optname, sizeof(intmax_t), opt->go_val); } else if (G_OPT_TYPE(opt) == G_TYPE_STRING) { gctl_ro_param(req, optname, -1, val); } else if (G_OPT_TYPE(opt) == G_TYPE_BOOL) { From owner-svn-src-head@FreeBSD.ORG Tue Sep 14 20:55:27 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 387151065725; Tue, 14 Sep 2010 20:55:26 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 22D4D8FC20; Tue, 14 Sep 2010 20:55:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8EKtQnj092543; Tue, 14 Sep 2010 20:55:26 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8EKtQ34092541; Tue, 14 Sep 2010 20:55:26 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201009142055.o8EKtQ34092541@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Tue, 14 Sep 2010 20:55:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212623 - head/sbin/geom/core X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2010 20:55:27 -0000 Author: pjd Date: Tue Sep 14 20:55:25 2010 New Revision: 212623 URL: http://svn.freebsd.org/changeset/base/212623 Log: Force commit to note, than the previous change was... Submitted by: ae Modified: head/sbin/geom/core/geom.c Modified: head/sbin/geom/core/geom.c ============================================================================== From owner-svn-src-head@FreeBSD.ORG Tue Sep 14 21:40:29 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E78B9106566B; Tue, 14 Sep 2010 21:40:29 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D56698FC17; Tue, 14 Sep 2010 21:40:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8ELeTMr093592; Tue, 14 Sep 2010 21:40:29 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8ELeTbT093588; Tue, 14 Sep 2010 21:40:29 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201009142140.o8ELeTbT093588@svn.freebsd.org> From: "Kenneth D. Merry" Date: Tue, 14 Sep 2010 21:40:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212624 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2010 21:40:30 -0000 Author: ken Date: Tue Sep 14 21:40:29 2010 New Revision: 212624 URL: http://svn.freebsd.org/changeset/base/212624 Log: MFp4 (//depot/projects/mps/...) Add a man page for the mps(4) driver, and reference it in the mpt(4) driver man page. Sponsored by: Spectra Logic Corporation Added: head/share/man/man4/mps.4 (contents, props changed) Modified: head/share/man/man4/Makefile head/share/man/man4/mpt.4 Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Tue Sep 14 20:55:25 2010 (r212623) +++ head/share/man/man4/Makefile Tue Sep 14 21:40:29 2010 (r212624) @@ -219,6 +219,7 @@ MAN= aac.4 \ mmcsd.4 \ mn.4 \ mouse.4 \ + mps.4 \ mpt.4 \ msk.4 \ mtio.4 \ Added: head/share/man/man4/mps.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/mps.4 Tue Sep 14 21:40:29 2010 (r212624) @@ -0,0 +1,159 @@ +.\" +.\" Copyright (c) 2010 Spectra Logic Corporation +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions, and the following disclaimer, +.\" without modification. +.\" 2. Redistributions in binary form must reproduce at minimum a disclaimer +.\" substantially similar to the "NO WARRANTY" disclaimer below +.\" ("Disclaimer") and any redistribution must be conditioned upon +.\" including a substantially similar Disclaimer requirement for further +.\" binary redistribution. +.\" +.\" NO WARRANTY +.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +.\" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR +.\" A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +.\" HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING +.\" IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGES. +.\" +.\" mps driver man page. +.\" +.\" Author: Ken Merry +.\" +.\" $Id: //depot/SpectraBSD/head/share/man/man4/mps.4#1 $ +.\" $FreeBSD$ +.\" +.Dd September 13, 2010 +.Dt MPS 4 +.Os +.Sh NAME +.Nm mps +.Nd LSI Fusion-MPT 2 Serial Attached SCSI driver +.Sh SYNOPSIS +To compile this driver into your kernel, +place the following lines in your kernel configuration file: +.Bd -ragged -offset indent +.Cd "device scbus" +.Cd "device mps" +.Ed +.Pp +Or, to load the driver as a module at boot, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +mpt_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides support for LSI Logic Fusion-MPT 2 +.Tn SAS +controllers. +.Sh HARDWARE +The following controllers are supported by the +.Nm +driver +.Pp +.Bl -bullet -compact +.It +LSI Logic SAS2004 (4 Port +.Tn SAS ) +.It +LSI Logic SAS2008 (8 Port +.Tn SAS ) +.It +LSI Logic SAS2108 (8 Port +.Tn SAS ) +.It +LSI Logic SAS2116 (16 Port +.Tn SAS ) +.It +LSI Logic SAS2208 (8 Port +.Tn SAS ) +.El +.Sh CONFIGURATION +To disable MSI interrupts for all +.Nm +driver instances, set the following tunable value in +.Xr loader.conf 5 : +.Bd -literal -offset indent +hw.mps.disable_msi=1 +.Ed +.Pp +To disable MSI-X interrupts for all +.Nm +driver instances, set the following tunable value in +.Xr loader.conf 5 : +.Bd -literal -offset indent +hw.mps.disable_msix=1 +.Ed +.Sh DEBUGGING +To enable debugging prints from the +.Nm +driver, set the +.Bd -literal -offset indent +hw.mps.X.debug_level +.Ed +.Pp +variable, where X is the adapter number, either in +.Xr loader.conf 5 +or via +.Xr sysctl 8 . +The following bits have the described effects: +.Bl -tag -offset indent +.It 0x01 +Enable informational prints. +.It 0x02 +Enable tracing prints. +.It 0x04 +Enable prints for driver faults. +.It 0x08 +Enable prints for controller events. +.El +.Sh SEE ALSO +.Xr cd 4 , +.Xr ch 4 , +.Xr da 4 , +.Xr mpt 4 , +.Xr pci 4 , +.Xr sa 4 , +.Xr scsi 4 , +.Xr targ 4 +.Sh BUGS +This driver is still in development, it has only been tested on the amd64 +architecture and has some known shortcomings: +.Bl -bullet -compact +.It +No IR (Integrated RAID) support. +.It +No userland utility support (e.g. +.Xr mptutil 8). +.It +Sometimes the driver gets into a state where devices arrive and depart multiple +times, without user intervention. +.It +The error recovery code isn't complete. +.El +.Sh HISTORY +The +.Nm +driver first appeared in +.Fx 9.0 . +.Sh AUTHORS +.An -nosplit +The +.Nm +driver was originally written by +.An Scott Long Aq scottl@FreeBSD.org . +This man page was written by +.An Ken Merry Aq ken@FreeBSD.org . Modified: head/share/man/man4/mpt.4 ============================================================================== --- head/share/man/man4/mpt.4 Tue Sep 14 20:55:25 2010 (r212623) +++ head/share/man/man4/mpt.4 Tue Sep 14 21:40:29 2010 (r212624) @@ -152,6 +152,7 @@ can take on - no separate compilation is .Xr cd 4 , .Xr ch 4 , .Xr da 4 , +.Xr mps 4 , .Xr pci 4 , .Xr sa 4 , .Xr scsi 4 , From owner-svn-src-head@FreeBSD.ORG Tue Sep 14 23:27:06 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BC825106566C; Tue, 14 Sep 2010 23:27:06 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AC1FB8FC20; Tue, 14 Sep 2010 23:27:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8ENR6qY095817; Tue, 14 Sep 2010 23:27:06 GMT (envelope-from weongyo@svn.freebsd.org) Received: (from weongyo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8ENR6UH095815; Tue, 14 Sep 2010 23:27:06 GMT (envelope-from weongyo@svn.freebsd.org) Message-Id: <201009142327.o8ENR6UH095815@svn.freebsd.org> From: Weongyo Jeong Date: Tue, 14 Sep 2010 23:27:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212625 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2010 23:27:06 -0000 Author: weongyo Date: Tue Sep 14 23:27:06 2010 New Revision: 212625 URL: http://svn.freebsd.org/changeset/base/212625 Log: Fixes spellings and uses the better sentence. While I'm here bumps date. Pointed by: imp, Ruslan Mahmatkhanov Modified: head/share/man/man4/bwn.4 Modified: head/share/man/man4/bwn.4 ============================================================================== --- head/share/man/man4/bwn.4 Tue Sep 14 21:40:29 2010 (r212624) +++ head/share/man/man4/bwn.4 Tue Sep 14 23:27:06 2010 (r212625) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 11, 2010 +.Dd September 14, 2010 .Dt BWN 4 .Os .Sh NAME @@ -93,12 +93,11 @@ driver supports Broadcom BCM43xx based w .It "US Robotics 5411 BCM4318 CardBus b/g" .El .Pp -However if the device chipset is one of BCM4301, BCM4303 and BCM4306 rev 2, -uses +Users of older Broadcom chipsets (BCM4301, BCM4303 and BCM4306 rev 2) +must use .Xr bwi 4 -instead of -.Xr bwn 4 -because the vendor dropped the firmware support. +because the v4 version of the firmware does not support these chips. +The newer firmware is too big to fit into these old chips. .Sh EXAMPLES Join an existing BSS network (i.e., connect to an access point): .Pp From owner-svn-src-head@FreeBSD.ORG Wed Sep 15 00:17:53 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DC048106566B; Wed, 15 Sep 2010 00:17:52 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CAE968FC08; Wed, 15 Sep 2010 00:17:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8F0HqQ8097142; Wed, 15 Sep 2010 00:17:52 GMT (envelope-from grehan@svn.freebsd.org) Received: (from grehan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8F0HqZg097137; Wed, 15 Sep 2010 00:17:52 GMT (envelope-from grehan@svn.freebsd.org) Message-Id: <201009150017.o8F0HqZg097137@svn.freebsd.org> From: Peter Grehan Date: Wed, 15 Sep 2010 00:17:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212627 - in head/sys/powerpc: aim booke include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2010 00:17:53 -0000 Author: grehan Date: Wed Sep 15 00:17:52 2010 New Revision: 212627 URL: http://svn.freebsd.org/changeset/base/212627 Log: Introduce inheritance into the PowerPC MMU kobj interface. include/mmuvar.h - Change the MMU_DEF macro to also create the class definition as well as define the DATA_SET. Add a macro, MMU_DEF_INHERIT, which has an extra parameter specifying the MMU class to inherit methods from. Update the comments at the start of the header file to describe the new macros. booke/pmap.c aim/mmu_oea.c aim/mmu_oea64.c - Collapse mmu_def_t declaration into updated MMU_DEF macro The MMU_DEF_INHERIT macro will be used in the PS3 MMU implementation to allow it to inherit the stock powerpc64 MMU methods. Reviewed by: nwhitehorn Modified: head/sys/powerpc/aim/mmu_oea.c head/sys/powerpc/aim/mmu_oea64.c head/sys/powerpc/booke/pmap.c head/sys/powerpc/include/mmuvar.h Modified: head/sys/powerpc/aim/mmu_oea.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea.c Tue Sep 14 23:54:03 2010 (r212626) +++ head/sys/powerpc/aim/mmu_oea.c Wed Sep 15 00:17:52 2010 (r212627) @@ -379,12 +379,8 @@ static mmu_method_t moea_methods[] = { { 0, 0 } }; -static mmu_def_t oea_mmu = { - MMU_TYPE_OEA, - moea_methods, - 0 -}; -MMU_DEF(oea_mmu); +MMU_DEF(oea_mmu, MMU_TYPE_OEA, moea_methods, 0); + static void tlbie(vm_offset_t va) Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Tue Sep 14 23:54:03 2010 (r212626) +++ head/sys/powerpc/aim/mmu_oea64.c Wed Sep 15 00:17:52 2010 (r212627) @@ -474,12 +474,7 @@ static mmu_method_t moea64_methods[] = { { 0, 0 } }; -static mmu_def_t oea64_mmu = { - MMU_TYPE_G5, - moea64_methods, - 0 -}; -MMU_DEF(oea64_mmu); +MMU_DEF(oea64_mmu, MMU_TYPE_G5, moea64_methods, 0); static __inline u_int va_to_pteg(uint64_t vsid, vm_offset_t addr, int large) Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Tue Sep 14 23:54:03 2010 (r212626) +++ head/sys/powerpc/booke/pmap.c Wed Sep 15 00:17:52 2010 (r212627) @@ -384,12 +384,7 @@ static mmu_method_t mmu_booke_methods[] { 0, 0 } }; -static mmu_def_t booke_mmu = { - MMU_TYPE_BOOKE, - mmu_booke_methods, - 0 -}; -MMU_DEF(booke_mmu); +MMU_DEF(booke_mmu, MMU_TYPE_BOOKE, mmu_booke_methods, 0); static inline void tlb_miss_lock(void) Modified: head/sys/powerpc/include/mmuvar.h ============================================================================== --- head/sys/powerpc/include/mmuvar.h Tue Sep 14 23:54:03 2010 (r212626) +++ head/sys/powerpc/include/mmuvar.h Wed Sep 15 00:17:52 2010 (r212627) @@ -31,7 +31,8 @@ /* * A PowerPC MMU implementation is declared with a kernel object and - * an associated method table, similar to a device driver. + * an associated method table. The MMU_DEF macro is used to declare + * the class, and also links it to the global MMU class list. * * e.g. * @@ -44,13 +45,12 @@ * { 0, 0 } * }; * - * static mmu_def_t ppc8xx_mmu = { - * "ppc8xx", - * ppc8xx_methods, - * sizeof(ppc8xx_mmu_softc), // or 0 if no softc - * }; + * MMU_DEF(ppc8xx, MMU_TYPE_8xx, ppc8xx_methods, sizeof(ppc8xx_mmu_softc)); + * + * A single level of inheritance is supported in a similar fashion to + * kobj inheritance e.g. * - * MMU_DEF(ppc8xx_mmu); + * MMU_DEF_1(ppc860c, MMU_TYPE_860c, ppc860c_methods, 0, ppc8xx); */ #include @@ -84,7 +84,29 @@ typedef struct kobj_class mmu_def_t; #define MMUMETHOD KOBJMETHOD -#define MMU_DEF(name) DATA_SET(mmu_set, name) +#define MMU_DEF(name, ident, methods, size) \ + \ +mmu_def_t name = { \ + ident, methods, size, NULL \ +}; \ +DATA_SET(mmu_set, name) + +#define MMU_DEF_INHERIT(name, ident, methods, size, base1) \ + \ +static kobj_class_t name ## _baseclasses[] = \ + { &base1, NULL }; \ +mmu_def_t name = { \ + ident, methods, size, name ## _baseclasses \ +}; \ +DATA_SET(mmu_set, name) + + +#if 0 +mmu_def_t name = { \ + ident, methods, size, name ## _baseclasses \ +}; +DATA_SET(mmu_set, name) +#endif /* * Known MMU names From owner-svn-src-head@FreeBSD.ORG Wed Sep 15 01:19:12 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5CC2A106566B; Wed, 15 Sep 2010 01:19:12 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 319378FC0A; Wed, 15 Sep 2010 01:19:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8F1JCfg098405; Wed, 15 Sep 2010 01:19:12 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8F1JCjW098403; Wed, 15 Sep 2010 01:19:12 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201009150119.o8F1JCjW098403@svn.freebsd.org> From: Ed Maste Date: Wed, 15 Sep 2010 01:19:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212628 - head/sys/dev/aac X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2010 01:19:12 -0000 Author: emaste Date: Wed Sep 15 01:19:11 2010 New Revision: 212628 URL: http://svn.freebsd.org/changeset/base/212628 Log: Add some enums and constants from Adaptec's latest driver (build 17911). Modified: head/sys/dev/aac/aacreg.h Modified: head/sys/dev/aac/aacreg.h ============================================================================== --- head/sys/dev/aac/aacreg.h Wed Sep 15 00:17:52 2010 (r212627) +++ head/sys/dev/aac/aacreg.h Wed Sep 15 01:19:11 2010 (r212628) @@ -306,7 +306,9 @@ struct aac_adapter_init { u_int32_t HostElapsedSeconds; /* ADAPTER_INIT_STRUCT_REVISION_4 begins here */ u_int32_t InitFlags; /* flags for supported features */ -#define AAC_INITFLAGS_NEW_COMM_SUPPORTED 1 +#define AAC_INITFLAGS_NEW_COMM_SUPPORTED 1 +#define AAC_INITFLAGS_DRIVER_USES_UTC_TIME 0x10 +#define AAC_INITFLAGS_DRIVER_SUPPORTS_PM 0x20 u_int32_t MaxIoCommands; /* max outstanding commands */ u_int32_t MaxIoSize; /* largest I/O command */ u_int32_t MaxFibSize; /* largest FIB to adapter */ @@ -885,6 +887,17 @@ typedef enum { AifEnBatteryNeedsRecond, /* The battery needs reconditioning */ AifEnClusterEvent, /* Some cluster event */ AifEnDiskSetEvent, /* A disk set event occured. */ + AifEnContainerScsiEvent, /* a container event with no. and scsi id */ + AifEnPicBatteryEvent, /* An event gen. by pic_battery.c for an ABM */ + AifEnExpEvent, /* Exp. Event Type to replace CTPopUp messages */ + AifEnRAID6RebuildDone, /* RAID6 rebuild finished */ + AifEnSensorOverHeat, /* Heat Sensor indicate overheat */ + AifEnSensorCoolDown, /* Heat Sensor ind. cooled down after overheat */ + AifFeatureKeysModified, /* notif. of updated feature keys */ + AifApplicationExpirationEvent, /* notif. on app. expiration status */ + AifEnBackgroundConsistencyCheck,/* BCC notif. for NEC - DDTS 94700 */ + AifEnAddJBOD, /* A new JBOD type drive was created (30) */ + AifEnDeleteJBOD, /* A JBOD type drive was deleted (31) */ AifDriverNotifyStart=199, /* Notifies for host driver go here */ /* Host driver notifications start here */ AifDenMorphComplete, /* A morph operation completed */ From owner-svn-src-head@FreeBSD.ORG Wed Sep 15 01:21:31 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 008CB106566B; Wed, 15 Sep 2010 01:21:31 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C96718FC0A; Wed, 15 Sep 2010 01:21:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8F1LUtR098484; Wed, 15 Sep 2010 01:21:30 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8F1LUC9098482; Wed, 15 Sep 2010 01:21:30 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201009150121.o8F1LUC9098482@svn.freebsd.org> From: David Xu Date: Wed, 15 Sep 2010 01:21:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212629 - head/lib/libthr/thread X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2010 01:21:31 -0000 Author: davidxu Date: Wed Sep 15 01:21:30 2010 New Revision: 212629 URL: http://svn.freebsd.org/changeset/base/212629 Log: Move back IN_GCLIST flag into field tlflags, since thread list and gc list still share same lock. Modified: head/lib/libthr/thread/thr_private.h Modified: head/lib/libthr/thread/thr_private.h ============================================================================== --- head/lib/libthr/thread/thr_private.h Wed Sep 15 01:19:11 2010 (r212628) +++ head/lib/libthr/thread/thr_private.h Wed Sep 15 01:21:30 2010 (r212629) @@ -415,13 +415,13 @@ struct pthread { #define THR_FLAGS_PRIVATE 0x0001 #define THR_FLAGS_NEED_SUSPEND 0x0002 /* thread should be suspended */ #define THR_FLAGS_SUSPENDED 0x0004 /* thread is suspended */ -#define THR_FLAGS_IN_GCLIST 0x0008 /* thread in gc list */ -#define THR_FLAGS_DETACHED 0x0010 /* thread is detached */ +#define THR_FLAGS_DETACHED 0x0008 /* thread is detached */ /* Thread list flags; only set with thread list lock held. */ int tlflags; #define TLFLAGS_GC_SAFE 0x0001 /* thread safe for cleaning */ #define TLFLAGS_IN_TDLIST 0x0002 /* thread in all thread list */ +#define TLFLAGS_IN_GCLIST 0x0004 /* thread in gc list */ /* Queue of currently owned NORMAL or PRIO_INHERIT type mutexes. */ struct mutex_queue mutexq; @@ -559,16 +559,16 @@ do { \ } \ } while (0) #define THR_GCLIST_ADD(thrd) do { \ - if (((thrd)->flags & THR_FLAGS_IN_GCLIST) == 0) { \ + if (((thrd)->tlflags & TLFLAGS_IN_GCLIST) == 0) { \ TAILQ_INSERT_HEAD(&_thread_gc_list, thrd, gcle);\ - (thrd)->flags |= THR_FLAGS_IN_GCLIST; \ + (thrd)->tlflags |= TLFLAGS_IN_GCLIST; \ _gc_count++; \ } \ } while (0) #define THR_GCLIST_REMOVE(thrd) do { \ - if (((thrd)->flags & THR_FLAGS_IN_GCLIST) != 0) { \ + if (((thrd)->tlflags & TLFLAGS_IN_GCLIST) != 0) { \ TAILQ_REMOVE(&_thread_gc_list, thrd, gcle); \ - (thrd)->flags &= ~THR_FLAGS_IN_GCLIST; \ + (thrd)->tlflags &= ~TLFLAGS_IN_GCLIST; \ _gc_count--; \ } \ } while (0) From owner-svn-src-head@FreeBSD.ORG Wed Sep 15 01:26:21 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B95C31065674 for ; Wed, 15 Sep 2010 01:26:21 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.freebsd.org (Postfix) with ESMTP id 0D8A28FC15 for ; Wed, 15 Sep 2010 01:26:20 +0000 (UTC) Received: (qmail 23140 invoked by uid 399); 15 Sep 2010 01:26:20 -0000 Received: from localhost (HELO ?192.168.0.142?) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 15 Sep 2010 01:26:20 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4C9020C5.90108@FreeBSD.org> Date: Tue, 14 Sep 2010 18:26:29 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.9) Gecko/20100825 Thunderbird/3.1.3 MIME-Version: 1.0 To: Warner Losh References: <201009131530.o8DFU9f5010734@svn.freebsd.org> In-Reply-To: <201009131530.o8DFU9f5010734@svn.freebsd.org> X-Enigmail-Version: 1.1.1 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r212558 - head/usr.bin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2010 01:26:21 -0000 On 9/13/2010 8:30 AM, Warner Losh wrote: > Author: imp > Date: Mon Sep 13 15:30:09 2010 > New Revision: 212558 > URL: http://svn.freebsd.org/changeset/base/212558 > > Log: > Move to using Makefile.arch to include the proper target-specific programs. > > Modified: > head/usr.bin/Makefile > > Modified: head/usr.bin/Makefile > ============================================================================== > --- head/usr.bin/Makefile Mon Sep 13 15:19:49 2010 (r212557) > +++ head/usr.bin/Makefile Mon Sep 13 15:30:09 2010 (r212558) > @@ -11,48 +11,29 @@ > > SUBDIR= alias \ > apply \ > - ${_ar} \ > .if ${MK_TOOLCHAIN} != "no" > -_ar= ar > +SUBDIR+= ar I'm curious about why you're changing the method we use to switch optional elements. The change seems gratuitous to me, but I'm willing to be persuaded. Doug -- ... and that's just a little bit of history repeating. -- Propellerheads Improve the effectiveness of your Internet presence with a domain name makeover! http://SupersetSolutions.com/ From owner-svn-src-head@FreeBSD.ORG Wed Sep 15 02:31:51 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 31BF1106564A; Wed, 15 Sep 2010 02:31:51 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id E56B48FC08; Wed, 15 Sep 2010 02:31:50 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o8F2TUbY081838; Tue, 14 Sep 2010 20:29:31 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Tue, 14 Sep 2010 20:29:36 -0600 (MDT) Message-Id: <20100914.202936.19192035460743630.imp@bsdimp.com> To: dougb@FreeBSD.org From: "M. Warner Losh" In-Reply-To: <4C9020C5.90108@FreeBSD.org> References: <201009131530.o8DFU9f5010734@svn.freebsd.org> <4C9020C5.90108@FreeBSD.org> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r212558 - head/usr.bin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2010 02:31:51 -0000 In message: <4C9020C5.90108@FreeBSD.org> Doug Barton writes: : On 9/13/2010 8:30 AM, Warner Losh wrote: : > Author: imp : > Date: Mon Sep 13 15:30:09 2010 : > New Revision: 212558 : > URL: http://svn.freebsd.org/changeset/base/212558 : > : > Log: : > Move to using Makefile.arch to include the proper target-specific : > programs. : > : > Modified: : > head/usr.bin/Makefile : > : > Modified: head/usr.bin/Makefile : > ============================================================================== : > --- head/usr.bin/Makefile Mon Sep 13 15:19:49 2010 (r212557) : > +++ head/usr.bin/Makefile Mon Sep 13 15:30:09 2010 (r212558) : > @@ -11,48 +11,29 @@ : > : > SUBDIR= alias \ : > apply \ : > - ${_ar} \ : : > .if ${MK_TOOLCHAIN} != "no" : > -_ar= ar : : > +SUBDIR+= ar : : : I'm curious about why you're changing the method we use to switch : optional elements. The change seems gratuitous to me, but I'm willing : to be persuaded. I posted these exact patches many times to arch@ and while people commented on other aspects of the change, no body ever commented on this aspect of the change (apart from comments about how to do it better). That's why I specifically said that there was no objection from arch@ for these changes. Doing things this way makes it easier for different architectures to subset or augment the directories to build (and it makes it a lot easier to know what's built on a given architecture). They can be concentrated into individual Makefiles that are easier to select on. MIPS and ARM are both moving to having multiple names (powerpc moved a couple of months ago) and the current arrangement doesn't scale well in the face of these changes. It is far from gratuitous. Warner From owner-svn-src-head@FreeBSD.ORG Wed Sep 15 02:56:33 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 480BB1065670; Wed, 15 Sep 2010 02:56:33 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 366248FC12; Wed, 15 Sep 2010 02:56:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8F2uXpV004586; Wed, 15 Sep 2010 02:56:33 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8F2uXwX004579; Wed, 15 Sep 2010 02:56:33 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201009150256.o8F2uXwX004579@svn.freebsd.org> From: David Xu Date: Wed, 15 Sep 2010 02:56:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212630 - in head/lib/libthr: . thread X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2010 02:56:33 -0000 Author: davidxu Date: Wed Sep 15 02:56:32 2010 New Revision: 212630 URL: http://svn.freebsd.org/changeset/base/212630 Log: add code to support stack unwinding when thread exits. note that only defer-mode cancellation works, asynchrnous mode does not work because it lacks of libuwind's support. stack unwinding is not enabled unless LIBTHR_UNWIND_STACK is defined in Makefile. Modified: head/lib/libthr/Makefile head/lib/libthr/thread/thr_clean.c head/lib/libthr/thread/thr_create.c head/lib/libthr/thread/thr_exit.c head/lib/libthr/thread/thr_init.c head/lib/libthr/thread/thr_private.h Modified: head/lib/libthr/Makefile ============================================================================== --- head/lib/libthr/Makefile Wed Sep 15 01:21:30 2010 (r212629) +++ head/lib/libthr/Makefile Wed Sep 15 02:56:32 2010 (r212630) @@ -25,6 +25,14 @@ CFLAGS+=-I${.CURDIR}/../../libexec/rtld- CFLAGS+=-I${.CURDIR}/../../libexec/rtld-elf/${MACHINE_CPUARCH} CFLAGS+=-I${.CURDIR}/../libthread_db CFLAGS+=-Winline + +LIBTHR_UNWIND_STACK=yes + +.ifdef LIBTHR_UNWIND_STACK +CFLAGS+=-I${.CURDIR}/../../contrib/gcc -fexceptions +CFLAGS+=-D_PTHREAD_FORCED_UNWIND +.endif + LDFLAGS+=-Wl,-znodelete VERSION_DEF=${.CURDIR}/../libc/Versions.def Modified: head/lib/libthr/thread/thr_clean.c ============================================================================== --- head/lib/libthr/thread/thr_clean.c Wed Sep 15 01:21:30 2010 (r212629) +++ head/lib/libthr/thread/thr_clean.c Wed Sep 15 02:56:32 2010 (r212630) @@ -78,6 +78,9 @@ __pthread_cleanup_pop_imp(int execute) void _pthread_cleanup_push(void (*routine) (void *), void *arg) { +#ifdef _PTHREAD_FORCED_UNWIND + PANIC("_pthread_cleanup_push is not supported while stack unwinding is enabled."); +#else struct pthread *curthread = _get_curthread(); struct pthread_cleanup *newbuf; @@ -89,10 +92,15 @@ _pthread_cleanup_push(void (*routine) (v newbuf->prev = curthread->cleanup; curthread->cleanup = newbuf; } +#endif } void _pthread_cleanup_pop(int execute) { +#ifdef _PTHREAD_FORCED_UNWIND + PANIC("_pthread_cleanup_pop is not supported while stack unwinding is enabled."); +#else __pthread_cleanup_pop_imp(execute); +#endif } Modified: head/lib/libthr/thread/thr_create.c ============================================================================== --- head/lib/libthr/thread/thr_create.c Wed Sep 15 01:21:30 2010 (r212629) +++ head/lib/libthr/thread/thr_create.c Wed Sep 15 02:56:32 2010 (r212630) @@ -264,6 +264,11 @@ thread_start(struct pthread *curthread) __sys_sigprocmask(SIG_SETMASK, &set, NULL); } +#ifdef _PTHREAD_FORCED_UNWIND + curthread->unwind_stackend = (char *)curthread->attr.stackaddr_attr + + curthread->attr.stacksize_attr; +#endif + /* Run the current thread's start routine with argument: */ _pthread_exit(curthread->start_routine(curthread->arg)); Modified: head/lib/libthr/thread/thr_exit.c ============================================================================== --- head/lib/libthr/thread/thr_exit.c Wed Sep 15 01:21:30 2010 (r212629) +++ head/lib/libthr/thread/thr_exit.c Wed Sep 15 02:56:32 2010 (r212630) @@ -31,6 +31,9 @@ #include "namespace.h" #include +#ifdef _PTHREAD_FORCED_UNWIND +#include +#endif #include #include #include @@ -43,8 +46,125 @@ void _pthread_exit(void *status); +static void exit_thread(void) __dead2; + __weak_reference(_pthread_exit, pthread_exit); +#ifdef _PTHREAD_FORCED_UNWIND + +static void thread_unwind(void) __dead2; +#ifdef PIC +static void thread_uw_init(void); +static _Unwind_Reason_Code thread_unwind_stop(int version, + _Unwind_Action actions, + _Unwind_Exception_Class exc_class, + struct _Unwind_Exception *exc_obj, + struct _Unwind_Context *context, void *stop_parameter); +/* unwind library pointers */ +static _Unwind_Reason_Code (*uwl_forcedunwind)(struct _Unwind_Exception *, + _Unwind_Stop_Fn, void *); +static void (*uwl_resume)(struct _Unwind_Exception *exc); +static _Unwind_Word (*uwl_getcfa)(struct _Unwind_Context *); + +static void +thread_uw_init(void) +{ + static int inited = 0; + void *handle; + + if (inited) + return; + inited = 1; + handle = RTLD_DEFAULT; + if ((uwl_forcedunwind = dlsym(handle, "_Unwind_ForcedUnwind")) == NULL|| + (uwl_resume = dlsym(handle, "_Unwind_Resume")) == NULL || + (uwl_getcfa = dlsym(handle, "_Unwind_GetCFA")) == NULL) { + uwl_forcedunwind = NULL; + return; + } +} + +void +_Unwind_Resume(struct _Unwind_Exception *ex) +{ + (*uwl_resume)(ex); +} + +_Unwind_Reason_Code +_Unwind_ForcedUnwind(struct _Unwind_Exception *ex, _Unwind_Stop_Fn stop_func, + void *stop_arg) +{ + return (*uwl_forcedunwind)(ex, stop_func, stop_arg); +} + +_Unwind_Word +_Unwind_GetCFA(struct _Unwind_Context *context) +{ + return (*uwl_getcfa)(context); +} +#else +#pragma weak _Unwind_GetCFA +#pragma weak _Unwind_ForcedUnwind +#pragma weak _Unwind_Resume +#endif /* PIC */ + +static void +thread_unwind_cleanup(_Unwind_Reason_Code code, struct _Unwind_Exception *e) +{ + /* + * Specification said that _Unwind_Resume should not be used here, + * instead, user should rethrow the exception. For C++ user, they + * should put "throw" sentence in catch(...) block. + */ + PANIC("exception should be rethrown"); +} + +static _Unwind_Reason_Code +thread_unwind_stop(int version, _Unwind_Action actions, + _Unwind_Exception_Class exc_class, + struct _Unwind_Exception *exc_obj, + struct _Unwind_Context *context, void *stop_parameter) +{ + struct pthread *curthread = _get_curthread(); + struct pthread_cleanup *cur; + uintptr_t cfa; + int done = 0; + + /* XXX assume stack grows down to lower address */ + + cfa = _Unwind_GetCFA(context); + if (actions & _UA_END_OF_STACK) { + done = 1; + } else if (cfa >= (uintptr_t)curthread->unwind_stackend) { + done = 1; + } + + while ((cur = curthread->cleanup) != NULL && + (done || + ((uintptr_t)cur < (uintptr_t)curthread->unwind_stackend && + (uintptr_t)cur >= cfa))) { + __pthread_cleanup_pop_imp(1); + } + + if (done) + exit_thread(); /* Never return! */ + + return (_URC_NO_REASON); +} + +static void +thread_unwind(void) +{ + struct pthread *curthread = _get_curthread(); + + curthread->ex.exception_class = 0; + curthread->ex.exception_cleanup = thread_unwind_cleanup; + _Unwind_ForcedUnwind(&curthread->ex, thread_unwind_stop, NULL); + PANIC("_Unwind_ForcedUnwind returned"); +} + +#endif + void _thread_exit(const char *fname, int lineno, const char *msg) { @@ -95,10 +215,39 @@ _pthread_exit_mask(void *status, sigset_ /* Save the return value: */ curthread->ret = status; +#ifdef _PTHREAD_FORCED_UNWIND +#ifdef PIC + thread_uw_init(); + if (uwl_forcedunwind != NULL) { + thread_unwind(); + } +#else + if (_Unwind_ForcedUnwind != NULL) { + thread_unwind(); + } +#endif /* PIC */ + + else { + while (curthread->cleanup != NULL) { + __pthread_cleanup_pop_imp(1); + } + exit_thread(); + } + +#else while (curthread->cleanup != NULL) { - _pthread_cleanup_pop(1); + __pthread_cleanup_pop_imp(1); } + exit_thread(); +#endif /* _PTHREAD_FORCED_UNWIND */ +} + +static void +exit_thread(void) +{ + struct pthread *curthread = _get_curthread(); + /* Check if there is thread specific data: */ if (curthread->specific != NULL) { /* Run the thread-specific data destructors: */ Modified: head/lib/libthr/thread/thr_init.c ============================================================================== --- head/lib/libthr/thread/thr_init.c Wed Sep 15 01:21:30 2010 (r212629) +++ head/lib/libthr/thread/thr_init.c Wed Sep 15 02:56:32 2010 (r212630) @@ -413,6 +413,10 @@ init_main_thread(struct pthread *thread) &sched_param); thread->attr.prio = sched_param.sched_priority; +#ifdef _PTHREAD_FORCED_UNWIND + thread->unwind_stackend = _usrstack; +#endif + /* Others cleared to zero by thr_alloc() */ } Modified: head/lib/libthr/thread/thr_private.h ============================================================================== --- head/lib/libthr/thread/thr_private.h Wed Sep 15 01:21:30 2010 (r212629) +++ head/lib/libthr/thread/thr_private.h Wed Sep 15 02:56:32 2010 (r212630) @@ -70,6 +70,10 @@ #include "thr_umtx.h" #include "thread_db.h" +#ifdef _PTHREAD_FORCED_UNWIND +#include +#endif + typedef TAILQ_HEAD(pthreadlist, pthread) pthreadlist; typedef TAILQ_HEAD(atfork_head, pthread_atfork) atfork_head; TAILQ_HEAD(mutex_queue, pthread_mutex); @@ -446,6 +450,11 @@ struct pthread { /* Cleanup handlers Link List */ struct pthread_cleanup *cleanup; +#ifdef _PTHREAD_FORCED_UNWIND + struct _Unwind_Exception ex; + void *unwind_stackend; +#endif + /* * Magic value to help recognize a valid thread structure * from an invalid one: From owner-svn-src-head@FreeBSD.ORG Wed Sep 15 03:06:26 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C73D6106566C; Wed, 15 Sep 2010 03:06:26 +0000 (UTC) (envelope-from davidxu@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id B652D8FC12; Wed, 15 Sep 2010 03:06:26 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o8F36OiA047409; Wed, 15 Sep 2010 03:06:25 GMT (envelope-from davidxu@freebsd.org) Message-ID: <4C90A8B1.6060709@freebsd.org> Date: Wed, 15 Sep 2010 11:06:25 +0000 From: David Xu User-Agent: Thunderbird 2.0.0.24 (X11/20100630) MIME-Version: 1.0 To: David Xu References: <201009150256.o8F2uXwX004579@svn.freebsd.org> In-Reply-To: <201009150256.o8F2uXwX004579@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r212630 - in head/lib/libthr: . thread X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2010 03:06:26 -0000 David Xu wrote: > Author: davidxu > Date: Wed Sep 15 02:56:32 2010 > New Revision: 212630 > URL: http://svn.freebsd.org/changeset/base/212630 > > Log: > add code to support stack unwinding when thread exits. note that only > defer-mode cancellation works, asynchrnous mode does not work because > it lacks of libuwind's support. stack unwinding is not enabled unless > LIBTHR_UNWIND_STACK is defined in Makefile. > > Modified: > head/lib/libthr/Makefile > head/lib/libthr/thread/thr_clean.c > head/lib/libthr/thread/thr_create.c > head/lib/libthr/thread/thr_exit.c > head/lib/libthr/thread/thr_init.c > head/lib/libthr/thread/thr_private.h I have enabled stack unwinding to see if it will cause any problem, if it does, it can be easily turned off in Makefile. From owner-svn-src-head@FreeBSD.ORG Wed Sep 15 03:17:37 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7157F10656AA; Wed, 15 Sep 2010 03:17:37 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id EB4A08FC0C; Wed, 15 Sep 2010 03:17:36 +0000 (UTC) Received: by vws7 with SMTP id 7so7344220vws.13 for ; Tue, 14 Sep 2010 20:17:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:in-reply-to:references:x-mailer:mime-version :content-type; bh=TPzgVCkre1fW9LZn4haWiA73NAgiyLwf4rV8SDRg61E=; b=iByrcpbJJ9gOmV/8jKfLKb7/pedibDazI0mlj5AzdmC0AZu/ZtRNE5ylmUlz0Nk7ZF pEdsWQoMogZ3HRd+nyTY7DWo8KiC+4KQocg1LZa3luP+AwbLd+tddK7AaEYKeZ4pmK1/ 2HLElHcJGPGj3qFJ0JnBo1TLQVe32609e0TFk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:in-reply-to:references:x-mailer :mime-version:content-type; b=nZe456/oa179hqEN4I88EgLH28YgiTfIHu3pwh6SBn9RBF9tEufKBd7fEjtQ7h/Fnu tbECD4V4okN9cUhcZbUBt2uxQMvxe6jTOfRKuL4KurC7bpdcmkEFsdZnLRc2UMhCddQP PB66lCjDXipTZIba0l+BsxDEDUzDNm3Ccihcc= Received: by 10.220.61.13 with SMTP id r13mr469207vch.202.1284520655797; Tue, 14 Sep 2010 20:17:35 -0700 (PDT) Received: from kan.dnsalias.net (c-24-63-226-98.hsd1.ma.comcast.net [24.63.226.98]) by mx.google.com with ESMTPS id z14sm227796vch.10.2010.09.14.20.17.34 (version=SSLv3 cipher=RC4-MD5); Tue, 14 Sep 2010 20:17:34 -0700 (PDT) Date: Tue, 14 Sep 2010 23:17:28 -0400 From: Alexander Kabaev To: David Xu Message-ID: <20100914231728.33ca7466@kan.dnsalias.net> In-Reply-To: <201009150256.o8F2uXwX004579@svn.freebsd.org> References: <201009150256.o8F2uXwX004579@svn.freebsd.org> X-Mailer: Claws Mail 3.7.6 (GTK+ 2.20.1; amd64-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/Ck/lZcx7A3CcDrf8WZDQtLl"; protocol="application/pgp-signature" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r212630 - in head/lib/libthr: . thread X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2010 03:17:37 -0000 --Sig_/Ck/lZcx7A3CcDrf8WZDQtLl Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Wed, 15 Sep 2010 02:56:33 +0000 (UTC) David Xu wrote: > Author: davidxu > Date: Wed Sep 15 02:56:32 2010 > New Revision: 212630 > URL: http://svn.freebsd.org/changeset/base/212630 >=20 > Log: > add code to support stack unwinding when thread exits. note that > only defer-mode cancellation works, asynchrnous mode does not work > because it lacks of libuwind's support. stack unwinding is not > enabled unless LIBTHR_UNWIND_STACK is defined in Makefile. >=20 > Modified: > head/lib/libthr/Makefile > head/lib/libthr/thread/thr_clean.c > head/lib/libthr/thread/thr_create.c > head/lib/libthr/thread/thr_exit.c > head/lib/libthr/thread/thr_init.c > head/lib/libthr/thread/thr_private.h >=20 > Modified: head/lib/libthr/Makefile > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/lib/libthr/Makefile Wed Sep 15 01:21:30 2010 > (r212629) +++ head/lib/libthr/Makefile Wed Sep 15 02:56:32 > 2010 (r212630) @@ -25,6 +25,14 @@ > CFLAGS+=3D-I${.CURDIR}/../../libexec/rtld- > CFLAGS+=3D-I${.CURDIR}/../../libexec/rtld-elf/${MACHINE_CPUARCH} > CFLAGS+=3D-I${.CURDIR}/../libthread_db CFLAGS+=3D-Winline > + > +LIBTHR_UNWIND_STACK=3Dyes > + > +.ifdef LIBTHR_UNWIND_STACK > +CFLAGS+=3D-I${.CURDIR}/../../contrib/gcc -fexceptions=20 > +CFLAGS+=3D-D_PTHREAD_FORCED_UNWIND > +.endif > + > Reaching into bowels of GCC like that is never good. --=20 Alexander Kabaev --Sig_/Ck/lZcx7A3CcDrf8WZDQtLl Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (FreeBSD) iD8DBQFMkDrNQ6z1jMm+XZYRAmvxAKDjLneLD2f99oqMDWCRcmE4pSTpOgCeNqM/ JvKphe0fmHYDD4DKzZnQjgk= =mRHy -----END PGP SIGNATURE----- --Sig_/Ck/lZcx7A3CcDrf8WZDQtLl-- From owner-svn-src-head@FreeBSD.ORG Wed Sep 15 03:19:54 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A0430106566C; Wed, 15 Sep 2010 03:19:54 +0000 (UTC) (envelope-from davidxu@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 8E96C8FC0C; Wed, 15 Sep 2010 03:19:54 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o8F3JqxY059005; Wed, 15 Sep 2010 03:19:53 GMT (envelope-from davidxu@freebsd.org) Message-ID: <4C90ABD8.1020609@freebsd.org> Date: Wed, 15 Sep 2010 11:19:52 +0000 From: David Xu User-Agent: Thunderbird 2.0.0.24 (X11/20100630) MIME-Version: 1.0 To: Alexander Kabaev References: <201009150256.o8F2uXwX004579@svn.freebsd.org> <20100914231728.33ca7466@kan.dnsalias.net> In-Reply-To: <20100914231728.33ca7466@kan.dnsalias.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r212630 - in head/lib/libthr: . thread X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2010 03:19:54 -0000 Alexander Kabaev wrote: > On Wed, 15 Sep 2010 02:56:33 +0000 (UTC) > David Xu wrote: > >> Author: davidxu >> Date: Wed Sep 15 02:56:32 2010 >> New Revision: 212630 >> URL: http://svn.freebsd.org/changeset/base/212630 >> >> Log: >> add code to support stack unwinding when thread exits. note that >> only defer-mode cancellation works, asynchrnous mode does not work >> because it lacks of libuwind's support. stack unwinding is not >> enabled unless LIBTHR_UNWIND_STACK is defined in Makefile. >> >> Modified: >> head/lib/libthr/Makefile >> head/lib/libthr/thread/thr_clean.c >> head/lib/libthr/thread/thr_create.c >> head/lib/libthr/thread/thr_exit.c >> head/lib/libthr/thread/thr_init.c >> head/lib/libthr/thread/thr_private.h >> >> Modified: head/lib/libthr/Makefile >> ============================================================================== >> --- head/lib/libthr/Makefile Wed Sep 15 01:21:30 2010 >> (r212629) +++ head/lib/libthr/Makefile Wed Sep 15 02:56:32 >> 2010 (r212630) @@ -25,6 +25,14 @@ >> CFLAGS+=-I${.CURDIR}/../../libexec/rtld- >> CFLAGS+=-I${.CURDIR}/../../libexec/rtld-elf/${MACHINE_CPUARCH} >> CFLAGS+=-I${.CURDIR}/../libthread_db CFLAGS+=-Winline >> + >> +LIBTHR_UNWIND_STACK=yes >> + >> +.ifdef LIBTHR_UNWIND_STACK >> +CFLAGS+=-I${.CURDIR}/../../contrib/gcc -fexceptions >> +CFLAGS+=-D_PTHREAD_FORCED_UNWIND >> +.endif >> + >> > > Reaching into bowels of GCC like that is never good. Any solution ? ;-) From owner-svn-src-head@FreeBSD.ORG Wed Sep 15 03:29:46 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 053CB106564A; Wed, 15 Sep 2010 03:29:46 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout026.mac.com (asmtpout026.mac.com [17.148.16.101]) by mx1.freebsd.org (Postfix) with ESMTP id DF8CF8FC0C; Wed, 15 Sep 2010 03:29:45 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=us-ascii Received: from [192.168.2.104] (hob.xcllnt.net [70.36.220.6]) by asmtp026.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0L8R007CDO99VU60@asmtp026.mac.com>; Tue, 14 Sep 2010 19:29:35 -0700 (PDT) X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx engine=6.0.2-1004200000 definitions=main-1009140168 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.0.10011,1.0.148,0.0.0000 definitions=2010-09-14_15:2010-09-14, 2010-09-14, 1970-01-01 signatures=0 From: Marcel Moolenaar In-reply-to: <201009141621.o8EGLDhr086248@svn.freebsd.org> Date: Tue, 14 Sep 2010 19:29:32 -0700 Message-id: References: <201009141621.o8EGLDhr086248@svn.freebsd.org> To: Pawel Jakub Dawidek X-Mailer: Apple Mail (2.1081) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r212614 - in head: sbin/geom/class/part sys/geom/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2010 03:29:46 -0000 On Sep 14, 2010, at 9:21 AM, Pawel Jakub Dawidek wrote: > Author: pjd > Date: Tue Sep 14 16:21:13 2010 > New Revision: 212614 > URL: http://svn.freebsd.org/changeset/base/212614 > > Log: > - Change all places where G_TYPE_ASCNUM is used to G_TYPE_NUMBER. > It turns out the new type wasn't really needed. > - Reorganize code a little bit. Please revert. The gpart ctlreq interface is ASCII only by design. This change is unnecessary as nothing was broken and on top of that breaks compatibility with user-space -- again entirely without merit. Thanks, -- Marcel Moolenaar xcllnt@mac.com From owner-svn-src-head@FreeBSD.ORG Wed Sep 15 04:51:08 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B2581065693; Wed, 15 Sep 2010 04:51:08 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4B0EC8FC1A; Wed, 15 Sep 2010 04:51:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8F4p80u015004; Wed, 15 Sep 2010 04:51:08 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8F4p8YG015001; Wed, 15 Sep 2010 04:51:08 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201009150451.o8F4p8YG015001@svn.freebsd.org> From: Alexander Motin Date: Wed, 15 Sep 2010 04:51:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212631 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2010 04:51:08 -0000 Author: mav Date: Wed Sep 15 04:51:07 2010 New Revision: 212631 URL: http://svn.freebsd.org/changeset/base/212631 Log: Add hpet(4) man page. Added: head/share/man/man4/hpet.4 (contents, props changed) Modified: head/share/man/man4/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Wed Sep 15 02:56:32 2010 (r212630) +++ head/share/man/man4/Makefile Wed Sep 15 04:51:07 2010 (r212631) @@ -133,6 +133,7 @@ MAN= aac.4 \ hfa.4 \ hifn.4 \ hme.4 \ + hpet.4 \ ${_hptiop.4} \ ${_hptmv.4} \ ${_hptrr.4} \ @@ -544,6 +545,7 @@ MLINKS+=gif.4 if_gif.4 MLINKS+=gre.4 if_gre.4 MLINKS+=hatm.4 if_hatm.4 MLINKS+=hme.4 if_hme.4 +MLINKS+=hpet.4 acpi_hpet.4 MLINKS+=${_hptrr.4} ${_rr232x.4} MLINKS+=idt.4 if_idt.4 MLINKS+=igb.4 if_igb.4 Added: head/share/man/man4/hpet.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/hpet.4 Wed Sep 15 04:51:07 2010 (r212631) @@ -0,0 +1,105 @@ +.\" Copyright (c) 2009 Alexander Motin +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. The name of the author may not be used to endorse or promote products +.\" derived from this software without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd September 14, 2010 +.Dt HPET 4 +.Os +.Sh NAME +.Nm hpet +.Nd High Precision Event Timer driver +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device acpi" +.Ed +.Pp +The following tunables are settable from the +.Xr loader 8 : +.Bl -ohang +.It Va hint.hpet. Ns Ar X Ns Va .allowed_irqs +is a 32bit mask. Each set bit allows driver to use respective IRQ, +if BIOS also set respective capability bit in comparator's configuration +register. +Default value is 0xffff0000, except some known broken hardware. +.It Va hint.hpet. Ns Ar X Ns Va .clock +controls event timers functionality support. Setting to 0, disables it. +Default value is 1. +.It Va hint.hpet. Ns Ar X Ns Va .legacy_route +controls "LegacyReplacement Route" mode. If enabled, HPET will steal IRQ0 of +i8254 timer and IRQ8 of RTC. Before using it, make sure that respective +drivers are not using interrupts, by setting also: +.Bd -literal +hint.attimer.0.clock=0 +hint.atrtc.0.clock=0 +.Ed +Default value is 0. +.It Va hint.hpet. Ns Ar X Ns Va .per_cpu +controls how much per-CPU event timers should driver attempt to register. +This functionality requires every comparator in a group to have own unshared +IRQ, so it depends on hardware capabilities and interrupts configuration. +Default value is 1. +.El +.Sh DESCRIPTION +This driver uses High Precision Event Timer hardware (part of the chipset, +usually enumerated via ACPI) to supply kernel with one time counter and +several (usually from 3 to 8) event timers. +This hardware includes single main counter with known increment frequency +(10MHz or more), and several programable comparators (optionally with +automatic reload feature). +When value of the main counter matches current value of any comparator, +interrupt can be generated. +Depending on hardware capabilities and configuration, interrupt can be +delivered as regular I/O APIC interrupt (ISA or PCI) in range from 0 to 31, +or as Front Side Bus interrupt, alike to PCI MSI interrupts, or in so called +"LegacyReplacement Route" HPET can speal IRQ0 of i8254 and IRQ8 of the RTC. +Interrupt can be either edge- or level-triggered. In last case they could be +safely shared with PCI IRQs. +Driver prefers to use FSB interrupts, if supported, to avoid sharing. +If it is not possible, it uses single sharable IRQ from PCI range. +Other modes (LegacyReplacement and ISA IRQs) require special care to setup, +but could be configured manually via device hints. +.Pp +Event timers provided by the driver support both one-shot an periodic modes +and irrelevant to CPU power states. +.Pp +Depending on hardware capabilities and configuration, driver can expose each +comparator as separate event timer or group them into one or several per-CPU +event timers. In last case interrupt of every of those comparators within +group is bound to specific CPU core. This is possible only when each +of these comparators has own unsharable IRQ. +.Sh SEE ALSO +.Xr acpi 4 , +.Xr eventtimer 4 +.Sh HISTORY +The +.Nm +driver first appeared in +.Fx 6.3 . +Support for event timers was added in +.Fx 9.0 . From owner-svn-src-head@FreeBSD.ORG Wed Sep 15 05:10:50 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 827E5106566B; Wed, 15 Sep 2010 05:10:50 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 67B158FC0C; Wed, 15 Sep 2010 05:10:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8F5AoJq016782; Wed, 15 Sep 2010 05:10:50 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8F5AowF016776; Wed, 15 Sep 2010 05:10:50 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201009150510.o8F5AowF016776@svn.freebsd.org> From: Neel Natu Date: Wed, 15 Sep 2010 05:10:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212632 - in head/sys/mips: cavium include mips sibyte X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2010 05:10:50 -0000 Author: neel Date: Wed Sep 15 05:10:50 2010 New Revision: 212632 URL: http://svn.freebsd.org/changeset/base/212632 Log: Make the meaning of the 'mask' argument to 'set_intr_mask(mask)' consistent with the meaning of IM bits in the status register. Reviewed by: jmallett, jchandra Modified: head/sys/mips/cavium/octeon_mp.c head/sys/mips/include/cpufunc.h head/sys/mips/mips/machdep.c head/sys/mips/mips/trap.c head/sys/mips/sibyte/sb_machdep.c Modified: head/sys/mips/cavium/octeon_mp.c ============================================================================== --- head/sys/mips/cavium/octeon_mp.c Wed Sep 15 04:51:07 2010 (r212631) +++ head/sys/mips/cavium/octeon_mp.c Wed Sep 15 05:10:50 2010 (r212632) @@ -96,7 +96,7 @@ platform_init_ap(int cpuid) */ clock_int_mask = hard_int_mask(5); ipi_int_mask = hard_int_mask(platform_ipi_intrnum()); - set_intr_mask(MIPS_SR_INT_MASK & ~(ipi_int_mask | clock_int_mask)); + set_intr_mask(ipi_int_mask | clock_int_mask); mips_wbflush(); } Modified: head/sys/mips/include/cpufunc.h ============================================================================== --- head/sys/mips/include/cpufunc.h Wed Sep 15 04:51:07 2010 (r212631) +++ head/sys/mips/include/cpufunc.h Wed Sep 15 05:10:50 2010 (r212632) @@ -272,7 +272,7 @@ set_intr_mask(uint32_t mask) uint32_t ostatus; ostatus = mips_rd_status(); - mask = (ostatus & ~MIPS_SR_INT_MASK) | (~mask & MIPS_SR_INT_MASK); + mask = (ostatus & ~MIPS_SR_INT_MASK) | (mask & MIPS_SR_INT_MASK); mips_wr_status(mask); return (ostatus); } Modified: head/sys/mips/mips/machdep.c ============================================================================== --- head/sys/mips/mips/machdep.c Wed Sep 15 04:51:07 2010 (r212631) +++ head/sys/mips/mips/machdep.c Wed Sep 15 05:10:50 2010 (r212632) @@ -356,7 +356,7 @@ mips_vector_init(void) * Mask all interrupts. Each interrupt will be enabled * when handler is installed for it */ - set_intr_mask(MIPS_SR_INT_MASK); + set_intr_mask(0); /* Clear BEV in SR so we start handling our own exceptions */ mips_wr_status(mips_rd_status() & ~MIPS_SR_BEV); Modified: head/sys/mips/mips/trap.c ============================================================================== --- head/sys/mips/mips/trap.c Wed Sep 15 04:51:07 2010 (r212631) +++ head/sys/mips/mips/trap.c Wed Sep 15 05:10:50 2010 (r212632) @@ -304,7 +304,7 @@ trap(struct trapframe *trapframe) * return to userland. */ if (trapframe->sr & MIPS_SR_INT_IE) { - set_intr_mask(~(trapframe->sr & MIPS_SR_INT_MASK)); + set_intr_mask(trapframe->sr & MIPS_SR_INT_MASK); intr_enable(); } else { intr_disable(); Modified: head/sys/mips/sibyte/sb_machdep.c ============================================================================== --- head/sys/mips/sibyte/sb_machdep.c Wed Sep 15 04:51:07 2010 (r212631) +++ head/sys/mips/sibyte/sb_machdep.c Wed Sep 15 05:10:50 2010 (r212632) @@ -370,7 +370,7 @@ platform_init_ap(int cpuid) */ clock_int_mask = hard_int_mask(5); ipi_int_mask = hard_int_mask(platform_ipi_intrnum()); - set_intr_mask(MIPS_SR_INT_MASK & ~(ipi_int_mask | clock_int_mask)); + set_intr_mask(ipi_int_mask | clock_int_mask); } int From owner-svn-src-head@FreeBSD.ORG Wed Sep 15 05:29:14 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 50E0C106564A; Wed, 15 Sep 2010 05:29:14 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 41AB28FC15; Wed, 15 Sep 2010 05:29:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8F5TEHe018434; Wed, 15 Sep 2010 05:29:14 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8F5TE2O018430; Wed, 15 Sep 2010 05:29:14 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201009150529.o8F5TE2O018430@svn.freebsd.org> From: Neel Natu Date: Wed, 15 Sep 2010 05:29:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212633 - head/sys/mips/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2010 05:29:14 -0000 Author: neel Date: Wed Sep 15 05:29:13 2010 New Revision: 212633 URL: http://svn.freebsd.org/changeset/base/212633 Log: Factor out the common parts of the swarm board in SWARM_COMMON and start including that in SWARM and SWARM_SMP kernel configs. Added: head/sys/mips/conf/SWARM_COMMON (contents, props changed) Modified: head/sys/mips/conf/SWARM head/sys/mips/conf/SWARM_SMP Modified: head/sys/mips/conf/SWARM ============================================================================== --- head/sys/mips/conf/SWARM Wed Sep 15 05:10:50 2010 (r212632) +++ head/sys/mips/conf/SWARM Wed Sep 15 05:29:13 2010 (r212633) @@ -2,69 +2,11 @@ # $FreeBSD$ # -ident SWARM -options CPU_SB1 +include SWARM_COMMON -files "../sibyte/files.sibyte" -hints "SWARM.hints" +ident SWARM -options CFE -options CFE_CONSOLE -options CFE_ENV -options ALT_BREAK_TO_DEBUGGER +options ISA_MIPS32 +makeoptions ARCH_FLAGS="-mabi=32 -march=mips32" makeoptions LDSCRIPT_NAME= ldscript.mips.cfe - -#cpu CPU_MIPS64 -#options ISA_MIPS64 -#makeoptions ARCH_FLAGS="-march=mips64 -mgp64 -mabi=o64" -cpu CPU_MIPS32 -options ISA_MIPS32 -makeoptions ARCH_FLAGS="-march=mips32" - -makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols -makeoptions MODULES_OVERRIDE="" - -options DDB -options KDB - -options SCHED_4BSD #4BSD scheduler -options INET #InterNETworking -options NFSCLIENT #Network Filesystem Client -options NFS_ROOT #NFS usable as /, requires NFSCLIENT -options PSEUDOFS #Pseudo-filesystem framework -options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions - -# Debugging for use in -current -#options DEADLKRES -options INVARIANTS -options INVARIANT_SUPPORT -options WITNESS - -options FFS #Fast filesystem - -options KTRACE - -device pci -device miibus -device bge -device loop -device ether -device md -device random - -options USB_DEBUG -device usb -device ohci -device uhci -device ehci - -device umass - -device scbus -device da - -device ata -device atadisk -device atapicd -options ATA_STATIC_ID Added: head/sys/mips/conf/SWARM_COMMON ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/SWARM_COMMON Wed Sep 15 05:29:13 2010 (r212633) @@ -0,0 +1,60 @@ +# +# $FreeBSD$ +# + +files "../sibyte/files.sibyte" +hints "SWARM.hints" + +options CFE +options CFE_CONSOLE +options CFE_ENV +options ALT_BREAK_TO_DEBUGGER + +cpu CPU_SB1 + +makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols +makeoptions MODULES_OVERRIDE="" + +options DDB +options KDB + +options SCHED_4BSD #4BSD scheduler +options INET #InterNETworking +options NFSCLIENT #Network Filesystem Client +options NFS_ROOT #NFS usable as /, requires NFSCLIENT +options PSEUDOFS #Pseudo-filesystem framework +options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions + +# Debugging for use in -current +#options DEADLKRES +options INVARIANTS +options INVARIANT_SUPPORT +options WITNESS + +options FFS #Fast filesystem + +options KTRACE + +device pci +device miibus +device bge +device loop +device ether +device md +device random + +options USB_DEBUG +device usb +device ohci +device uhci +device ehci + +device umass + +device scbus +device da + +device ata +device atadisk +device atapicd +options ATA_STATIC_ID Modified: head/sys/mips/conf/SWARM_SMP ============================================================================== --- head/sys/mips/conf/SWARM_SMP Wed Sep 15 05:10:50 2010 (r212632) +++ head/sys/mips/conf/SWARM_SMP Wed Sep 15 05:29:13 2010 (r212633) @@ -1,7 +1,15 @@ # # $FreeBSD$ # + +include SWARM_COMMON + +ident SWARM_SMP + options SMP options PRINTF_BUFR_SIZE=128 -include SWARM +options ISA_MIPS32 + +makeoptions ARCH_FLAGS="-mabi=32 -march=mips32" +makeoptions LDSCRIPT_NAME= ldscript.mips.cfe From owner-svn-src-head@FreeBSD.ORG Wed Sep 15 05:32:10 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9424D1065670; Wed, 15 Sep 2010 05:32:10 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 836098FC0C; Wed, 15 Sep 2010 05:32:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8F5WA1B018734; Wed, 15 Sep 2010 05:32:10 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8F5WANC018730; Wed, 15 Sep 2010 05:32:10 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201009150532.o8F5WANC018730@svn.freebsd.org> From: Neel Natu Date: Wed, 15 Sep 2010 05:32:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212634 - in head/sys: conf mips/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2010 05:32:10 -0000 Author: neel Date: Wed Sep 15 05:32:10 2010 New Revision: 212634 URL: http://svn.freebsd.org/changeset/base/212634 Log: Add 64-bit SWARM board kernel configs. Added: head/sys/conf/ldscript.mips.64.cfe (contents, props changed) head/sys/mips/conf/SWARM64 (contents, props changed) head/sys/mips/conf/SWARM64_SMP (contents, props changed) Added: head/sys/conf/ldscript.mips.64.cfe ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/conf/ldscript.mips.64.cfe Wed Sep 15 05:32:10 2010 (r212634) @@ -0,0 +1,320 @@ +/*- + * Copyright (c) 2001, 2004, 2008, Juniper Networks, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the Juniper Networks, Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY JUNIPER NETWORKS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL JUNIPER NETWORKS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * JNPR: ldscript.mips,v 1.3 2006/10/11 06:12:04 + * $FreeBSD$ + */ + +/* + * This linker script is needed to build a kernel for use by Broadcom CFE + * when loaded over TFTP; its ELF loader does not support backwards seek + * on network I/O streams. + * Furthermore, CFE will only load PT_LOAD segments, therefore the dynamic + * sections must be placed in their own segment. + */ + +OUTPUT_FORMAT("elf64-tradbigmips", "elf64-tradbigmips", "elf64-tradlittlemips") + +OUTPUT_ARCH(mips) +ENTRY(_start) +SEARCH_DIR(/usr/lib); +/* Do we need any of these for elf? + __DYNAMIC = 0; +PROVIDE (_DYNAMIC = 0); +*/ + +PHDRS +{ + headers PT_PHDR FILEHDR PHDRS ; + interp PT_INTERP ; + text PT_LOAD ; + dynamic PT_LOAD ; + data PT_LOAD ; +} + +SECTIONS +{ + /* Read-only sections, merged into text segment: */ + . = KERNLOADADDR ; + .interp : { *(.interp) } :interp + .hash : { *(.hash) } :text + .dynsym : { *(.dynsym) } + .dynstr : { *(.dynstr) } + .gnu.version : { *(.gnu.version) } + .gnu.version_d : { *(.gnu.version_d) } + .gnu.version_r : { *(.gnu.version_r) } + .rel.init : { *(.rel.init) } + .rela.init : { *(.rela.init) } + .rel.text : + { + *(.rel.text) + *(.rel.text.*) + *(.rel.gnu.linkonce.t.*) + } + .rela.text : + { + *(.rela.text) + *(.rela.text.*) + *(.rela.gnu.linkonce.t.*) + } + .rel.fini : { *(.rel.fini) } + .rela.fini : { *(.rela.fini) } + .rel.rodata : + { + *(.rel.rodata) + *(.rel.rodata.*) + *(.rel.gnu.linkonce.r.*) + } + .rela.rodata : + { + *(.rela.rodata) + *(.rela.rodata.*) + *(.rela.gnu.linkonce.r.*) + } + .rel.data : + { + *(.rel.data) + *(.rel.data.*) + *(.rel.gnu.linkonce.d.*) + } + .rela.data : + { + *(.rela.data) + *(.rela.data.*) + *(.rela.gnu.linkonce.d.*) + } + .rel.ctors : { *(.rel.ctors) } + .rela.ctors : { *(.rela.ctors) } + .rel.dtors : { *(.rel.dtors) } + .rela.dtors : { *(.rela.dtors) } + .rel.got : { *(.rel.got) } + .rela.got : { *(.rela.got) } + .rel.sdata : + { + *(.rel.sdata) + *(.rel.sdata.*) + *(.rel.gnu.linkonce.s.*) + } + .rela.sdata : + { + *(.rela.sdata) + *(.rela.sdata.*) + *(.rela.gnu.linkonce.s.*) + } + .rel.sbss : + { + *(.rel.sbss) + *(.rel.sbss.*) + *(.rel.gnu.linkonce.sb.*) + } + .rela.sbss : + { + *(.rela.sbss) + *(.rela.sbss.*) + *(.rel.gnu.linkonce.sb.*) + } + .rel.sdata2 : + { + *(.rel.sdata2) + *(.rel.sdata2.*) + *(.rel.gnu.linkonce.s2.*) + } + .rela.sdata2 : + { + *(.rela.sdata2) + *(.rela.sdata2.*) + *(.rela.gnu.linkonce.s2.*) + } + .rel.sbss2 : + { + *(.rel.sbss2) + *(.rel.sbss2.*) + *(.rel.gnu.linkonce.sb2.*) + } + .rela.sbss2 : + { + *(.rela.sbss2) + *(.rela.sbss2.*) + *(.rela.gnu.linkonce.sb2.*) + } + .rel.bss : + { + *(.rel.bss) + *(.rel.bss.*) + *(.rel.gnu.linkonce.b.*) + } + .rela.bss : + { + *(.rela.bss) + *(.rela.bss.*) + *(.rela.gnu.linkonce.b.*) + } + .rel.plt : { *(.rel.plt) } + .rela.plt : { *(.rela.plt) } + .init : + { + KEEP (*(.init)) + } :text =0x1000000 + .text : + { + *(.trap) + *(.text) + *(.text.*) + *(.stub) + /* .gnu.warning sections are handled specially by elf32.em. */ + *(.gnu.warning) + *(.gnu.linkonce.t.*) + } =0x1000000 + .fini : + { + KEEP (*(.fini)) + } =0x1000000 + PROVIDE (__etext = .); + PROVIDE (_etext = .); + PROVIDE (etext = .); + .rodata : { *(.rodata) *(.rodata.*) *(.gnu.linkonce.r.*) } + .rodata1 : { *(.rodata1) } + .reginfo : { *(.reginfo) } + .sdata2 : { *(.sdata2) *(.sdata2.*) *(.gnu.linkonce.s2.*) } + .sbss2 : { *(.sbss2) *(.sbss2.*) *(.gnu.linkonce.sb2.*) } + . = ALIGN(0x2000) + (. & (0x2000 - 1)); + .data : + { + *(.data) + *(.data.*) + *(.gnu.linkonce.d.*) + SORT(CONSTRUCTORS) + } :data + .data1 : { *(.data1) } + .eh_frame : { KEEP (*(.eh_frame)) } + .gcc_except_table : { *(.gcc_except_table) } + .ctors : + { + /* gcc uses crtbegin.o to find the start of + the constructors, so we make sure it is + first. Because this is a wildcard, it + doesn't matter if the user does not + actually link against crtbegin.o; the + linker won't look for a file to match a + wildcard. The wildcard also means that it + doesn't matter which directory crtbegin.o + is in. */ + KEEP (*crtbegin.o(.ctors)) + /* We don't want to include the .ctor section from + from the crtend.o file until after the sorted ctors. + The .ctor section from the crtend file contains the + end of ctors marker and it must be last */ + KEEP (*(EXCLUDE_FILE (*crtend.o ) .ctors)) + KEEP (*(SORT(.ctors.*))) + KEEP (*(.ctors)) + } + .dtors : + { + KEEP (*crtbegin.o(.dtors)) + KEEP (*(EXCLUDE_FILE (*crtend.o ) .dtors)) + KEEP (*(SORT(.dtors.*))) + KEEP (*(.dtors)) + } + .plt : { *(.plt) } + _gp = ALIGN(16) + 0x7ff0; + .got : { *(.got.plt) *(.got) } + .dynamic : { *(.dynamic) } :dynamic + /* We want the small data sections together, so single-instruction offsets + can access them all, and initialized data all before uninitialized, so + we can shorten the on-disk segment size. */ + .sdata : + { + *(.sdata) + *(.sdata.*) + *(.gnu.linkonce.s.*) + } + _edata = .; + PROVIDE (edata = .); + __bss_start = .; + .sbss : + { + PROVIDE (__sbss_start = .); + PROVIDE (___sbss_start = .); + *(.dynsbss) + *(.sbss) + *(.sbss.*) + *(.gnu.linkonce.sb.*) + *(.scommon) + PROVIDE (__sbss_end = .); + PROVIDE (___sbss_end = .); + } + .bss : + { + *(.dynbss) + *(.bss) + *(.bss.*) + *(.gnu.linkonce.b.*) + *(COMMON) + /* Align here to ensure that the .bss section occupies space up to + _end. Align after .bss to ensure correct alignment even if the + .bss section disappears because there are no input sections. */ + . = ALIGN(64 / 8); + } + . = ALIGN(64 / 8); + _end = .; + PROVIDE (end = .); + /* Stabs debugging sections. */ + .stab 0 : { *(.stab) } + .stabstr 0 : { *(.stabstr) } + .stab.excl 0 : { *(.stab.excl) } + .stab.exclstr 0 : { *(.stab.exclstr) } + .stab.index 0 : { *(.stab.index) } + .stab.indexstr 0 : { *(.stab.indexstr) } + .comment 0 : { *(.comment) } + /* DWARF debug sections. + Symbols in the DWARF debugging sections are relative to the beginning + of the section so we begin them at 0. */ + /* DWARF 1 */ + .debug 0 : { *(.debug) } + .line 0 : { *(.line) } + /* GNU DWARF 1 extensions */ + .debug_srcinfo 0 : { *(.debug_srcinfo) } + .debug_sfnames 0 : { *(.debug_sfnames) } + /* DWARF 1.1 and DWARF 2 */ + .debug_aranges 0 : { *(.debug_aranges) } + .debug_pubnames 0 : { *(.debug_pubnames) } + /* DWARF 2 */ + .debug_info 0 : { *(.debug_info) *(.gnu.linkonce.wi.*) } + .debug_abbrev 0 : { *(.debug_abbrev) } + .debug_line 0 : { *(.debug_line) } + .debug_frame 0 : { *(.debug_frame) } + .debug_str 0 : { *(.debug_str) } + .debug_loc 0 : { *(.debug_loc) } + .debug_macinfo 0 : { *(.debug_macinfo) } + /* SGI/MIPS DWARF 2 extensions */ + .debug_weaknames 0 : { *(.debug_weaknames) } + .debug_funcnames 0 : { *(.debug_funcnames) } + .debug_typenames 0 : { *(.debug_typenames) } + .debug_varnames 0 : { *(.debug_varnames) } + /* These must appear regardless of . */ +} Added: head/sys/mips/conf/SWARM64 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/SWARM64 Wed Sep 15 05:32:10 2010 (r212634) @@ -0,0 +1,20 @@ +# +# $FreeBSD$ +# + +include SWARM_COMMON + +ident SWARM64 + +makeoptions ARCH_FLAGS="-mabi=64 -march=mips64" +makeoptions LDSCRIPT_NAME=ldscript.mips.64.cfe +makeoptions KERNLOADADDR=0xffffffff80001000 + +# +# XXX restrict memory to maximum 4GB because page table entries in pmap +# are still 32 bits wide + +# +# MAXMEM is specified in units of KB +# +options MAXMEM=0x400000 Added: head/sys/mips/conf/SWARM64_SMP ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/SWARM64_SMP Wed Sep 15 05:32:10 2010 (r212634) @@ -0,0 +1,23 @@ +# +# $FreeBSD$ +# + +include SWARM_COMMON + +ident SWARM64_SMP + +options SMP +options PRINTF_BUFR_SIZE=128 + +makeoptions ARCH_FLAGS="-mabi=64 -march=mips64" +makeoptions LDSCRIPT_NAME=ldscript.mips.64.cfe +makeoptions KERNLOADADDR=0xffffffff80001000 + +# +# XXX restrict memory to maximum 4GB because page table entries in pmap +# are still 32 bits wide + +# +# MAXMEM is specified in units of KB +# +options MAXMEM=0x400000 From owner-svn-src-head@FreeBSD.ORG Wed Sep 15 07:04:15 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 47A0E106567A; Wed, 15 Sep 2010 07:04:15 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 379988FC1A; Wed, 15 Sep 2010 07:04:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8F74FSQ024732; Wed, 15 Sep 2010 07:04:15 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8F74Fca024727; Wed, 15 Sep 2010 07:04:15 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201009150704.o8F74Fca024727@svn.freebsd.org> From: Alexander Motin Date: Wed, 15 Sep 2010 07:04:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212635 - in head/share/man: man4 man7 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2010 07:04:15 -0000 Author: mav Date: Wed Sep 15 07:04:14 2010 New Revision: 212635 URL: http://svn.freebsd.org/changeset/base/212635 Log: Add eventtimers(7) man page, briefly describing event timers subsystem functionality and configuration options. Added: head/share/man/man7/eventtimers.7 (contents, props changed) Modified: head/share/man/man4/hpet.4 head/share/man/man7/Makefile head/share/man/man7/tuning.7 Modified: head/share/man/man4/hpet.4 ============================================================================== --- head/share/man/man4/hpet.4 Wed Sep 15 05:32:10 2010 (r212634) +++ head/share/man/man4/hpet.4 Wed Sep 15 07:04:14 2010 (r212635) @@ -95,7 +95,7 @@ group is bound to specific CPU core. Thi of these comparators has own unsharable IRQ. .Sh SEE ALSO .Xr acpi 4 , -.Xr eventtimer 4 +.Xr eventtimers 7 .Sh HISTORY The .Nm Modified: head/share/man/man7/Makefile ============================================================================== --- head/share/man/man7/Makefile Wed Sep 15 05:32:10 2010 (r212634) +++ head/share/man/man7/Makefile Wed Sep 15 07:04:14 2010 (r212635) @@ -10,6 +10,7 @@ MAN= adding_user.7 \ c99.7 \ development.7 \ environ.7 \ + eventtimers.7 \ ffs.7 \ firewall.7 \ hier.7 \ Added: head/share/man/man7/eventtimers.7 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man7/eventtimers.7 Wed Sep 15 07:04:14 2010 (r212635) @@ -0,0 +1,131 @@ +.\" Copyright (c) 2010 Alexander Motin +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd September 15, 2010 +.Dt eventtimers 4 +.Os +.Sh NAME +.Nm eventtimers +.Nd kernel event timers subsystem +.Sh SYNOPSIS +Kernel uses several types of time-related devices, such as: real time clocks, +time counters and event timers. +Real time clocks responsible for tracking real world time, mostly when system +is down. +Time counters are responsible for generation of monotonically increasing +timestamps for precise uptime tracking purposes, when system is running. +Event timers are responsible for generating interrupts at specified time or +periodically, to run different time-based events. +This page is about the last. +.Sh DESCRIPTION +Kernel uses time-based events for many different purposes: scheduling, +statistics, time keeping, profiling and many other things, based on +.Xr callout 9 +mechanism. +These purposes now grouped into three main callbacks: +.Bl -tag +.It hardclock() +.Xr callout 9 +and timekeeping events entry. Called with frequency defined by hz variable, +usually 1000Hz. +.It statclock() +statistics and scheduler events entry. Called with frequency about 128Hz. +.It profclock() +profiler events entry. When enabled, called with frequency about 8KHz. +.El +Different platforms provide different kinds of timer hardware. +The goal of the event timers subsystem is to provide unified way to control +that hardware, and to use it, supplying kernel with all required time-based +events. +.Pp +Each driver implementing event timers, registers them at the subsystem. +It is possible to see the list of present event timers, like this, via +.Va kern.eventtimer +sysctl: +.Bd -literal +kern.eventtimer.choice: HPET(550) LAPIC(400) i8254(100) RTC(0) +kern.eventtimer.et.LAPIC.flags: 15 +kern.eventtimer.et.LAPIC.frequency: 0 +kern.eventtimer.et.LAPIC.quality: 400 +kern.eventtimer.et.i8254.flags: 1 +kern.eventtimer.et.i8254.frequency: 1193182 +kern.eventtimer.et.i8254.quality: 100 +kern.eventtimer.et.RTC.flags: 17 +kern.eventtimer.et.RTC.frequency: 32768 +kern.eventtimer.et.RTC.quality: 0 +kern.eventtimer.et.HPET.flags: 7 +kern.eventtimer.et.HPET.frequency: 14318180 +kern.eventtimer.et.HPET.quality: 550 +.Ed +, where: +.Bl -tag +.It Va kern.eventtimer.et. Ns Ar X Ns Va .flags +bitmask, defining event timer capabilities: +.Bl -tag -compact +.It 1 +periodic mode supported, +.It 2 +one-shot mode supported, +.It 4 +timer is per-CPU, +.It 8 +timer may stop when CPU goes to sleep state, +.It 16 +timer supports only power-of-2 divisors. +.El +.It Va kern.eventtimer.et. Ns Ar X Ns Va .frequency +timer base frequency, +.It Va kern.eventtimer.et. Ns Ar X Ns Va .quality +integral value, defining how good is this timer, comparing to others. +.El +.Pp +Timers management code of the kernel chooses one timer from that list. +Current choice can be read and affected via +.Va kern.eventtimer.timer +tunable/sysctl. +Several other tunables/sysctls are affecting how exactly this timer is used: +.Bl -tag +.It Va kern.eventtimer.periodic +allows to choose periodic and one-shot operation mode. +In periodic mode, periodic interrupts from timer hardware are taken as the +only source of time for time events. +One-shot mode instead uses currently selected time counter to precisely +schedule all needed events and programs event timer to generate interrupt +exactly in specified time. +Default value depends of chosen timer capabilities, but one-shot mode is +preferred, until other is forced by user or hardware. +.It Va kern.eventtimer.singlemul +in periodic mode specifies how much times higher timer frequency should be, +to not strictly alias hardclock() and statclock() events. Default values are +1, 2 or 4, depending on configured HZ value. +.It Va kern.eventtimer.idletick +makes each CPU to receive every timer interrupt independently of whether they +busy or not. By default this options is disabled. If chosen timer is per-CPU +and runs in periodic mode, this option has no effect - all interrupts are +always generating. +.El +.Sh SEE ALSO +.Xr hpet 4 Modified: head/share/man/man7/tuning.7 ============================================================================== --- head/share/man/man7/tuning.7 Wed Sep 15 05:32:10 2010 (r212634) +++ head/share/man/man7/tuning.7 Wed Sep 15 07:04:14 2010 (r212635) @@ -1019,6 +1019,7 @@ over services you export from your box ( .Xr rc.conf 5 , .Xr sysctl.conf 5 , .Xr firewall 7 , +.Xr eventtimers 7 , .Xr hier 7 , .Xr ports 7 , .Xr boot 8 , From owner-svn-src-head@FreeBSD.ORG Wed Sep 15 07:10:40 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 15A631065670; Wed, 15 Sep 2010 07:10:40 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 049068FC13; Wed, 15 Sep 2010 07:10:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8F7AdHT024889; Wed, 15 Sep 2010 07:10:39 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8F7Ad48024884; Wed, 15 Sep 2010 07:10:39 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201009150710.o8F7Ad48024884@svn.freebsd.org> From: Alexander Motin Date: Wed, 15 Sep 2010 07:10:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212636 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2010 07:10:40 -0000 Author: mav Date: Wed Sep 15 07:10:39 2010 New Revision: 212636 URL: http://svn.freebsd.org/changeset/base/212636 Log: Change licenses of my manual pages to the recommended 2-clause form. Suggested by: joel Modified: head/share/man/man4/ahci.4 head/share/man/man4/hpet.4 head/share/man/man4/mvs.4 head/share/man/man4/siis.4 Modified: head/share/man/man4/ahci.4 ============================================================================== --- head/share/man/man4/ahci.4 Wed Sep 15 07:04:14 2010 (r212635) +++ head/share/man/man4/ahci.4 Wed Sep 15 07:10:39 2010 (r212636) @@ -9,19 +9,18 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. The name of the author may not be used to endorse or promote products -.\" derived from this software without specific prior written permission. .\" -.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" Modified: head/share/man/man4/hpet.4 ============================================================================== --- head/share/man/man4/hpet.4 Wed Sep 15 07:04:14 2010 (r212635) +++ head/share/man/man4/hpet.4 Wed Sep 15 07:10:39 2010 (r212636) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2009 Alexander Motin +.\" Copyright (c) 2010 Alexander Motin .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -9,19 +9,18 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. The name of the author may not be used to endorse or promote products -.\" derived from this software without specific prior written permission. .\" -.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" Modified: head/share/man/man4/mvs.4 ============================================================================== --- head/share/man/man4/mvs.4 Wed Sep 15 07:04:14 2010 (r212635) +++ head/share/man/man4/mvs.4 Wed Sep 15 07:10:39 2010 (r212636) @@ -9,19 +9,18 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. The name of the author may not be used to endorse or promote products -.\" derived from this software without specific prior written permission. .\" -.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" Modified: head/share/man/man4/siis.4 ============================================================================== --- head/share/man/man4/siis.4 Wed Sep 15 07:04:14 2010 (r212635) +++ head/share/man/man4/siis.4 Wed Sep 15 07:10:39 2010 (r212636) @@ -9,19 +9,18 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. The name of the author may not be used to endorse or promote products -.\" derived from this software without specific prior written permission. .\" -.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" From owner-svn-src-head@FreeBSD.ORG Wed Sep 15 08:02:13 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D66A01065672; Wed, 15 Sep 2010 08:02:13 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 711618FC1D; Wed, 15 Sep 2010 08:02:12 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id o8F829cd004173 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 15 Sep 2010 11:02:09 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id o8F829wG046134; Wed, 15 Sep 2010 11:02:09 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id o8F828xU046133; Wed, 15 Sep 2010 11:02:08 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 15 Sep 2010 11:02:08 +0300 From: Kostik Belousov To: David Xu Message-ID: <20100915080208.GG2465@deviant.kiev.zoral.com.ua> References: <201009150256.o8F2uXwX004579@svn.freebsd.org> <20100914231728.33ca7466@kan.dnsalias.net> <4C90ABD8.1020609@freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="VRy2DAmnTueP9XfJ" Content-Disposition: inline In-Reply-To: <4C90ABD8.1020609@freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Alexander Kabaev Subject: Re: svn commit: r212630 - in head/lib/libthr: . thread X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2010 08:02:14 -0000 --VRy2DAmnTueP9XfJ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Sep 15, 2010 at 11:19:52AM +0000, David Xu wrote: > Alexander Kabaev wrote: > >On Wed, 15 Sep 2010 02:56:33 +0000 (UTC) > >David Xu wrote: > > > >>Author: davidxu > >>Date: Wed Sep 15 02:56:32 2010 > >>New Revision: 212630 > >>URL: http://svn.freebsd.org/changeset/base/212630 > >> > >>Log: > >> add code to support stack unwinding when thread exits. note that > >>only defer-mode cancellation works, asynchrnous mode does not work > >>because it lacks of libuwind's support. stack unwinding is not > >>enabled unless LIBTHR_UNWIND_STACK is defined in Makefile. > >> > >>Modified: > >> head/lib/libthr/Makefile > >> head/lib/libthr/thread/thr_clean.c > >> head/lib/libthr/thread/thr_create.c > >> head/lib/libthr/thread/thr_exit.c > >> head/lib/libthr/thread/thr_init.c > >> head/lib/libthr/thread/thr_private.h > >> > >>Modified: head/lib/libthr/Makefile > >>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > >>--- head/lib/libthr/Makefile Wed Sep 15 01:21:30 2010 > >>(r212629) +++ head/lib/libthr/Makefile Wed Sep 15 02:56:32 > >>2010 (r212630) @@ -25,6 +25,14 @@ > >>CFLAGS+=3D-I${.CURDIR}/../../libexec/rtld- > >>CFLAGS+=3D-I${.CURDIR}/../../libexec/rtld-elf/${MACHINE_CPUARCH} > >>CFLAGS+=3D-I${.CURDIR}/../libthread_db CFLAGS+=3D-Winline > >>+ > >>+LIBTHR_UNWIND_STACK=3Dyes > >>+ > >>+.ifdef LIBTHR_UNWIND_STACK > >>+CFLAGS+=3D-I${.CURDIR}/../../contrib/gcc -fexceptions=20 > >>+CFLAGS+=3D-D_PTHREAD_FORCED_UNWIND > >>+.endif > >>+ > >> > > > >Reaching into bowels of GCC like that is never good. > Any solution ? ;-) >=20 I think the used interfaces are part of the C++ ABI. As such, we can expect them to be present from the runtime support, and provide our own declarations in freebsd-implemented headers. --VRy2DAmnTueP9XfJ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkyQfYAACgkQC3+MBN1Mb4jDzgCg8Q5xwHd6YJvZCssE1r5m3jX8 qzcAoK8B+Xdj/ApOpIFxdXqzKT4i3/BI =CmJ5 -----END PGP SIGNATURE----- --VRy2DAmnTueP9XfJ-- From owner-svn-src-head@FreeBSD.ORG Wed Sep 15 09:27:42 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 91816106564A; Wed, 15 Sep 2010 09:27:42 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com [209.85.216.54]) by mx1.freebsd.org (Postfix) with ESMTP id F1ADB8FC1B; Wed, 15 Sep 2010 09:27:41 +0000 (UTC) Received: by qwg5 with SMTP id 5so5485136qwg.13 for ; Wed, 15 Sep 2010 02:27:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=7rzyHzRBaC82aRSslMGpMthqwGNGV0KeW+wBAXQu4Dw=; b=Z8IaxwUUBhMdlMdAU1Zv/qOWb/Nhxlc3r5WTNUK+t87j7EeXwCLicCdk8vZsc8vfFL ajlC1iB+RlkUP8WPBiMJDrXRcrm9lGQPSkTCPamWPb0SJZKGT6gCX5zIBAs7mfeOXEc8 X4Xt3cQAslELkv/WZfNQNqEDHH6jA3KQfrveA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=LbnNg6E0mdd4Rolb9ELHlHXD+cxurBoh7tjXNMW+xIF/Qv/xDDDy2QpXfwiMhHgdfD GoeDTQKgfSXRFsMBBq+QC2BlhUOTVqt83h5ByKhLuZfSiSMMX8oHJ5BLwInFMADc6VVp yyBNd2E4Tp8yJp3GDpB01tvavNj83qvpV2Ee8= MIME-Version: 1.0 Received: by 10.224.67.82 with SMTP id q18mr868364qai.162.1284542860606; Wed, 15 Sep 2010 02:27:40 -0700 (PDT) Received: by 10.229.19.206 with HTTP; Wed, 15 Sep 2010 02:27:40 -0700 (PDT) In-Reply-To: <201009150119.o8F1JCjW098403@svn.freebsd.org> References: <201009150119.o8F1JCjW098403@svn.freebsd.org> Date: Wed, 15 Sep 2010 13:27:40 +0400 Message-ID: From: pluknet To: Ed Maste Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r212628 - head/sys/dev/aac X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2010 09:27:42 -0000 On 15 September 2010 05:19, Ed Maste wrote: > Author: emaste > Date: Wed Sep 15 01:19:11 2010 > New Revision: 212628 > URL: http://svn.freebsd.org/changeset/base/212628 > > Log: > =A0Add some enums and constants from Adaptec's latest driver > =A0(build 17911). > > Modified: > =A0head/sys/dev/aac/aacreg.h > > Modified: head/sys/dev/aac/aacreg.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/aac/aacreg.h =A0 Wed Sep 15 00:17:52 2010 =A0 =A0 =A0 = =A0(r212627) > +++ head/sys/dev/aac/aacreg.h =A0 Wed Sep 15 01:19:11 2010 =A0 =A0 =A0 = =A0(r212628) > @@ -306,7 +306,9 @@ struct aac_adapter_init { > =A0 =A0 =A0 =A0u_int32_t =A0 =A0 =A0 HostElapsedSeconds; > =A0 =A0 =A0 =A0/* ADAPTER_INIT_STRUCT_REVISION_4 begins here */ > =A0 =A0 =A0 =A0u_int32_t =A0 =A0 =A0 InitFlags; =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0/* flags for supported features */ > -#define AAC_INITFLAGS_NEW_COMM_SUPPORTED =A0 =A0 =A0 1 > +#define =A0 =A0 =A0 =A0AAC_INITFLAGS_NEW_COMM_SUPPORTED =A0 =A0 =A0 =A01 > +#define =A0 =A0 =A0 =A0AAC_INITFLAGS_DRIVER_USES_UTC_TIME =A0 =A0 =A00x1= 0 > +#define =A0 =A0 =A0 =A0AAC_INITFLAGS_DRIVER_SUPPORTS_PM =A0 =A0 =A0 =A00= x20 > =A0 =A0 =A0 =A0u_int32_t =A0 =A0 =A0 MaxIoCommands; =A0 =A0 =A0 =A0 =A0/*= max outstanding commands */ > =A0 =A0 =A0 =A0u_int32_t =A0 =A0 =A0 MaxIoSize; =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0/* largest I/O command */ > =A0 =A0 =A0 =A0u_int32_t =A0 =A0 =A0 MaxFibSize; =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 /* largest FIB to adapter */ > @@ -885,6 +887,17 @@ typedef enum { > =A0 =A0 =A0 =A0AifEnBatteryNeedsRecond, =A0 =A0 =A0 =A0/* The battery nee= ds reconditioning */ > =A0 =A0 =A0 =A0AifEnClusterEvent, =A0 =A0 =A0 =A0 =A0 =A0 =A0/* Some clus= ter event */ > =A0 =A0 =A0 =A0AifEnDiskSetEvent, =A0 =A0 =A0 =A0 =A0 =A0 =A0/* A disk se= t event occured. */ > + =A0 =A0 =A0 AifEnContainerScsiEvent, =A0 =A0 =A0 =A0/* a container even= t with no. and scsi id */ > + =A0 =A0 =A0 AifEnPicBatteryEvent, =A0 /* An event gen. by pic_battery.c= for an ABM */ > + =A0 =A0 =A0 AifEnExpEvent, =A0 =A0 =A0 =A0 =A0/* Exp. Event Type to rep= lace CTPopUp messages */ > + =A0 =A0 =A0 AifEnRAID6RebuildDone, =A0/* RAID6 rebuild finished */ > + =A0 =A0 =A0 AifEnSensorOverHeat, =A0 =A0/* Heat Sensor indicate overhea= t */ > + =A0 =A0 =A0 AifEnSensorCoolDown, =A0 =A0/* Heat Sensor ind. cooled down= after overheat */ > + =A0 =A0 =A0 AifFeatureKeysModified, /* notif. of updated feature keys *= / > + =A0 =A0 =A0 AifApplicationExpirationEvent, =A0/* notif. on app. expirat= ion status */ > + =A0 =A0 =A0 AifEnBackgroundConsistencyCheck,/* BCC notif. for NEC - DDT= S 94700 */ > + =A0 =A0 =A0 AifEnAddJBOD, =A0 =A0 =A0 =A0 =A0 /* A new JBOD type drive = was created (30) */ > + =A0 =A0 =A0 AifEnDeleteJBOD, =A0 =A0 =A0 =A0/* A JBOD type drive was de= leted (31) */ > =A0 =A0 =A0 =A0AifDriverNotifyStart=3D199, =A0 =A0 =A0 /* Notifies for ho= st driver go here */ > =A0 =A0 =A0 =A0/* Host driver notifications start here */ > =A0 =A0 =A0 =A0AifDenMorphComplete, =A0 =A0 =A0 =A0 =A0 =A0/* A morph ope= ration completed */ Hi. Afaik, these are somewhere from between b15753 and b16119. Just for possible clarification. --- 6_b15753/aacreg.h 2010-05-28 12:51:21.000000000 +0400 +++ 6_b16119/aacreg.h 2010-05-28 12:51:22.000000000 +0400 @@ -306,7 +306,9 @@ u_int32_t HostElapsedSeconds; /* ADAPTER_INIT_STRUCT_REVISION_4 begins here */ u_int32_t InitFlags; /* flags for supported features */ -#define INITFLAGS_NEW_COMM_SUPPORTED 1 +#define AAC_INITFLAGS_NEW_COMM_SUPPORTED 1 +#define AAC_INITFLAGS_DRIVER_USES_UTC_TIME 0x10 +#define AAC_INITFLAGS_DRIVER_SUPPORTS_PM 0x20 u_int32_t MaxIoCommands; /* max outstanding commands= */ u_int32_t MaxIoSize; /* largest I/O command */ u_int32_t MaxFibSize; /* largest FIB to adapter */ [...] --=20 wbr, pluknet From owner-svn-src-head@FreeBSD.ORG Wed Sep 15 09:40:33 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id D3EAD1065679; Wed, 15 Sep 2010 09:40:33 +0000 (UTC) Date: Wed, 15 Sep 2010 09:40:33 +0000 From: Alexander Best To: Alexander Motin Message-ID: <20100915094033.GA95795@freebsd.org> References: <201009150704.o8F74Fca024727@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201009150704.o8F74Fca024727@svn.freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r212635 - in head/share/man: man4 man7 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2010 09:40:33 -0000 thanks. :) -- a13x From owner-svn-src-head@FreeBSD.ORG Wed Sep 15 10:02:46 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9165B1065695; Wed, 15 Sep 2010 10:02:46 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 82A728FC18; Wed, 15 Sep 2010 10:02:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8FA2kXD029239; Wed, 15 Sep 2010 10:02:46 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8FA2kvO029237; Wed, 15 Sep 2010 10:02:46 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201009151002.o8FA2kvO029237@svn.freebsd.org> From: Andriy Gapon Date: Wed, 15 Sep 2010 10:02:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212647 - head/sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2010 10:02:46 -0000 Author: avg Date: Wed Sep 15 10:02:46 2010 New Revision: 212647 URL: http://svn.freebsd.org/changeset/base/212647 Log: sys/pcpu.h: remove a workaround for a fixed ld bug The workaround was incorrectly documented as having something to do with set_pcpu section's progbits, but in fact it was for incorrect placement of __start_set_pcpu because of the bug in ld. The bug was fixed in r210245, see commit message for details. A side-effect of the workaround was that a zero-size set_pcpu section was produced for modules, source code of which included pcpu.h but didn't actually define any dynamic per-cpu variables. This commit should remove the side-effect. The same workaround is present sys/net/vnet.h, has an analogous side-effect and can be removed as well. An UPDATING entry that warns about a need for recent ld is following. MFC after: 1 month Modified: head/sys/sys/pcpu.h Modified: head/sys/sys/pcpu.h ============================================================================== --- head/sys/sys/pcpu.h Wed Sep 15 09:48:18 2010 (r212646) +++ head/sys/sys/pcpu.h Wed Sep 15 10:02:46 2010 (r212647) @@ -44,24 +44,10 @@ /* * Define a set for pcpu data. - * - * We don't use SET_DECLARE because it defines the set as 'a' when we - * want 'aw'. gcc considers uninitialized data in a separate section - * writable, and there is no generic zero initializer that works for - * structs and scalars. */ extern uintptr_t *__start_set_pcpu; extern uintptr_t *__stop_set_pcpu; -__asm__( -#ifdef __arm__ - ".section set_pcpu, \"aw\", %progbits\n" -#else - ".section set_pcpu, \"aw\", @progbits\n" -#endif - "\t.p2align " __XSTRING(CACHE_LINE_SHIFT) "\n" - "\t.previous"); - /* * Array of dynamic pcpu base offsets. Indexed by id. */ From owner-svn-src-head@FreeBSD.ORG Wed Sep 15 10:04:41 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 96ABC106566C; Wed, 15 Sep 2010 10:04:41 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 884818FC13; Wed, 15 Sep 2010 10:04:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8FA4fUA029309; Wed, 15 Sep 2010 10:04:41 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8FA4flm029307; Wed, 15 Sep 2010 10:04:41 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201009151004.o8FA4flm029307@svn.freebsd.org> From: Andriy Gapon Date: Wed, 15 Sep 2010 10:04:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212648 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2010 10:04:41 -0000 Author: avg Date: Wed Sep 15 10:04:41 2010 New Revision: 212648 URL: http://svn.freebsd.org/changeset/base/212648 Log: UPDATING entry for r212647 Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Wed Sep 15 10:02:46 2010 (r212647) +++ head/UPDATING Wed Sep 15 10:04:41 2010 (r212648) @@ -22,6 +22,14 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 9. machines to maximize performance. (To disable malloc debugging, run ln -s aj /etc/malloc.conf.) +20100915: + A workaround for a fixed ld bug has been removed in kernel code, + so make sure that your system ld is built from sources after + revision 210245 (r211583 if building head kernel on stable/8, + r211584 for stable/7). A symptom of incorrect ld version is + different addresses for set_pcpu section and __start_set_pcpu + symbol in kernel and/or modules. + 20100913: The $ipv6_prefer variable in rc.conf(5) has been split into $ip6addrctl_policy and $ipv6_activate_all_interfaces. From owner-svn-src-head@FreeBSD.ORG Wed Sep 15 10:18:18 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CD8FD1065670; Wed, 15 Sep 2010 10:18:18 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BDC268FC14; Wed, 15 Sep 2010 10:18:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8FAIIIX029776; Wed, 15 Sep 2010 10:18:18 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8FAIIjO029773; Wed, 15 Sep 2010 10:18:18 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201009151018.o8FAIIjO029773@svn.freebsd.org> From: Rui Paulo Date: Wed, 15 Sep 2010 10:18:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212649 - head/cddl/usr.sbin/plockstat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2010 10:18:19 -0000 Author: rpaulo Date: Wed Sep 15 10:18:18 2010 New Revision: 212649 URL: http://svn.freebsd.org/changeset/base/212649 Log: Add a man page for plockstat. Sponsored by: The FreeBSD Foundation Added: head/cddl/usr.sbin/plockstat/plockstat.1 (contents, props changed) Modified: head/cddl/usr.sbin/plockstat/Makefile Modified: head/cddl/usr.sbin/plockstat/Makefile ============================================================================== --- head/cddl/usr.sbin/plockstat/Makefile Wed Sep 15 10:04:41 2010 (r212648) +++ head/cddl/usr.sbin/plockstat/Makefile Wed Sep 15 10:18:18 2010 (r212649) @@ -3,7 +3,6 @@ .PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/cmd/plockstat PROG= plockstat -NO_MAN= SRCS= plockstat.c BINDIR?= /usr/sbin Added: head/cddl/usr.sbin/plockstat/plockstat.1 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/usr.sbin/plockstat/plockstat.1 Wed Sep 15 10:18:18 2010 (r212649) @@ -0,0 +1,95 @@ +.\" +.\" Copyright (c) 2010 The FreeBSD Foundation +.\" All rights reserved. +.\" +.\" This software was developed by Rui Paulo under sponsorship from the +.\" FreeBSD Foundation. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd September 13, 2010 +.Dt PLOCKSTAT 1 +.Os +.Sh NAME +.Nm plockstat +.Nd Trace pthread lock statistics using DTrace +.Sh SYNOPSIS +.Nm +.Op Fl vACHV +.Op Fl n Ar count +.Op Fl s Ar depth +.Op Fl e Ar secs +.Op Fl x Ar opt Ns = Ns Ar val +.Ar command +.Op arg... +.Nm +.Op Fl vACHV +.Op Fl n Ar count +.Op Fl s Ar depth +.Op Fl e Ar secs +.Op Fl x Ar opt Ns = Ns Ar val +.Fl p Ar pid +.Sh DESCRIPTION +The +.Nm +utility traces pthread locks (mutexes and rwlocks) and prints statistics about +them. +You can use +.Nm +to investigate bottlenecks in your software. +.Pp +The following options are available: +.Bl -tag -width indent +.It Fl v +Be verbose. +.It Fl A +Print all statistics. +.It Fl C +Print commulative statistics (the default). +.It Fl H +Print an histogram. +.It Fl V +Print the DTrace script about to be used to stderr. +.It Fl n Ar count +Set the aggregation count for the data set. +.It Fl s Ar depth +Set the ustack (userland stack) caller depth. +.It Fl e Ar secs +Does nothing at the moment. +.It Fl x Ar opt Ns = Ns Ar val +Specify DTrace options. +See the +.Xr dtrace 1 +man page for more details. +.El +.Sh EXIT STATUS +.Ex -std +.Sh SEE ALSO +.Xr dtrace 1 , +.Xr pthread 3 +.Sh HISTORY +The +.Nm +utility comes from the OpenSolaris and was first imported into +.Fx 9.0 . From owner-svn-src-head@FreeBSD.ORG Wed Sep 15 10:31:28 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 052EA10656AA; Wed, 15 Sep 2010 10:31:28 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E9C548FC2A; Wed, 15 Sep 2010 10:31:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8FAVR9c030121; Wed, 15 Sep 2010 10:31:27 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8FAVRGa030118; Wed, 15 Sep 2010 10:31:27 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201009151031.o8FAVRGa030118@svn.freebsd.org> From: Andriy Gapon Date: Wed, 15 Sep 2010 10:31:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212650 - in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs fs/tmpfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2010 10:31:28 -0000 Author: avg Date: Wed Sep 15 10:31:27 2010 New Revision: 212650 URL: http://svn.freebsd.org/changeset/base/212650 Log: tmpfs, zfs + sendfile: mark page bits as valid after populating it with data Otherwise, adding insult to injury, in addition to double-caching of data we would always copy the data into a vnode's vm object page from backend. This is specific to sendfile case only (VOP_READ with UIO_NOCOPY). PR: kern/141305 Reported by: Wiktor Niesiobedzki Reviewed by: alc Tested by: tools/regression/sockets/sendfile MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c head/sys/fs/tmpfs/tmpfs_vnops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Wed Sep 15 10:18:18 2010 (r212649) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Wed Sep 15 10:31:27 2010 (r212650) @@ -498,6 +498,8 @@ again: sched_unpin(); } VM_OBJECT_LOCK(obj); + if (error == 0) + vm_page_set_valid(m, off, bytes); vm_page_wakeup(m); if (error == 0) uio->uio_resid -= bytes; Modified: head/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vnops.c Wed Sep 15 10:18:18 2010 (r212649) +++ head/sys/fs/tmpfs/tmpfs_vnops.c Wed Sep 15 10:31:27 2010 (r212650) @@ -562,6 +562,8 @@ lookupvpg: sf_buf_free(sf); sched_unpin(); VM_OBJECT_LOCK(vobj); + if (error == 0) + vm_page_set_valid(m, offset, tlen); vm_page_wakeup(m); VM_OBJECT_UNLOCK(vobj); return (error); From owner-svn-src-head@FreeBSD.ORG Wed Sep 15 10:32:32 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C44A8106564A; Wed, 15 Sep 2010 10:32:32 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B583D8FC15; Wed, 15 Sep 2010 10:32:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8FAWW7N030176; Wed, 15 Sep 2010 10:32:32 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8FAWWVf030174; Wed, 15 Sep 2010 10:32:32 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201009151032.o8FAWWVf030174@svn.freebsd.org> From: Rui Paulo Date: Wed, 15 Sep 2010 10:32:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212651 - head/libexec/tftpd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2010 10:32:32 -0000 Author: rpaulo Date: Wed Sep 15 10:32:32 2010 New Revision: 212651 URL: http://svn.freebsd.org/changeset/base/212651 Log: Remove an explicit assignment of the CFLAGS variable intended for debugging purposes only. Modified: head/libexec/tftpd/Makefile Modified: head/libexec/tftpd/Makefile ============================================================================== --- head/libexec/tftpd/Makefile Wed Sep 15 10:31:27 2010 (r212650) +++ head/libexec/tftpd/Makefile Wed Sep 15 10:32:32 2010 (r212651) @@ -6,7 +6,6 @@ SRCS= tftpd.c tftp-io.c tftp-utils.c tft WARNS= 3 WFORMAT=0 MAN= tftpd.8 -CFLAGS=-g -Wall CFLAGS+=-I${.CURDIR}/../../usr.bin/tftp -I${.CURDIR}/../../libexec/tftpd .PATH: ${.CURDIR}/../../usr.bin/tftp COPTFLAGS = -O From owner-svn-src-head@FreeBSD.ORG Wed Sep 15 10:39:22 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5F5C01065670; Wed, 15 Sep 2010 10:39:22 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3568D8FC08; Wed, 15 Sep 2010 10:39:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8FAdMsB030377; Wed, 15 Sep 2010 10:39:22 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8FAdMp4030375; Wed, 15 Sep 2010 10:39:22 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201009151039.o8FAdMp4030375@svn.freebsd.org> From: Andriy Gapon Date: Wed, 15 Sep 2010 10:39:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212652 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2010 10:39:22 -0000 Author: avg Date: Wed Sep 15 10:39:21 2010 New Revision: 212652 URL: http://svn.freebsd.org/changeset/base/212652 Log: zfs: catch up with vm_page_sleep_if_busy changes Reviewed by: alc Approved by: pjd Tested by: tools/regression/fsx MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Wed Sep 15 10:32:32 2010 (r212651) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Wed Sep 15 10:39:21 2010 (r212652) @@ -323,8 +323,17 @@ page_lookup(vnode_t *vp, int64_t start, for (;;) { if ((pp = vm_page_lookup(obj, OFF_TO_IDX(start))) != NULL && vm_page_is_valid(pp, (vm_offset_t)off, nbytes)) { - if (vm_page_sleep_if_busy(pp, FALSE, "zfsmwb")) + if ((pp->oflags & VPO_BUSY) != 0) { + /* + * Reference the page before unlocking and + * sleeping so that the page daemon is less + * likely to reclaim it. + */ + vm_page_lock_queues(); + vm_page_flag_set(pp, PG_REFERENCED); + vm_page_sleep(pp, "zfsmwb"); continue; + } vm_page_busy(pp); vm_page_undirty(pp); } else { @@ -451,8 +460,18 @@ mappedread(vnode_t *vp, int nbytes, uio_ again: if ((m = vm_page_lookup(obj, OFF_TO_IDX(start))) != NULL && vm_page_is_valid(m, (vm_offset_t)off, bytes)) { - if (vm_page_sleep_if_busy(m, FALSE, "zfsmrb")) + if ((m->oflags & VPO_BUSY) != 0) { + /* + * Reference the page before unlocking and + * sleeping so that the page daemon is less + * likely to reclaim it. + */ + vm_page_lock_queues(); + vm_page_flag_set(m, PG_REFERENCED); + vm_page_sleep(m, "zfsmrb"); goto again; + } + vm_page_busy(m); VM_OBJECT_UNLOCK(obj); if (dirbytes > 0) { @@ -478,8 +497,17 @@ again: * but it pessimize performance of sendfile/UFS, that's * why I handle this special case in ZFS code. */ - if (vm_page_sleep_if_busy(m, FALSE, "zfsmrb")) + if ((m->oflags & VPO_BUSY) != 0) { + /* + * Reference the page before unlocking and + * sleeping so that the page daemon is less + * likely to reclaim it. + */ + vm_page_lock_queues(); + vm_page_flag_set(m, PG_REFERENCED); + vm_page_sleep(m, "zfsmrb"); goto again; + } vm_page_busy(m); VM_OBJECT_UNLOCK(obj); if (dirbytes > 0) { From owner-svn-src-head@FreeBSD.ORG Wed Sep 15 10:39:30 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 69C32106564A; Wed, 15 Sep 2010 10:39:30 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5A5228FC13; Wed, 15 Sep 2010 10:39:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8FAdUWV030418; Wed, 15 Sep 2010 10:39:30 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8FAdU4H030416; Wed, 15 Sep 2010 10:39:30 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201009151039.o8FAdU4H030416@svn.freebsd.org> From: Andre Oppermann Date: Wed, 15 Sep 2010 10:39:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212653 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2010 10:39:30 -0000 Author: andre Date: Wed Sep 15 10:39:30 2010 New Revision: 212653 URL: http://svn.freebsd.org/changeset/base/212653 Log: Change the default MSS for IPv4 and IPv6 TCP connections from an artificial power-of-2 rounded number to their real values specified in RFC879 and RFC2460. From the history and existing comments it appears that the rounded numbers were intended to be advantageous for the kernel and mbuf system. However this hasn't been the case at for at least a long time. The mbuf clusters used in tcp_output() have enough space to hold the larger real value for the default MSS for both IPv4 and IPv6. Note that the default MSS is only used when path MTU discovery is disabled. Update and expand related comments. Reviewed by: lsteward (including some word-smithing) MFC after: 2 weeks Modified: head/sys/netinet/tcp.h Modified: head/sys/netinet/tcp.h ============================================================================== --- head/sys/netinet/tcp.h Wed Sep 15 10:39:21 2010 (r212652) +++ head/sys/netinet/tcp.h Wed Sep 15 10:39:30 2010 (r212653) @@ -103,29 +103,37 @@ struct tcphdr { /* - * Default maximum segment size for TCP. - * With an IP MTU of 576, this is 536, - * but 512 is probably more convenient. - * This should be defined as MIN(512, IP_MSS - sizeof (struct tcpiphdr)). - */ -#define TCP_MSS 512 -/* - * TCP_MINMSS is defined to be 216 which is fine for the smallest - * link MTU (256 bytes, AX.25 packet radio) in the Internet. - * However it is very unlikely to come across such low MTU interfaces - * these days (anno dato 2003). - * See tcp_subr.c tcp_minmss SYSCTL declaration for more comments. - * Setting this to "0" disables the minmss check. + * The default maximum segment size (MSS) to be used for new TCP connections + * when path MTU discovery is not enabled. + * + * RFC879 derives the default MSS from the largest datagram size hosts are + * minimally required to handle directly or through IP reassembly minus the + * size of the IP and TCP header. With IPv6 the minimum MTU is specified + * in RFC2460. + * + * For IPv4 the MSS is 576 - sizeof(struct tcpiphdr) + * For IPv6 the MSS is IPV6_MMTU - sizeof(struct ip6_hdr) - sizeof(struct tcphdr) + * + * We use explicit numerical definition here to avoid header pollution. */ -#define TCP_MINMSS 216 +#define TCP_MSS 536 +#define TCP6_MSS 1220 /* - * Default maximum segment size for TCP6. - * With an IP6 MSS of 1280, this is 1220, - * but 1024 is probably more convenient. (xxx kazu in doubt) - * This should be defined as MIN(1024, IP6_MSS - sizeof (struct tcpip6hdr)) + * Limit the lowest MSS we accept from path MTU discovery and the TCP SYN MSS + * option. Allowing too low values of MSS can consume significant amounts of + * resources and be used as a form of a resource exhaustion attack. + * Connections requesting lower MSS values will be rounded up to this value + * and the IP_DF flag is cleared to allow fragmentation along the path. + * + * See tcp_subr.c tcp_minmss SYSCTL declaration for more comments. Setting + * it to "0" disables the minmss check. + * + * The default value is fine for the smallest official link MTU (256 bytes, + * AX.25 packet radio) in the Internet. However it is very unlikely to come + * across such low MTU interfaces these days (anno domini 2003). */ -#define TCP6_MSS 1024 +#define TCP_MINMSS 216 #define TCP_MAXWIN 65535 /* largest value for (unscaled) window */ #define TTCP_CLIENT_SND_WND 4096 /* dflt send window for T/TCP client */ From owner-svn-src-head@FreeBSD.ORG Wed Sep 15 10:44:20 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A6621065670; Wed, 15 Sep 2010 10:44:20 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6AF2A8FC0A; Wed, 15 Sep 2010 10:44:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8FAiKjn030574; Wed, 15 Sep 2010 10:44:20 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8FAiKeF030572; Wed, 15 Sep 2010 10:44:20 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201009151044.o8FAiKeF030572@svn.freebsd.org> From: Andriy Gapon Date: Wed, 15 Sep 2010 10:44:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212654 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2010 10:44:20 -0000 Author: avg Date: Wed Sep 15 10:44:20 2010 New Revision: 212654 URL: http://svn.freebsd.org/changeset/base/212654 Log: zfs mappedread: use uiomove_fromphys where possible Reviewed by: alc Approved by: pjd Tested by: tools/regression/fsx MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Wed Sep 15 10:39:30 2010 (r212653) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Wed Sep 15 10:44:20 2010 (r212654) @@ -479,14 +479,8 @@ again: dirbytes); dirbytes = 0; } - if (error == 0) { - sched_pin(); - sf = sf_buf_alloc(m, SFB_CPUPRIVATE); - va = (caddr_t)sf_buf_kva(sf); - error = uiomove(va + off, bytes, UIO_READ, uio); - sf_buf_free(sf); - sched_unpin(); - } + if (error == 0) + uiomove_fromphys(&m, off, bytes, uio); VM_OBJECT_LOCK(obj); vm_page_wakeup(m); } else if (m != NULL && uio->uio_segflg == UIO_NOCOPY) { From owner-svn-src-head@FreeBSD.ORG Wed Sep 15 10:48:17 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 06A5A1065670; Wed, 15 Sep 2010 10:48:17 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D0DDF8FC1A; Wed, 15 Sep 2010 10:48:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8FAmGUw030737; Wed, 15 Sep 2010 10:48:16 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8FAmG14030735; Wed, 15 Sep 2010 10:48:16 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201009151048.o8FAmG14030735@svn.freebsd.org> From: Andriy Gapon Date: Wed, 15 Sep 2010 10:48:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212655 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2010 10:48:17 -0000 Author: avg Date: Wed Sep 15 10:48:16 2010 New Revision: 212655 URL: http://svn.freebsd.org/changeset/base/212655 Log: zfs mappedread, update_pages: use int for offset and length within a page uint64_t, int64_t were redundant there Approved by: pjd Tested by: tools/regression/fsx MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Wed Sep 15 10:44:20 2010 (r212654) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Wed Sep 15 10:48:16 2010 (r212655) @@ -387,7 +387,7 @@ update_pages(vnode_t *vp, int64_t start, { vm_object_t obj; struct sf_buf *sf; - int64_t off; + int off; ASSERT(vp->v_mount != NULL); obj = vp->v_object; @@ -397,7 +397,7 @@ update_pages(vnode_t *vp, int64_t start, VM_OBJECT_LOCK(obj); for (start &= PAGEMASK; len > 0; start += PAGESIZE) { vm_page_t pp; - uint64_t nbytes = MIN(PAGESIZE - off, len); + int nbytes = MIN(PAGESIZE - off, len); if ((pp = page_lookup(vp, start, off, nbytes)) != NULL) { caddr_t va; @@ -440,9 +440,10 @@ mappedread(vnode_t *vp, int nbytes, uio_ vm_object_t obj; vm_page_t m; struct sf_buf *sf; - int64_t start, off; + int64_t start; caddr_t va; int len = nbytes; + int off; int error = 0; uint64_t dirbytes; @@ -455,11 +456,11 @@ mappedread(vnode_t *vp, int nbytes, uio_ dirbytes = 0; VM_OBJECT_LOCK(obj); for (start &= PAGEMASK; len > 0; start += PAGESIZE) { - uint64_t bytes = MIN(PAGESIZE - off, len); + int bytes = MIN(PAGESIZE - off, len); again: if ((m = vm_page_lookup(obj, OFF_TO_IDX(start))) != NULL && - vm_page_is_valid(m, (vm_offset_t)off, bytes)) { + vm_page_is_valid(m, off, bytes)) { if ((m->oflags & VPO_BUSY) != 0) { /* * Reference the page before unlocking and From owner-svn-src-head@FreeBSD.ORG Wed Sep 15 11:05:42 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 74C7610656A3; Wed, 15 Sep 2010 11:05:42 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4A1A48FC16; Wed, 15 Sep 2010 11:05:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8FB5gCI034488; Wed, 15 Sep 2010 11:05:42 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8FB5ggc034485; Wed, 15 Sep 2010 11:05:42 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201009151105.o8FB5ggc034485@svn.freebsd.org> From: Andriy Gapon Date: Wed, 15 Sep 2010 11:05:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212657 - in head/sys/cddl: compat/opensolaris/sys contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2010 11:05:42 -0000 Author: avg Date: Wed Sep 15 11:05:41 2010 New Revision: 212657 URL: http://svn.freebsd.org/changeset/base/212657 Log: zfs vn_has_cached_data: take into account v_object->cache != NULL This mirrors code in tmpfs. This changge shouldn't affect much read path, it may cause unnecessary vm_page_lookup calls in the case where v_object has no active or inactive pages but has some cache pages. I believe this situation to be non-essential. In write path this change should allow us to properly detect the above case and free a cache page when we write to a range that corresponds to it. If this situation is undetected then we could have a discrepancy between data in page cache and in ARC or on disk. This change allows us to re-enable vn_has_cached_data() check in zfs_write. NOTE: strictly speaking resident_page_count and cache fields of v_object should be exmined under VM_OBJECT_LOCK, but for this particular usage we may get away with it. Discussed with: alc, kib Approved by: pjd Tested with: tools/regression/fsx MFC after: 3 weeks Modified: head/sys/cddl/compat/opensolaris/sys/vnode.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Modified: head/sys/cddl/compat/opensolaris/sys/vnode.h ============================================================================== --- head/sys/cddl/compat/opensolaris/sys/vnode.h Wed Sep 15 11:04:02 2010 (r212656) +++ head/sys/cddl/compat/opensolaris/sys/vnode.h Wed Sep 15 11:05:41 2010 (r212657) @@ -69,7 +69,9 @@ vn_is_readonly(vnode_t *vp) #define vn_vfsunlock(vp) do { } while (0) #define vn_ismntpt(vp) ((vp)->v_type == VDIR && (vp)->v_mountedhere != NULL) #define vn_mountedvfs(vp) ((vp)->v_mountedhere) -#define vn_has_cached_data(vp) ((vp)->v_object != NULL && (vp)->v_object->resident_page_count > 0) +#define vn_has_cached_data(vp) \ + ((vp)->v_object != NULL && ((vp)->v_object->resident_page_count > 0 \ + || (vp)->v_object->cache != NULL)) #define vn_exists(vp) do { } while (0) #define vn_invalid(vp) do { } while (0) #define vn_renamepath(tdvp, svp, tnm, lentnm) do { } while (0) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Wed Sep 15 11:04:02 2010 (r212656) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Wed Sep 15 11:05:41 2010 (r212657) @@ -933,17 +933,7 @@ again: uioskip(uio, tx_bytes); } - /* - * XXXPJD: There are some cases (triggered by fsx) where - * vn_has_cached_data(vp) returns false when it should - * return true. This should be investigated. - */ -#if 0 - if (tx_bytes && vn_has_cached_data(vp)) -#else - if (tx_bytes && vp->v_object != NULL) -#endif - { + if (tx_bytes && vn_has_cached_data(vp)) { update_pages(vp, woff, tx_bytes, zfsvfs->z_os, zp->z_id, uio->uio_segflg, tx); } From owner-svn-src-head@FreeBSD.ORG Wed Sep 15 11:51:09 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 511511065679; Wed, 15 Sep 2010 11:51:09 +0000 (UTC) (envelope-from lstewart@freebsd.org) Received: from lauren.room52.net (lauren.room52.net [210.50.193.198]) by mx1.freebsd.org (Postfix) with ESMTP id 11CA58FC17; Wed, 15 Sep 2010 11:51:08 +0000 (UTC) Received: from lawrence1.loshell.room52.net (ppp59-167-184-191.static.internode.on.net [59.167.184.191]) by lauren.room52.net (Postfix) with ESMTPSA id F0D057E853; Wed, 15 Sep 2010 21:51:06 +1000 (EST) Message-ID: <4C90B326.4000208@freebsd.org> Date: Wed, 15 Sep 2010 21:51:02 +1000 From: Lawrence Stewart User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-AU; rv:1.9.2.9) Gecko/20100913 Lightning/1.0b2 Thunderbird/3.1.3 MIME-Version: 1.0 To: Andre Oppermann References: <201009151039.o8FAdU4H030416@svn.freebsd.org> In-Reply-To: <201009151039.o8FAdU4H030416@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on lauren.room52.net Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r212653 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2010 11:51:09 -0000 On 09/15/10 20:39, Andre Oppermann wrote: > Author: andre > Date: Wed Sep 15 10:39:30 2010 > New Revision: 212653 > URL: http://svn.freebsd.org/changeset/base/212653 > > Log: > Change the default MSS for IPv4 and IPv6 TCP connections from an > artificial power-of-2 rounded number to their real values specified > in RFC879 and RFC2460. > > From the history and existing comments it appears that the rounded > numbers were intended to be advantageous for the kernel and mbuf > system. However this hasn't been the case at for at least a long > time. The mbuf clusters used in tcp_output() have enough space > to hold the larger real value for the default MSS for both IPv4 and > IPv6. Note that the default MSS is only used when path MTU discovery > is disabled. > > Update and expand related comments. > > Reviewed by: lsteward (including some word-smithing) For the record, I reviewed and fully support the functional changes made by this patch, but explicitly objected to and offered an alternate for the proposed comment wording changes. Andre, given that we had a disagreement about the comment wording, I would have preferred it if you had noted in your commit log that I had raised an objection to or at least not reviewed/endorsed the comment changes. It's not important enough an issue to spend any more time on, but I'm a bit upset to see this committed with an acknowledgement to my review and word-smithing, much of which ended up being ignored (which is fine, but then don't put my name to it). Cheers, Lawrence From owner-svn-src-head@FreeBSD.ORG Wed Sep 15 12:39:39 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4006B106566C; Wed, 15 Sep 2010 12:39:39 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id 939ED8FC0A; Wed, 15 Sep 2010 12:39:38 +0000 (UTC) Received: by vws7 with SMTP id 7so129952vws.13 for ; Wed, 15 Sep 2010 05:39:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:in-reply-to:references:x-mailer:mime-version :content-type; bh=4O1R51M1n6937lEcenaVMr0tUp3zOhvAQma/LAm4wFA=; b=b5x3xm5R7gmSG55+kvKVNTUe4veoFOlU/FDkfqzZB9oBx6n7rBhL6iz7Dwck6KbDpV HggNw5vTtUWnVrtDxSvRQ1MyfPW4c89nQs3SO5d8MvDGebTvB+g6lqrfRL0bf7oYVXKn dEP52Ob5L4F4hh/+yLkn00+L8xGRNf7ML2Ns0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:in-reply-to:references:x-mailer :mime-version:content-type; b=RXGDt9vdvXg4LTi4cHaR4qg676Yz9RNL2XgBxzcukv8Ks8OIqy8ysAoHchJRZYxAUH YDFVBRBlqFNarsqOZoePjoaZnbbnO7Z+444QbjJsbVaAw6hNbKxd4U89OaxxsWGrKS/x vwAGAf+Yp/v1xyeWVqt/hfRmFhOr/UqsIi/uc= Received: by 10.220.63.11 with SMTP id z11mr856773vch.37.1284554377670; Wed, 15 Sep 2010 05:39:37 -0700 (PDT) Received: from kan.dnsalias.net (c-24-63-226-98.hsd1.ma.comcast.net [24.63.226.98]) by mx.google.com with ESMTPS id n9sm682650vch.43.2010.09.15.05.39.36 (version=SSLv3 cipher=RC4-MD5); Wed, 15 Sep 2010 05:39:36 -0700 (PDT) Date: Wed, 15 Sep 2010 08:39:23 -0400 From: Alexander Kabaev To: David Xu Message-ID: <20100915083923.0121b163@kan.dnsalias.net> In-Reply-To: <4C90ABD8.1020609@freebsd.org> References: <201009150256.o8F2uXwX004579@svn.freebsd.org> <20100914231728.33ca7466@kan.dnsalias.net> <4C90ABD8.1020609@freebsd.org> X-Mailer: Claws Mail 3.7.6 (GTK+ 2.20.1; amd64-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/umHNZMPnAPJZC0+oz4OPPNG"; protocol="application/pgp-signature" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r212630 - in head/lib/libthr: . thread X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2010 12:39:39 -0000 --Sig_/umHNZMPnAPJZC0+oz4OPPNG Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Wed, 15 Sep 2010 11:19:52 +0000 David Xu wrote: > >=20 > > Reaching into bowels of GCC like that is never good. > Any solution ? ;-) >=20 I agree with Konstantin, we should either import appropriately licensed header from libunwind or, better yet, just provide our own. --=20 Alexander Kabaev --Sig_/umHNZMPnAPJZC0+oz4OPPNG Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (FreeBSD) iD8DBQFMkL6HQ6z1jMm+XZYRAslBAKCcTnwXYsXHbtvqJHZbLSYXIR1y2wCePTYk eaVzPmZ+IaZ67CZTSv6YcGc= =SvU5 -----END PGP SIGNATURE----- --Sig_/umHNZMPnAPJZC0+oz4OPPNG-- From owner-svn-src-head@FreeBSD.ORG Wed Sep 15 14:04:44 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4BD9C10656A9 for ; Wed, 15 Sep 2010 14:04:44 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) by mx1.freebsd.org (Postfix) with ESMTP id 94CD78FC2E for ; Wed, 15 Sep 2010 14:04:43 +0000 (UTC) Received: (qmail 71645 invoked from network); 15 Sep 2010 13:59:31 -0000 Received: from localhost (HELO [127.0.0.1]) ([127.0.0.1]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 15 Sep 2010 13:59:31 -0000 Message-ID: <4C90D27D.4070306@freebsd.org> Date: Wed, 15 Sep 2010 16:04:45 +0200 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.8) Gecko/20100802 Thunderbird/3.1.2 MIME-Version: 1.0 To: Lawrence Stewart References: <201009151039.o8FAdU4H030416@svn.freebsd.org> <4C90B326.4000208@freebsd.org> In-Reply-To: <4C90B326.4000208@freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r212653 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2010 14:04:44 -0000 On 15.09.2010 13:51, Lawrence Stewart wrote: > On 09/15/10 20:39, Andre Oppermann wrote: >> Author: andre >> Date: Wed Sep 15 10:39:30 2010 >> New Revision: 212653 >> URL: http://svn.freebsd.org/changeset/base/212653 >> >> Log: >> Change the default MSS for IPv4 and IPv6 TCP connections from an >> artificial power-of-2 rounded number to their real values specified >> in RFC879 and RFC2460. >> >> From the history and existing comments it appears that the rounded >> numbers were intended to be advantageous for the kernel and mbuf >> system. However this hasn't been the case at for at least a long >> time. The mbuf clusters used in tcp_output() have enough space >> to hold the larger real value for the default MSS for both IPv4 and >> IPv6. Note that the default MSS is only used when path MTU discovery >> is disabled. >> >> Update and expand related comments. >> >> Reviewed by: lsteward (including some word-smithing) > > For the record, I reviewed and fully support the functional changes made > by this patch, but explicitly objected to and offered an alternate for > the proposed comment wording changes. > > Andre, given that we had a disagreement about the comment wording, I > would have preferred it if you had noted in your commit log that I had > raised an objection to or at least not reviewed/endorsed the comment > changes. I've adapted many of your suggestions on the wording compared to my first version. For some parts I felt that my wording/description was more appropriate. In the end neither of our wordings is plain wrong or factually incorrect. > It's not important enough an issue to spend any more time on, but I'm a > bit upset to see this committed with an acknowledgement to my review and > word-smithing, much of which ended up being ignored (which is fine, but > then don't put my name to it). I apologize for not having made your different opinion to the wording clear enough in the commit message. My intent was to communicate that you not only reviewed the functional change but also provided input on the wording (which I in fact did not incorporate to some extent but not entirely). Below is the wording proposed by Lawrence: /* * The default Maximum Segment Size (MSS) to use when we do not have specific * knowledge (e.g. via path MTU discovery) that the destination host is prepared * to accept larger datagrams. The smallest allowable IP datagram MTU and * optionless IP/TCP header lengths are used for the calculation as per RFC879. * For IPv4 (RFC791): 576 - 20 - 20 = 536. * For IPv6 (RFC2460): 1280 - 40 - 20 = 1220. */ #define TCP_MSS 536 #define TCP6_MSS 1220 * Limit the lowest MSS we accept for path MTU discovery and the TCP SYN MSS * option. Allowing low values of MSS can consume significant resources and be * used to mount a resource exhaustion attack. Connections requesting lower MSS * values will be rounded up to this value and the IP_DF flag will be cleared to * allow fragmentation along the path. * * See tcp_subr.c tcp_minmss SYSCTL declaration for more comments. Setting this * SYSCTL to "0" disables the minmss check. * * The default value is fine for TCP over IPv4 across the Internet's smallest * known link MTU (256 bytes for AX.25 packet radio). However, a connection is * very unlikely to come across such low MTU interfaces (anno domini 2003). */ #define TCP_MINMSS 216 -- Andre From owner-svn-src-head@FreeBSD.ORG Wed Sep 15 14:17:51 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CF23D1065673; Wed, 15 Sep 2010 14:17:51 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 8C14A8FC18; Wed, 15 Sep 2010 14:17:51 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o8FECRfv088473; Wed, 15 Sep 2010 08:12:27 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Wed, 15 Sep 2010 08:12:34 -0600 (MDT) Message-Id: <20100915.081234.83306312380114674.imp@bsdimp.com> To: kabaev@gmail.com From: "M. Warner Losh" In-Reply-To: <20100914231728.33ca7466@kan.dnsalias.net> References: <201009150256.o8F2uXwX004579@svn.freebsd.org> <20100914231728.33ca7466@kan.dnsalias.net> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, davidxu@freebsd.org Subject: Re: svn commit: r212630 - in head/lib/libthr: . thread X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2010 14:17:51 -0000 In message: <20100914231728.33ca7466@kan.dnsalias.net> Alexander Kabaev writes: : On Wed, 15 Sep 2010 02:56:33 +0000 (UTC) : David Xu wrote: : : > Author: davidxu : > Date: Wed Sep 15 02:56:32 2010 : > New Revision: 212630 : > URL: http://svn.freebsd.org/changeset/base/212630 : > : > Log: : > add code to support stack unwinding when thread exits. note that : > only defer-mode cancellation works, asynchrnous mode does not work : > because it lacks of libuwind's support. stack unwinding is not : > enabled unless LIBTHR_UNWIND_STACK is defined in Makefile. : > : > Modified: : > head/lib/libthr/Makefile : > head/lib/libthr/thread/thr_clean.c : > head/lib/libthr/thread/thr_create.c : > head/lib/libthr/thread/thr_exit.c : > head/lib/libthr/thread/thr_init.c : > head/lib/libthr/thread/thr_private.h : > : > Modified: head/lib/libthr/Makefile : > ============================================================================== : > --- head/lib/libthr/Makefile Wed Sep 15 01:21:30 2010 : > (r212629) +++ head/lib/libthr/Makefile Wed Sep 15 02:56:32 : > 2010 (r212630) @@ -25,6 +25,14 @@ : > CFLAGS+=-I${.CURDIR}/../../libexec/rtld- : > CFLAGS+=-I${.CURDIR}/../../libexec/rtld-elf/${MACHINE_CPUARCH} : > CFLAGS+=-I${.CURDIR}/../libthread_db CFLAGS+=-Winline : > + : > +LIBTHR_UNWIND_STACK=yes : > + : > +.ifdef LIBTHR_UNWIND_STACK : > +CFLAGS+=-I${.CURDIR}/../../contrib/gcc -fexceptions : > +CFLAGS+=-D_PTHREAD_FORCED_UNWIND : > +.endif : > + : > : : Reaching into bowels of GCC like that is never good. Would this pulling in GPL'd code? Warner From owner-svn-src-head@FreeBSD.ORG Wed Sep 15 14:23:55 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 75E471065672; Wed, 15 Sep 2010 14:23:55 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 658788FC14; Wed, 15 Sep 2010 14:23:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8FENtJF039141; Wed, 15 Sep 2010 14:23:55 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8FENtX6039137; Wed, 15 Sep 2010 14:23:55 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201009151423.o8FENtX6039137@svn.freebsd.org> From: Jaakko Heinonen Date: Wed, 15 Sep 2010 14:23:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212660 - head/sys/fs/devfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2010 14:23:55 -0000 Author: jh Date: Wed Sep 15 14:23:55 2010 New Revision: 212660 URL: http://svn.freebsd.org/changeset/base/212660 Log: Remove empty devfs directories automatically. devfs_delete() now recursively removes empty parent directories unless the DEVFS_DEL_NORECURSE flag is specified. devfs_delete() can't be called anymore with a parent directory vnode lock held because the possible parent directory deletion needs to lock the vnode. Thus we unlock the parent directory vnode in devfs_remove() before calling devfs_delete(). Call devfs_populate_vp() from devfs_symlink() and devfs_vptocnp() as now directories can get removed. Add a check for DE_DOOMED flag to devfs_populate_vp() because devfs_delete() drops dm_lock before the VI_DOOMED vnode flag gets set. This ensures that devfs_populate_vp() returns an error for directories which are in progress of deletion. Reviewed by: kib Discussed on: freebsd-current (mostly silence) Modified: head/sys/fs/devfs/devfs.h head/sys/fs/devfs/devfs_devs.c head/sys/fs/devfs/devfs_vnops.c Modified: head/sys/fs/devfs/devfs.h ============================================================================== --- head/sys/fs/devfs/devfs.h Wed Sep 15 13:45:06 2010 (r212659) +++ head/sys/fs/devfs/devfs.h Wed Sep 15 14:23:55 2010 (r212660) @@ -170,12 +170,15 @@ extern unsigned devfs_rule_depth; #define DEVFS_DMP_HOLD(dmp) ((dmp)->dm_holdcnt++) #define DEVFS_DMP_DROP(dmp) (--(dmp)->dm_holdcnt == 0) +#define DEVFS_DEL_VNLOCKED 0x01 +#define DEVFS_DEL_NORECURSE 0x02 + void devfs_rules_apply(struct devfs_mount *dm, struct devfs_dirent *de); void devfs_rules_cleanup (struct devfs_mount *dm); int devfs_rules_ioctl(struct devfs_mount *dm, u_long cmd, caddr_t data, struct thread *td); int devfs_allocv(struct devfs_dirent *de, struct mount *mp, int lockmode, struct vnode **vpp); -void devfs_delete(struct devfs_mount *dm, struct devfs_dirent *de, int vp_locked); +void devfs_delete(struct devfs_mount *dm, struct devfs_dirent *de, int flags); void devfs_dirent_free(struct devfs_dirent *de); void devfs_populate (struct devfs_mount *dm); void devfs_cleanup (struct devfs_mount *dm); Modified: head/sys/fs/devfs/devfs_devs.c ============================================================================== --- head/sys/fs/devfs/devfs_devs.c Wed Sep 15 13:45:06 2010 (r212659) +++ head/sys/fs/devfs/devfs_devs.c Wed Sep 15 14:23:55 2010 (r212660) @@ -275,17 +275,68 @@ devfs_dirent_free(struct devfs_dirent *d } /* + * Removes a directory if it is empty. Also empty parent directories are + * removed recursively. + */ +static void +devfs_rmdir_empty(struct devfs_mount *dm, struct devfs_dirent *de) +{ + struct devfs_dirent *dd, *de_dot, *de_dotdot; + + sx_assert(&dm->dm_lock, SX_XLOCKED); + + for (;;) { + KASSERT(de->de_dirent->d_type == DT_DIR, + ("devfs_rmdir_empty: de is not a directory")); + + if ((de->de_flags & DE_DOOMED) != 0 || de == dm->dm_rootdir) + return; + + de_dot = TAILQ_FIRST(&de->de_dlist); + KASSERT(de_dot != NULL, ("devfs_rmdir_empty: . missing")); + de_dotdot = TAILQ_NEXT(de_dot, de_list); + KASSERT(de_dotdot != NULL, ("devfs_rmdir_empty: .. missing")); + /* Return if the directory is not empty. */ + if (TAILQ_NEXT(de_dotdot, de_list) != NULL) + return; + + dd = devfs_parent_dirent(de); + KASSERT(dd != NULL, ("devfs_rmdir_empty: NULL dd")); + TAILQ_REMOVE(&dd->de_dlist, de, de_list); + DEVFS_DE_HOLD(dd); + devfs_delete(dm, de, DEVFS_DEL_NORECURSE); + devfs_delete(dm, de_dot, DEVFS_DEL_NORECURSE); + devfs_delete(dm, de_dotdot, DEVFS_DEL_NORECURSE); + if (DEVFS_DE_DROP(dd)) { + devfs_dirent_free(dd); + return; + } + + de = dd; + } +} + +/* * The caller needs to hold the dm for the duration of the call since * dm->dm_lock may be temporary dropped. */ void -devfs_delete(struct devfs_mount *dm, struct devfs_dirent *de, int vp_locked) +devfs_delete(struct devfs_mount *dm, struct devfs_dirent *de, int flags) { + struct devfs_dirent *dd; struct vnode *vp; KASSERT((de->de_flags & DE_DOOMED) == 0, ("devfs_delete doomed dirent")); de->de_flags |= DE_DOOMED; + + if ((flags & DEVFS_DEL_NORECURSE) == 0) { + dd = devfs_parent_dirent(de); + if (dd != NULL) + DEVFS_DE_HOLD(dd); + } else + dd = NULL; + mtx_lock(&devfs_de_interlock); vp = de->de_vnode; if (vp != NULL) { @@ -293,12 +344,12 @@ devfs_delete(struct devfs_mount *dm, str mtx_unlock(&devfs_de_interlock); vholdl(vp); sx_unlock(&dm->dm_lock); - if (!vp_locked) + if ((flags & DEVFS_DEL_VNLOCKED) == 0) vn_lock(vp, LK_EXCLUSIVE | LK_INTERLOCK | LK_RETRY); else VI_UNLOCK(vp); vgone(vp); - if (!vp_locked) + if ((flags & DEVFS_DEL_VNLOCKED) == 0) VOP_UNLOCK(vp, 0); vdrop(vp); sx_xlock(&dm->dm_lock); @@ -317,6 +368,13 @@ devfs_delete(struct devfs_mount *dm, str } if (DEVFS_DE_DROP(de)) devfs_dirent_free(de); + + if (dd != NULL) { + if (DEVFS_DE_DROP(dd)) + devfs_dirent_free(dd); + else + devfs_rmdir_empty(dm, dd); + } } /* @@ -331,19 +389,24 @@ devfs_purge(struct devfs_mount *dm, stru struct devfs_dirent *de; sx_assert(&dm->dm_lock, SX_XLOCKED); + + DEVFS_DE_HOLD(dd); for (;;) { de = TAILQ_FIRST(&dd->de_dlist); if (de == NULL) break; TAILQ_REMOVE(&dd->de_dlist, de, de_list); - if (de->de_flags & (DE_DOT|DE_DOTDOT)) - devfs_delete(dm, de, 0); + if (de->de_flags & (DE_DOT | DE_DOTDOT)) + devfs_delete(dm, de, DEVFS_DEL_NORECURSE); else if (de->de_dirent->d_type == DT_DIR) devfs_purge(dm, de); - else - devfs_delete(dm, de, 0); + else + devfs_delete(dm, de, DEVFS_DEL_NORECURSE); } - devfs_delete(dm, dd, 0); + if (DEVFS_DE_DROP(dd)) + devfs_dirent_free(dd); + else if ((dd->de_flags & DE_DOOMED) == 0) + devfs_delete(dm, dd, DEVFS_DEL_NORECURSE); } /* Modified: head/sys/fs/devfs/devfs_vnops.c ============================================================================== --- head/sys/fs/devfs/devfs_vnops.c Wed Sep 15 13:45:06 2010 (r212659) +++ head/sys/fs/devfs/devfs_vnops.c Wed Sep 15 14:23:55 2010 (r212660) @@ -36,7 +36,6 @@ /* * TODO: - * remove empty directories * mkdir: want it ? */ @@ -191,6 +190,7 @@ devfs_clear_cdevpriv(void) static int devfs_populate_vp(struct vnode *vp) { + struct devfs_dirent *de; struct devfs_mount *dmp; int locked; @@ -214,7 +214,14 @@ devfs_populate_vp(struct vnode *vp) devfs_unmount_final(dmp); return (EBADF); } - if (vp->v_iflag & VI_DOOMED) { + if ((vp->v_iflag & VI_DOOMED) != 0) { + sx_xunlock(&dmp->dm_lock); + return (EBADF); + } + de = vp->v_data; + KASSERT(de != NULL, + ("devfs_populate_vp: vp->v_data == NULL but vnode not doomed")); + if ((de->de_flags & DE_DOOMED) != 0) { sx_xunlock(&dmp->dm_lock); return (EBADF); } @@ -234,11 +241,13 @@ devfs_vptocnp(struct vop_vptocnp_args *a int i, error; dmp = VFSTODEVFS(vp->v_mount); + + error = devfs_populate_vp(vp); + if (error != 0) + return (error); + i = *buflen; dd = vp->v_data; - error = 0; - - sx_xlock(&dmp->dm_lock); if (vp->v_type == VCHR) { i -= strlen(dd->de_cdp->cdp_c.si_name); @@ -1271,11 +1280,15 @@ devfs_reclaim(struct vop_reclaim_args *a static int devfs_remove(struct vop_remove_args *ap) { + struct vnode *dvp = ap->a_dvp; struct vnode *vp = ap->a_vp; struct devfs_dirent *dd; struct devfs_dirent *de, *de_covered; struct devfs_mount *dmp = VFSTODEVFS(vp->v_mount); + ASSERT_VOP_ELOCKED(dvp, "devfs_remove"); + ASSERT_VOP_ELOCKED(vp, "devfs_remove"); + sx_xlock(&dmp->dm_lock); dd = ap->a_dvp->v_data; de = vp->v_data; @@ -1287,11 +1300,19 @@ devfs_remove(struct vop_remove_args *ap) if (de_covered != NULL) de_covered->de_flags &= ~DE_COVERED; } - devfs_delete(dmp, de, 1); + /* We need to unlock dvp because devfs_delete() may lock it. */ + VOP_UNLOCK(vp, 0); + if (dvp != vp) + VOP_UNLOCK(dvp, 0); + devfs_delete(dmp, de, 0); + sx_xunlock(&dmp->dm_lock); + if (dvp != vp) + vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY); + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); } else { de->de_flags |= DE_WHITEOUT; + sx_xunlock(&dmp->dm_lock); } - sx_xunlock(&dmp->dm_lock); return (0); } @@ -1533,6 +1554,9 @@ devfs_symlink(struct vop_symlink_args *a if (error) return(error); dmp = VFSTODEVFS(ap->a_dvp->v_mount); + if (devfs_populate_vp(ap->a_dvp) != 0) + return (ENOENT); + dd = ap->a_dvp->v_data; de = devfs_newdirent(ap->a_cnp->cn_nameptr, ap->a_cnp->cn_namelen); de->de_uid = 0; @@ -1544,7 +1568,6 @@ devfs_symlink(struct vop_symlink_args *a i = strlen(ap->a_target) + 1; de->de_symlink = malloc(i, M_DEVFS, M_WAITOK); bcopy(ap->a_target, de->de_symlink, i); - sx_xlock(&dmp->dm_lock); #ifdef MAC mac_devfs_create_symlink(ap->a_cnp->cn_cred, dmp->dm_mount, dd, de); #endif From owner-svn-src-head@FreeBSD.ORG Wed Sep 15 14:24:22 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3848E10656CA; Wed, 15 Sep 2010 14:24:22 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0E4BF8FC20; Wed, 15 Sep 2010 14:24:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8FEOLb0039188; Wed, 15 Sep 2010 14:24:21 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8FEOLZE039185; Wed, 15 Sep 2010 14:24:21 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201009151424.o8FEOLZE039185@svn.freebsd.org> From: Attilio Rao Date: Wed, 15 Sep 2010 14:24:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212661 - head/sys/dev/aac X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2010 14:24:22 -0000 Author: attilio Date: Wed Sep 15 14:24:21 2010 New Revision: 212661 URL: http://svn.freebsd.org/changeset/base/212661 Log: Fix bogus busying mechanism from cdevsw callbacks: - D_TRACKCLOSE may be used there as d_close() are expected to match up d_open() calls - Replace the hand-crafted counter and flag with the device_busy()/device_unbusy() proper usage. Sponsored by: Sandvine Incorporated Reported by: Mark Johnston Tested by: Mark Johnston Reviewed by: emaste MFC after: 10 days Modified: head/sys/dev/aac/aac.c head/sys/dev/aac/aacvar.h Modified: head/sys/dev/aac/aac.c ============================================================================== --- head/sys/dev/aac/aac.c Wed Sep 15 14:23:55 2010 (r212660) +++ head/sys/dev/aac/aac.c Wed Sep 15 14:24:21 2010 (r212661) @@ -212,7 +212,7 @@ static struct aac_mntinforesp * static struct cdevsw aac_cdevsw = { .d_version = D_VERSION, - .d_flags = D_NEEDGIANT, + .d_flags = D_NEEDGIANT | D_TRACKCLOSE, .d_open = aac_open, .d_close = aac_close, .d_ioctl = aac_ioctl, @@ -660,9 +660,6 @@ aac_detach(device_t dev) sc = device_get_softc(dev); fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); - if (sc->aac_state & AAC_STATE_OPEN) - return(EBUSY); - callout_drain(&sc->aac_daemontime); /* Remove the child containers */ @@ -2804,8 +2801,7 @@ aac_open(struct cdev *dev, int flags, in sc = dev->si_drv1; fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); - sc->aac_open_cnt++; - sc->aac_state |= AAC_STATE_OPEN; + device_busy(sc->aac_dev); return 0; } @@ -2817,10 +2813,7 @@ aac_close(struct cdev *dev, int flags, i sc = dev->si_drv1; fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); - sc->aac_open_cnt--; - /* Mark this unit as no longer open */ - if (sc->aac_open_cnt == 0) - sc->aac_state &= ~AAC_STATE_OPEN; + device_unbusy(sc->aac_dev); return 0; } Modified: head/sys/dev/aac/aacvar.h ============================================================================== --- head/sys/dev/aac/aacvar.h Wed Sep 15 14:23:55 2010 (r212660) +++ head/sys/dev/aac/aacvar.h Wed Sep 15 14:24:21 2010 (r212661) @@ -319,10 +319,9 @@ struct aac_softc /* controller features, limits and status */ int aac_state; #define AAC_STATE_SUSPEND (1<<0) -#define AAC_STATE_OPEN (1<<1) +#define AAC_STATE_UNUSED0 (1<<1) #define AAC_STATE_INTERRUPTS_ON (1<<2) #define AAC_STATE_AIF_SLEEPER (1<<3) - int aac_open_cnt; struct FsaRevision aac_revision; /* controller hardware interface */ From owner-svn-src-head@FreeBSD.ORG Wed Sep 15 14:36:57 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B470106564A; Wed, 15 Sep 2010 14:36:57 +0000 (UTC) (envelope-from emaste@freebsd.org) Received: from mail1.sandvine.com (Mail1.sandvine.com [64.7.137.134]) by mx1.freebsd.org (Postfix) with ESMTP id 1B47F8FC0A; Wed, 15 Sep 2010 14:36:57 +0000 (UTC) Received: from labgw2.phaedrus.sandvine.com (192.168.222.22) by WTL-EXCH-1.sandvine.com (192.168.196.31) with Microsoft SMTP Server id 14.0.694.0; Wed, 15 Sep 2010 10:26:08 -0400 Received: by labgw2.phaedrus.sandvine.com (Postfix, from userid 10332) id 0D61633C01; Wed, 15 Sep 2010 10:26:09 -0400 (EDT) Date: Wed, 15 Sep 2010 10:26:09 -0400 From: Ed Maste To: pluknet Message-ID: <20100915142609.GA38041@sandvine.com> References: <201009150119.o8F1JCjW098403@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.1i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r212628 - head/sys/dev/aac X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2010 14:36:57 -0000 On Wed, Sep 15, 2010 at 01:27:40PM +0400, pluknet wrote: > Hi. > Afaik, these are somewhere from between b15753 and b16119. > Just for possible clarification. Thanks. I didn't bother to find out where they first appeared, I just copied them from the latest driver. We have some work on the go and I just wanted to get the latest versions of these in the tree. We're working on handling enclosure events (disk insertion / removal). This will mean that e.g. "camcontrol devlist" will update automatically for disks behind the controller. We can hopefully handle AifEnAddJBOD and AifEnDeleteJBOD correctly using the same infrastructure (using the technique from the new mps(4) driver). -Ed From owner-svn-src-head@FreeBSD.ORG Wed Sep 15 14:52:17 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4E63A106564A; Wed, 15 Sep 2010 14:52:17 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id A79708FC0C; Wed, 15 Sep 2010 14:52:15 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id o8FEqA3M044882 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 15 Sep 2010 17:52:10 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id o8FEqAxp096036; Wed, 15 Sep 2010 17:52:10 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id o8FEqAJS096035; Wed, 15 Sep 2010 17:52:10 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 15 Sep 2010 17:52:09 +0300 From: Kostik Belousov To: Attilio Rao Message-ID: <20100915145209.GK2465@deviant.kiev.zoral.com.ua> References: <201009151424.o8FEOLZE039185@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="IxJdV6DzbRx1uFDf" Content-Disposition: inline In-Reply-To: <201009151424.o8FEOLZE039185@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r212661 - head/sys/dev/aac X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2010 14:52:17 -0000 --IxJdV6DzbRx1uFDf Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Sep 15, 2010 at 02:24:21PM +0000, Attilio Rao wrote: > Author: attilio > Date: Wed Sep 15 14:24:21 2010 > New Revision: 212661 > URL: http://svn.freebsd.org/changeset/base/212661 >=20 > Log: > Fix bogus busying mechanism from cdevsw callbacks: > - D_TRACKCLOSE may be used there as d_close() are expected to match up > d_open() calls VFS is not very good at properly calling VOP_CLOSE(). As example, premature vnode reclaim due to devfs unmount would cause VOP_CLOSE() to be called only once despite the number of opens being > 1. --IxJdV6DzbRx1uFDf Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkyQ3ZkACgkQC3+MBN1Mb4jrAQCg5Nhdhc1xpIrM5R4LbeZH8VfC Ok0AmgOw3B1awWRvkCxNTI6I8QZXgToz =Y1Dg -----END PGP SIGNATURE----- --IxJdV6DzbRx1uFDf-- From owner-svn-src-head@FreeBSD.ORG Wed Sep 15 14:57:17 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 079CE106564A; Wed, 15 Sep 2010 14:57:17 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-qy0-f182.google.com (mail-qy0-f182.google.com [209.85.216.182]) by mx1.freebsd.org (Postfix) with ESMTP id 8314A8FC14; Wed, 15 Sep 2010 14:57:16 +0000 (UTC) Received: by qyk4 with SMTP id 4so310326qyk.13 for ; Wed, 15 Sep 2010 07:57:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=fFv90CruJv7ZmWxQa2IjiiOCxhQm29P1ACNVVm47L8c=; b=r3P6wzDuJ7Pv7ItaaId01YgMkbRINDVFTXGWfK5ZssH9yJMx+a0VlVgYWXURdUFvwI kxNqL2IJtUYXBCWjJzb3rPp1D8mQdO2VGWe3/KFqLBqiQoYqfrzOptdrt6AQVzbBVcsP lWSthqwbREh/o81RwCCwaFlAr7iV30mwBlcxw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=LzrOC56vrVzM09VAC7MFJWQM8U6sKI8Bq38UN2GLE0Tv/9pxOjKql7bxAa0rGsY8GO rbna5ew8ngolpJIxUtXJHWT+dirzj5t7ZnsCPKY+Qz8GVxdatRTTszzqCQwW3rPt9FI+ /8//6cqFIg0WmxI5OYMSUhDT1L7YWSQmEbzGo= MIME-Version: 1.0 Received: by 10.224.64.85 with SMTP id d21mr1107082qai.367.1284562635670; Wed, 15 Sep 2010 07:57:15 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.229.49.196 with HTTP; Wed, 15 Sep 2010 07:57:15 -0700 (PDT) In-Reply-To: <20100915145209.GK2465@deviant.kiev.zoral.com.ua> References: <201009151424.o8FEOLZE039185@svn.freebsd.org> <20100915145209.GK2465@deviant.kiev.zoral.com.ua> Date: Wed, 15 Sep 2010 16:57:15 +0200 X-Google-Sender-Auth: uK85kii4m2R244vZEk_iM_RjU6g Message-ID: From: Attilio Rao To: Kostik Belousov Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r212661 - head/sys/dev/aac X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2010 14:57:17 -0000 2010/9/15 Kostik Belousov : > On Wed, Sep 15, 2010 at 02:24:21PM +0000, Attilio Rao wrote: >> Author: attilio >> Date: Wed Sep 15 14:24:21 2010 >> New Revision: 212661 >> URL: http://svn.freebsd.org/changeset/base/212661 >> >> Log: >> =C2=A0 Fix bogus busying mechanism from cdevsw callbacks: >> =C2=A0 - D_TRACKCLOSE may be used there as d_close() are expected to mat= ch up >> =C2=A0 =C2=A0 d_open() calls > VFS is not very good at properly calling VOP_CLOSE(). As example, prematu= re > vnode reclaim due to devfs unmount would cause VOP_CLOSE() to be called > only once despite the number of opens being =C2=A0> 1. Yes. That makes implementing a similar semantic in drivers very difficult and not very well fixable, in particular within the d_* callbacks. I'm seriously wondering if we might just make a shortcut just for supporting such a feature (busying the device on real devfs entry activity) as several of them may be needing and may be probabilly needing to be 100%. Luckilly, it seems that such paths are not experienced very frequently. Attilio --=20 Peace can only be achieved by understanding - A. Einstein From owner-svn-src-head@FreeBSD.ORG Wed Sep 15 15:04:18 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 52D5A1065674; Wed, 15 Sep 2010 15:04:18 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 93CE48FC08; Wed, 15 Sep 2010 15:04:17 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id o8FF4DMW046293 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 15 Sep 2010 18:04:13 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id o8FF4CDo012902; Wed, 15 Sep 2010 18:04:12 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id o8FF4CXY012901; Wed, 15 Sep 2010 18:04:12 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 15 Sep 2010 18:04:12 +0300 From: Kostik Belousov To: Attilio Rao Message-ID: <20100915150412.GM2465@deviant.kiev.zoral.com.ua> References: <201009151424.o8FEOLZE039185@svn.freebsd.org> <20100915145209.GK2465@deviant.kiev.zoral.com.ua> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="tI9tJD/InAKWF1Ci" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_20, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r212661 - head/sys/dev/aac X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2010 15:04:18 -0000 --tI9tJD/InAKWF1Ci Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Sep 15, 2010 at 04:57:15PM +0200, Attilio Rao wrote: > 2010/9/15 Kostik Belousov : > > On Wed, Sep 15, 2010 at 02:24:21PM +0000, Attilio Rao wrote: > >> Author: attilio > >> Date: Wed Sep 15 14:24:21 2010 > >> New Revision: 212661 > >> URL: http://svn.freebsd.org/changeset/base/212661 > >> > >> Log: > >> =9A Fix bogus busying mechanism from cdevsw callbacks: > >> =9A - D_TRACKCLOSE may be used there as d_close() are expected to matc= h up > >> =9A =9A d_open() calls > > VFS is not very good at properly calling VOP_CLOSE(). As example, prema= ture > > vnode reclaim due to devfs unmount would cause VOP_CLOSE() to be called > > only once despite the number of opens being =9A> 1. >=20 > Yes. > That makes implementing a similar semantic in drivers very difficult > and not very well fixable, in particular within the d_* callbacks. > I'm seriously wondering if we might just make a shortcut just for > supporting such a feature (busying the device on real devfs entry > activity) as several of them may be needing and may be probabilly > needing to be 100%. > Luckilly, it seems that such paths are not experienced very frequently. I am not sure what do you mean by "busying the device on real devfs entry activity". Is the operation made by dev_refthread() and friends enough ? Device cannot be destroyed by destroy_dev() until all threads leave the cdevsw methods. --tI9tJD/InAKWF1Ci Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkyQ4GwACgkQC3+MBN1Mb4hezwCgkXk6Fq5UUL8fgIO6Y8a7Lv9a m4oAoOSJAfcrcTKBl70Xjuzz1TYYVORC =a12E -----END PGP SIGNATURE----- --tI9tJD/InAKWF1Ci-- From owner-svn-src-head@FreeBSD.ORG Wed Sep 15 15:11:20 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CAD531065673; Wed, 15 Sep 2010 15:11:20 +0000 (UTC) (envelope-from emaste@freebsd.org) Received: from mail1.sandvine.com (Mail1.sandvine.com [64.7.137.134]) by mx1.freebsd.org (Postfix) with ESMTP id 871988FC0C; Wed, 15 Sep 2010 15:11:20 +0000 (UTC) Received: from labgw2.phaedrus.sandvine.com (192.168.222.22) by WTL-EXCH-1.sandvine.com (192.168.196.31) with Microsoft SMTP Server id 14.0.694.0; Wed, 15 Sep 2010 11:11:19 -0400 Received: by labgw2.phaedrus.sandvine.com (Postfix, from userid 10332) id 9F9D733C00; Wed, 15 Sep 2010 11:11:19 -0400 (EDT) Date: Wed, 15 Sep 2010 11:11:19 -0400 From: Ed Maste To: Attilio Rao Message-ID: <20100915151119.GB1522@sandvine.com> References: <201009151424.o8FEOLZE039185@svn.freebsd.org> <20100915145209.GK2465@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.1i Cc: Kostik Belousov , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r212661 - head/sys/dev/aac X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2010 15:11:20 -0000 On Wed, Sep 15, 2010 at 04:57:15PM +0200, Attilio Rao wrote: > 2010/9/15 Kostik Belousov : > > On Wed, Sep 15, 2010 at 02:24:21PM +0000, Attilio Rao wrote: > >> Author: attilio > >> Date: Wed Sep 15 14:24:21 2010 > >> New Revision: 212661 > >> URL: http://svn.freebsd.org/changeset/base/212661 > >> > >> Log: > >> ?? Fix bogus busying mechanism from cdevsw callbacks: > >> ?? - D_TRACKCLOSE may be used there as d_close() are expected to match up > >> ?? ?? d_open() calls > > VFS is not very good at properly calling VOP_CLOSE(). As example, premature > > vnode reclaim due to devfs unmount would cause VOP_CLOSE() to be called > > only once despite the number of opens being ??> 1. > > Yes. > That makes implementing a similar semantic in drivers very difficult > and not very well fixable, in particular within the d_* callbacks. > I'm seriously wondering if we might just make a shortcut just for > supporting such a feature (busying the device on real devfs entry > activity) as several of them may be needing and may be probabilly > needing to be 100%. > Luckilly, it seems that such paths are not experienced very frequently. Yeah, the old code in aac(4) meant that the module couldn't be unloaded after running the arcconf management tool. This change at least works for the common cases. The mfi(4) driver has a similar local refcount / prevent unload test, and I imagine many other drivers want to implement the same functionality. -Ed From owner-svn-src-head@FreeBSD.ORG Wed Sep 15 15:18:41 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A03B81065693; Wed, 15 Sep 2010 15:18:41 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 90AD28FC28; Wed, 15 Sep 2010 15:18:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8FFIfMl040457; Wed, 15 Sep 2010 15:18:41 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8FFIfAR040455; Wed, 15 Sep 2010 15:18:41 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201009151518.o8FFIfAR040455@svn.freebsd.org> From: Marius Strobl Date: Wed, 15 Sep 2010 15:18:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212663 - head/sys/sparc64/sparc64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2010 15:18:41 -0000 Author: marius Date: Wed Sep 15 15:18:41 2010 New Revision: 212663 URL: http://svn.freebsd.org/changeset/base/212663 Log: - Update the comment in swi_vm() regarding busdma bounce buffers; it's unlikely that support for these ever will be implemented on sparc64 as the IOMMUs are able to translate to up to the maximum physical address supported by the respective machine, bypassing the IOMMU is affected by hardware errata and being able to support DMA engines which cannot do at least 32-bit DMA does not justify the costs. - The page zeroing in uma_small_alloc() may use the VIS-based block zero function so take advantage of it. Modified: head/sys/sparc64/sparc64/vm_machdep.c Modified: head/sys/sparc64/sparc64/vm_machdep.c ============================================================================== --- head/sys/sparc64/sparc64/vm_machdep.c Wed Sep 15 15:17:54 2010 (r212662) +++ head/sys/sparc64/sparc64/vm_machdep.c Wed Sep 15 15:18:41 2010 (r212663) @@ -492,10 +492,7 @@ void swi_vm(void *v) { - /* - * Nothing to do here yet - busdma bounce buffers are not yet - * implemented. - */ + /* Nothing to do here - busdma bounce buffers are not implemented. */ } void * @@ -540,7 +537,7 @@ uma_small_alloc(uma_zone_t zone, int byt } va = (void *)TLB_PHYS_TO_DIRECT(pa); if ((wait & M_ZERO) && (m->flags & PG_ZERO) == 0) - bzero(va, PAGE_SIZE); + cpu_block_zero(va, PAGE_SIZE); return (va); } From owner-svn-src-head@FreeBSD.ORG Wed Sep 15 15:38:47 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8A7531065673; Wed, 15 Sep 2010 15:38:47 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7B2A18FC1E; Wed, 15 Sep 2010 15:38:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8FFcllO041038; Wed, 15 Sep 2010 15:38:47 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8FFclvW041036; Wed, 15 Sep 2010 15:38:47 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201009151538.o8FFclvW041036@svn.freebsd.org> From: Warner Losh Date: Wed, 15 Sep 2010 15:38:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212665 - head/libexec/tftpd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2010 15:38:47 -0000 Author: imp Date: Wed Sep 15 15:38:47 2010 New Revision: 212665 URL: http://svn.freebsd.org/changeset/base/212665 Log: Move the pfrom initialization from before the setjmp to after the setjmp to avoid warnings on the powerpc build... Modified: head/libexec/tftpd/tftp-io.c Modified: head/libexec/tftpd/tftp-io.c ============================================================================== --- head/libexec/tftpd/tftp-io.c Wed Sep 15 15:33:51 2010 (r212664) +++ head/libexec/tftpd/tftp-io.c Wed Sep 15 15:38:47 2010 (r212665) @@ -398,8 +398,6 @@ receive_packet(int peer, char *data, int int n; static int waiting; - pfrom = (from == NULL) ? &from_local : from; - if (debug&DEBUG_PACKETS) tftp_log(LOG_DEBUG, "Waiting %d seconds for packet", timeoutpacket); @@ -423,6 +421,7 @@ receive_packet(int peer, char *data, int } waiting++; + pfrom = (from == NULL) ? &from_local : from; fromlen = sizeof(*pfrom); n = recvfrom(peer, data, size, 0, (struct sockaddr *)pfrom, &fromlen); From owner-svn-src-head@FreeBSD.ORG Wed Sep 15 16:05:51 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A7B4C10656A6; Wed, 15 Sep 2010 16:05:51 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 984328FC0C; Wed, 15 Sep 2010 16:05:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8FG5p0q041849; Wed, 15 Sep 2010 16:05:51 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8FG5pjc041847; Wed, 15 Sep 2010 16:05:51 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201009151605.o8FG5pjc041847@svn.freebsd.org> From: "Kenneth D. Merry" Date: Wed, 15 Sep 2010 16:05:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212669 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2010 16:05:51 -0000 Author: ken Date: Wed Sep 15 16:05:51 2010 New Revision: 212669 URL: http://svn.freebsd.org/changeset/base/212669 Log: MFp4 (//depot/projects/mps/...) Fix a typo. Submitted by: pluknet at gmail dot com Modified: head/share/man/man4/mps.4 Modified: head/share/man/man4/mps.4 ============================================================================== --- head/share/man/man4/mps.4 Wed Sep 15 16:05:40 2010 (r212668) +++ head/share/man/man4/mps.4 Wed Sep 15 16:05:51 2010 (r212669) @@ -51,7 +51,7 @@ place the following lines in your kernel Or, to load the driver as a module at boot, place the following line in .Xr loader.conf 5 : .Bd -literal -offset indent -mpt_load="YES" +mps_load="YES" .Ed .Sh DESCRIPTION The From owner-svn-src-head@FreeBSD.ORG Wed Sep 15 16:14:47 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 16BDC1065775; Wed, 15 Sep 2010 16:14:47 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id DA52A8FC0C; Wed, 15 Sep 2010 16:14:46 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 6297346C05; Wed, 15 Sep 2010 12:14:46 -0400 (EDT) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 915CE8A04F; Wed, 15 Sep 2010 12:14:45 -0400 (EDT) From: John Baldwin To: Andriy Gapon Date: Wed, 15 Sep 2010 11:57:24 -0400 User-Agent: KMail/1.13.5 (FreeBSD/7.3-CBSD-20100819; KDE/4.4.5; amd64; ; ) References: <201009151002.o8FA2kvO029237@svn.freebsd.org> In-Reply-To: <201009151002.o8FA2kvO029237@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201009151157.24735.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Wed, 15 Sep 2010 12:14:45 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=4.2 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r212647 - head/sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2010 16:14:47 -0000 On Wednesday, September 15, 2010 6:02:46 am Andriy Gapon wrote: > Author: avg > Date: Wed Sep 15 10:02:46 2010 > New Revision: 212647 > URL: http://svn.freebsd.org/changeset/base/212647 > > Log: > sys/pcpu.h: remove a workaround for a fixed ld bug > > The workaround was incorrectly documented as having something to do with > set_pcpu section's progbits, but in fact it was for incorrect placement > of __start_set_pcpu because of the bug in ld. > The bug was fixed in r210245, see commit message for details. > > A side-effect of the workaround was that a zero-size set_pcpu section was > produced for modules, source code of which included pcpu.h but didn't > actually define any dynamic per-cpu variables. > This commit should remove the side-effect. > > The same workaround is present sys/net/vnet.h, has an analogous side-effect > and can be removed as well. > > An UPDATING entry that warns about a need for recent ld is following. > > MFC after: 1 month > > Modified: > head/sys/sys/pcpu.h > > Modified: head/sys/sys/pcpu.h > ============================================================================== > --- head/sys/sys/pcpu.h Wed Sep 15 09:48:18 2010 (r212646) > +++ head/sys/sys/pcpu.h Wed Sep 15 10:02:46 2010 (r212647) > @@ -44,24 +44,10 @@ > > /* > * Define a set for pcpu data. > - * > - * We don't use SET_DECLARE because it defines the set as 'a' when we > - * want 'aw'. gcc considers uninitialized data in a separate section > - * writable, and there is no generic zero initializer that works for > - * structs and scalars. > */ > extern uintptr_t *__start_set_pcpu; > extern uintptr_t *__stop_set_pcpu; Given that you removed this comment, can you now use SET_DECLARE() here? -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Wed Sep 15 16:14:48 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BFB481065741; Wed, 15 Sep 2010 16:14:48 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 8D36A8FC15; Wed, 15 Sep 2010 16:14:48 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 3016446C18; Wed, 15 Sep 2010 12:14:48 -0400 (EDT) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 00ABA8A051; Wed, 15 Sep 2010 12:14:46 -0400 (EDT) From: John Baldwin To: Andre Oppermann Date: Wed, 15 Sep 2010 12:12:52 -0400 User-Agent: KMail/1.13.5 (FreeBSD/7.3-CBSD-20100819; KDE/4.4.5; amd64; ; ) References: <201009151039.o8FAdU4H030416@svn.freebsd.org> <4C90B326.4000208@freebsd.org> <4C90D27D.4070306@freebsd.org> In-Reply-To: <4C90D27D.4070306@freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201009151212.52337.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Wed, 15 Sep 2010 12:14:47 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=4.2 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, Lawrence Stewart , svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r212653 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2010 16:14:48 -0000 On Wednesday, September 15, 2010 10:04:45 am Andre Oppermann wrote: > Below is the wording proposed by Lawrence: > /* > * The default Maximum Segment Size (MSS) to use when we do not have specific > * knowledge (e.g. via path MTU discovery) that the destination host is prepared > * to accept larger datagrams. The smallest allowable IP datagram MTU and > * optionless IP/TCP header lengths are used for the calculation as per RFC879. > * For IPv4 (RFC791): 576 - 20 - 20 = 536. > * For IPv6 (RFC2460): 1280 - 40 - 20 = 1220. > */ > #define TCP_MSS 536 > #define TCP6_MSS 1220 I think the existing text is fine for this comment, with one nit: * For IPv4 the MSS is 576 - sizeof(struct tcpiphdr) I would find it clearer if it was 'sizeof(struct ip) - sizeof(struct tcphdr)' instead. > * Limit the lowest MSS we accept for path MTU discovery and the TCP SYN MSS > * option. Allowing low values of MSS can consume significant resources and be > * used to mount a resource exhaustion attack. Connections requesting lower MSS > * values will be rounded up to this value and the IP_DF flag will be cleared to > * allow fragmentation along the path. > * > * See tcp_subr.c tcp_minmss SYSCTL declaration for more comments. Setting this > * SYSCTL to "0" disables the minmss check. > * > * The default value is fine for TCP over IPv4 across the Internet's smallest > * known link MTU (256 bytes for AX.25 packet radio). However, a connection is > * very unlikely to come across such low MTU interfaces (anno domini 2003). > */ > #define TCP_MINMSS 216 I actually prefer the above text for this block. The 'amounts of resources' phrase is certainly redundant and just 'resources' is clearer. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Wed Sep 15 16:14:54 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EB44E10657BE; Wed, 15 Sep 2010 16:14:51 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 42B588FC18; Wed, 15 Sep 2010 16:14:51 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id DCA7146C05; Wed, 15 Sep 2010 12:14:50 -0400 (EDT) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 913EF8A04E; Wed, 15 Sep 2010 12:14:48 -0400 (EDT) From: John Baldwin To: Kostik Belousov Date: Wed, 15 Sep 2010 12:14:33 -0400 User-Agent: KMail/1.13.5 (FreeBSD/7.3-CBSD-20100819; KDE/4.4.5; amd64; ; ) References: <201009151424.o8FEOLZE039185@svn.freebsd.org> <20100915145209.GK2465@deviant.kiev.zoral.com.ua> In-Reply-To: <20100915145209.GK2465@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201009151214.33375.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Wed, 15 Sep 2010 12:14:48 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=4.2 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: Attilio Rao , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r212661 - head/sys/dev/aac X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2010 16:14:54 -0000 On Wednesday, September 15, 2010 10:52:09 am Kostik Belousov wrote: > On Wed, Sep 15, 2010 at 02:24:21PM +0000, Attilio Rao wrote: > > Author: attilio > > Date: Wed Sep 15 14:24:21 2010 > > New Revision: 212661 > > URL: http://svn.freebsd.org/changeset/base/212661 > > > > Log: > > Fix bogus busying mechanism from cdevsw callbacks: > > - D_TRACKCLOSE may be used there as d_close() are expected to match up > > d_open() calls > VFS is not very good at properly calling VOP_CLOSE(). As example, premature > vnode reclaim due to devfs unmount would cause VOP_CLOSE() to be called > only once despite the number of opens being > 1. cdevpriv is probably a much better route for handling this than D_TRACKCLOSE. The destructor routine passed to devfs_set_cdevpriv() would just do the work of decrementing the reference count instead of actually freeing anything in that case. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Wed Sep 15 16:25:09 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0C3681065672; Wed, 15 Sep 2010 16:25:09 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id B5E228FC17; Wed, 15 Sep 2010 16:25:07 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id TAA12069; Wed, 15 Sep 2010 19:25:05 +0300 (EEST) (envelope-from avg@freebsd.org) Message-ID: <4C90F361.4090106@freebsd.org> Date: Wed, 15 Sep 2010 19:25:05 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.9) Gecko/20100909 Lightning/1.0b2 Thunderbird/3.1.3 MIME-Version: 1.0 To: John Baldwin References: <201009151002.o8FA2kvO029237@svn.freebsd.org> <201009151157.24735.jhb@freebsd.org> In-Reply-To: <201009151157.24735.jhb@freebsd.org> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r212647 - head/sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2010 16:25:09 -0000 on 15/09/2010 18:57 John Baldwin said the following: > On Wednesday, September 15, 2010 6:02:46 am Andriy Gapon wrote: >> Author: avg >> Date: Wed Sep 15 10:02:46 2010 >> New Revision: 212647 >> URL: http://svn.freebsd.org/changeset/base/212647 >> >> Log: >> sys/pcpu.h: remove a workaround for a fixed ld bug >> >> The workaround was incorrectly documented as having something to do with >> set_pcpu section's progbits, but in fact it was for incorrect placement >> of __start_set_pcpu because of the bug in ld. >> The bug was fixed in r210245, see commit message for details. >> >> A side-effect of the workaround was that a zero-size set_pcpu section was >> produced for modules, source code of which included pcpu.h but didn't >> actually define any dynamic per-cpu variables. >> This commit should remove the side-effect. >> >> The same workaround is present sys/net/vnet.h, has an analogous side-effect >> and can be removed as well. >> >> An UPDATING entry that warns about a need for recent ld is following. >> >> MFC after: 1 month >> >> Modified: >> head/sys/sys/pcpu.h >> >> Modified: head/sys/sys/pcpu.h >> ============================================================================== >> --- head/sys/sys/pcpu.h Wed Sep 15 09:48:18 2010 (r212646) >> +++ head/sys/sys/pcpu.h Wed Sep 15 10:02:46 2010 (r212647) >> @@ -44,24 +44,10 @@ >> >> /* >> * Define a set for pcpu data. >> - * >> - * We don't use SET_DECLARE because it defines the set as 'a' when we >> - * want 'aw'. gcc considers uninitialized data in a separate section >> - * writable, and there is no generic zero initializer that works for >> - * structs and scalars. >> */ >> extern uintptr_t *__start_set_pcpu; >> extern uintptr_t *__stop_set_pcpu; > > Given that you removed this comment, can you now use SET_DECLARE() here? No, why, for what do you want it to use? -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Wed Sep 15 16:30:52 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 969BB106567A; Wed, 15 Sep 2010 16:30:52 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 4C10B8FC14; Wed, 15 Sep 2010 16:30:50 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id TAA12242; Wed, 15 Sep 2010 19:30:49 +0300 (EEST) (envelope-from avg@freebsd.org) Message-ID: <4C90F4B9.3060400@freebsd.org> Date: Wed, 15 Sep 2010 19:30:49 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.9) Gecko/20100909 Lightning/1.0b2 Thunderbird/3.1.3 MIME-Version: 1.0 To: John Baldwin References: <201009151002.o8FA2kvO029237@svn.freebsd.org> <201009151157.24735.jhb@freebsd.org> <4C90F361.4090106@freebsd.org> In-Reply-To: <4C90F361.4090106@freebsd.org> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r212647 - head/sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2010 16:30:52 -0000 on 15/09/2010 19:25 Andriy Gapon said the following: > on 15/09/2010 18:57 John Baldwin said the following: >> On Wednesday, September 15, 2010 6:02:46 am Andriy Gapon wrote: >>> extern uintptr_t *__start_set_pcpu; >>> extern uintptr_t *__stop_set_pcpu; >> >> Given that you removed this comment, can you now use SET_DECLARE() here? > > No, why, for what do you want it to use? > Oh, oops, sorry; yes, of course. SET_DECLARE would expand to exactly those two lines. I am not sure why comment even said that it's impossible to use SET_DECLARE(), perhaps previously it used to expand to something bigger? -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Wed Sep 15 16:42:44 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0ACE01065743; Wed, 15 Sep 2010 16:42:44 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 9E78A8FC25; Wed, 15 Sep 2010 16:42:42 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id TAA12506; Wed, 15 Sep 2010 19:42:40 +0300 (EEST) (envelope-from avg@freebsd.org) Message-ID: <4C90F780.8080402@freebsd.org> Date: Wed, 15 Sep 2010 19:42:40 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.9) Gecko/20100909 Lightning/1.0b2 Thunderbird/3.1.3 MIME-Version: 1.0 To: John Baldwin References: <201009151002.o8FA2kvO029237@svn.freebsd.org> <201009151157.24735.jhb@freebsd.org> <4C90F361.4090106@freebsd.org> <4C90F4B9.3060400@freebsd.org> In-Reply-To: <4C90F4B9.3060400@freebsd.org> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r212647 - head/sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2010 16:42:44 -0000 on 15/09/2010 19:30 Andriy Gapon said the following: > SET_DECLARE would expand to exactly those two lines. > I am not sure why comment even said that it's impossible to use SET_DECLARE(), > perhaps previously it used to expand to something bigger? Having said that, I am not sure if it makes logical sense to use SET_DECLARE() in pcpu.h. Family of SET_* macros seems to be geared towards sets that contain arrays of identical items (e.g. see SET_ITEM, SET_COUNT). set_pcpu reserves space for items of various types and sizes. So I am not sure if using any SET_* macros would not be confusing in the future. What do you think? -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Wed Sep 15 17:11:16 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 20E5A106564A; Wed, 15 Sep 2010 17:11:16 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 110778FC18; Wed, 15 Sep 2010 17:11:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8FHBFAK043819; Wed, 15 Sep 2010 17:11:15 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8FHBFQu043816; Wed, 15 Sep 2010 17:11:15 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201009151711.o8FHBFQu043816@svn.freebsd.org> From: Marius Strobl Date: Wed, 15 Sep 2010 17:11:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212676 - in head/sys: sparc64/sparc64 sun4v/sun4v X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2010 17:11:16 -0000 Author: marius Date: Wed Sep 15 17:11:15 2010 New Revision: 212676 URL: http://svn.freebsd.org/changeset/base/212676 Log: Sync with other platforms: - make dflt_lock() always panic, - add kludge to use contigmalloc() when the alignment is larger than the size and print a diagnostic when we didn't satisfy the alignment. Modified: head/sys/sparc64/sparc64/bus_machdep.c head/sys/sun4v/sun4v/bus_machdep.c Modified: head/sys/sparc64/sparc64/bus_machdep.c ============================================================================== --- head/sys/sparc64/sparc64/bus_machdep.c Wed Sep 15 16:42:57 2010 (r212675) +++ head/sys/sparc64/sparc64/bus_machdep.c Wed Sep 15 17:11:15 2010 (r212676) @@ -182,11 +182,8 @@ busdma_lock_mutex(void *arg, bus_dma_loc static void dflt_lock(void *arg, bus_dma_lock_op_t op) { -#ifdef INVARIANTS + panic("driver error: busdma dflt_lock called"); -#else - printf("DRIVER_ERROR: busdma dflt_lock called\n"); -#endif } /* @@ -631,9 +628,18 @@ nexus_dmamem_alloc(bus_dma_tag_t dmat, v if (flags & BUS_DMA_ZERO) mflags |= M_ZERO; - if ((dmat->dt_maxsize <= PAGE_SIZE)) { + /* + * XXX: + * (dmat->dt_alignment < dmat->dt_maxsize) is just a quick hack; the + * exact alignment guarantees of malloc need to be nailed down, and + * the code below should be rewritten to take that into account. + * + * In the meantime, we'll warn the user if malloc gets it wrong. + */ + if (dmat->dt_maxsize <= PAGE_SIZE && + dmat->dt_alignment < dmat->dt_maxsize) *vaddr = malloc(dmat->dt_maxsize, M_DEVBUF, mflags); - } else { + else { /* * XXX use contigmalloc until it is merged into this * facility and handles multi-seg allocations. Nobody @@ -646,6 +652,8 @@ nexus_dmamem_alloc(bus_dma_tag_t dmat, v } if (*vaddr == NULL) return (ENOMEM); + if ((uintptr_t)*vaddr % dmat->dt_alignment) + printf("%s: failed to align memory properly.\n", __func__); return (0); } @@ -657,11 +665,11 @@ static void nexus_dmamem_free(bus_dma_tag_t dmat, void *vaddr, bus_dmamap_t map) { - if ((dmat->dt_maxsize <= PAGE_SIZE)) + if (dmat->dt_maxsize <= PAGE_SIZE && + dmat->dt_alignment < dmat->dt_maxsize) free(vaddr, M_DEVBUF); - else { + else contigfree(vaddr, dmat->dt_maxsize, M_DEVBUF); - } } struct bus_dma_methods nexus_dma_methods = { Modified: head/sys/sun4v/sun4v/bus_machdep.c ============================================================================== --- head/sys/sun4v/sun4v/bus_machdep.c Wed Sep 15 16:42:57 2010 (r212675) +++ head/sys/sun4v/sun4v/bus_machdep.c Wed Sep 15 17:11:15 2010 (r212676) @@ -181,11 +181,8 @@ busdma_lock_mutex(void *arg, bus_dma_loc static void dflt_lock(void *arg, bus_dma_lock_op_t op) { -#ifdef INVARIANTS + panic("driver error: busdma dflt_lock called"); -#else - printf("DRIVER_ERROR: busdma dflt_lock called\n"); -#endif } /* @@ -647,9 +644,18 @@ nexus_dmamem_alloc(bus_dma_tag_t dmat, v if (flags & BUS_DMA_ZERO) mflags |= M_ZERO; - if ((dmat->dt_maxsize <= PAGE_SIZE)) { + /* + * XXX: + * (dmat->dt_alignment < dmat->dt_maxsize) is just a quick hack; the + * exact alignment guarantees of malloc need to be nailed down, and + * the code below should be rewritten to take that into account. + * + * In the meantime, we'll warn the user if malloc gets it wrong. + */ + if (dmat->dt_maxsize <= PAGE_SIZE && + dmat->dt_alignment < dmat->dt_maxsize) *vaddr = malloc(dmat->dt_maxsize, M_DEVBUF, mflags); - } else { + else { /* * XXX use contigmalloc until it is merged into this * facility and handles multi-seg allocations. Nobody @@ -662,6 +668,8 @@ nexus_dmamem_alloc(bus_dma_tag_t dmat, v } if (*vaddr == NULL) return (ENOMEM); + if ((uintptr_t)*vaddr % dmat->dt_alignment) + printf("%s: failed to align memory properly.\n", __func__); return (0); } @@ -673,11 +681,11 @@ static void nexus_dmamem_free(bus_dma_tag_t dmat, void *vaddr, bus_dmamap_t map) { - if ((dmat->dt_maxsize <= PAGE_SIZE)) + if (dmat->dt_maxsize <= PAGE_SIZE && + dmat->dt_alignment < dmat->dt_maxsize) free(vaddr, M_DEVBUF); - else { + else contigfree(vaddr, dmat->dt_maxsize, M_DEVBUF); - } } struct bus_dma_methods nexus_dma_methods = { From owner-svn-src-head@FreeBSD.ORG Wed Sep 15 18:47:16 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C3FD01065673 for ; Wed, 15 Sep 2010 18:47:16 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.freebsd.org (Postfix) with ESMTP id 6CD8B8FC26 for ; Wed, 15 Sep 2010 18:47:16 +0000 (UTC) Received: (qmail 14986 invoked by uid 399); 15 Sep 2010 18:47:15 -0000 Received: from localhost (HELO ?192.168.0.142?) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 15 Sep 2010 18:47:15 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4C9114B2.9090001@FreeBSD.org> Date: Wed, 15 Sep 2010 11:47:14 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.9) Gecko/20100825 Thunderbird/3.1.3 MIME-Version: 1.0 To: "M. Warner Losh" References: <201009131530.o8DFU9f5010734@svn.freebsd.org> <4C9020C5.90108@FreeBSD.org> <20100914.202936.19192035460743630.imp@bsdimp.com> In-Reply-To: <20100914.202936.19192035460743630.imp@bsdimp.com> X-Enigmail-Version: 1.1.1 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r212558 - head/usr.bin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2010 18:47:16 -0000 On 9/14/2010 7:29 PM, M. Warner Losh wrote: > In message:<4C9020C5.90108@FreeBSD.org> > Doug Barton writes: > : On 9/13/2010 8:30 AM, Warner Losh wrote: > :> Author: imp > :> Date: Mon Sep 13 15:30:09 2010 > :> New Revision: 212558 > :> URL: http://svn.freebsd.org/changeset/base/212558 > :> > :> Log: > :> Move to using Makefile.arch to include the proper target-specific > :> programs. > :> > :> Modified: > :> head/usr.bin/Makefile > :> > :> Modified: head/usr.bin/Makefile > :> ============================================================================== > :> --- head/usr.bin/Makefile Mon Sep 13 15:19:49 2010 (r212557) > :> +++ head/usr.bin/Makefile Mon Sep 13 15:30:09 2010 (r212558) > :> @@ -11,48 +11,29 @@ > :> > :> SUBDIR= alias \ > :> apply \ > :> - ${_ar} \ > : > :> .if ${MK_TOOLCHAIN} != "no" > :> -_ar= ar > : > :> +SUBDIR+= ar > : > : > : I'm curious about why you're changing the method we use to switch > : optional elements. The change seems gratuitous to me, but I'm willing > : to be persuaded. > > I posted these exact patches many times to arch@ and while people > commented on other aspects of the change, no body ever commented on > this aspect of the change (apart from comments about how to do it > better). That's why I specifically said that there was no objection > from arch@ for these changes. I'm not disputing that. Like many other people my time for FreeBSD is limited, much more so lately, and I was not able to review your patches in depth at the time you posted them. My apologies for the late questions. > Doing things this way makes it easier for different architectures to > subset or augment the directories to build (and it makes it a lot > easier to know what's built on a given architecture). They can be > concentrated into individual Makefiles that are easier to select on. > MIPS and ARM are both moving to having multiple names (powerpc moved a > couple of months ago) and the current arrangement doesn't scale well > in the face of these changes. It is far from gratuitous. I understand that what you've written above was your intent in making the change, what I don't clearly understand is why it's better. But you seem to, and AFAICT the change isn't harmful, so I'll take your word for it. FYI, the reason I asked is that there were already a non-trivial number of small differences in the we handle build options in the various release branches, which makes handling support for things like BIND (which has a lot of knobs) "interesting." However it seems like your new build system is going to add a lot of other differences to what will become 9-release anyway, so I suppose once again I'll just struggle along with it. :) Thanks for taking the time to explain your changes in more depth. Doug -- ... and that's just a little bit of history repeating. -- Propellerheads Improve the effectiveness of your Internet presence with a domain name makeover! http://SupersetSolutions.com/ From owner-svn-src-head@FreeBSD.ORG Wed Sep 15 19:08:42 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 026A3106564A; Wed, 15 Sep 2010 19:08:42 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E665B8FC1B; Wed, 15 Sep 2010 19:08:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8FJ8fI6047226; Wed, 15 Sep 2010 19:08:41 GMT (envelope-from andreast@svn.freebsd.org) Received: (from andreast@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8FJ8fqK047224; Wed, 15 Sep 2010 19:08:41 GMT (envelope-from andreast@svn.freebsd.org) Message-Id: <201009151908.o8FJ8fqK047224@svn.freebsd.org> From: Andreas Tobler Date: Wed, 15 Sep 2010 19:08:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212687 - head/sys/powerpc/powermac X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2010 19:08:42 -0000 Author: andreast Date: Wed Sep 15 19:08:41 2010 New Revision: 212687 URL: http://svn.freebsd.org/changeset/base/212687 Log: Increase register access delay to deal with the high-latency I2C chipset found in some models of Powermac G5. Approved by: nwhitehorn (mentor) Modified: head/sys/powerpc/powermac/kiic.c Modified: head/sys/powerpc/powermac/kiic.c ============================================================================== --- head/sys/powerpc/powermac/kiic.c Wed Sep 15 18:51:15 2010 (r212686) +++ head/sys/powerpc/powermac/kiic.c Wed Sep 15 19:08:41 2010 (r212687) @@ -250,7 +250,7 @@ static void kiic_writereg(struct kiic_softc *sc, u_int reg, u_int val) { bus_write_4(sc->sc_reg, sc->sc_regstep * reg, val); - DELAY(10); /* register access delay */ + DELAY(100); /* register access delay */ } static u_int From owner-svn-src-head@FreeBSD.ORG Wed Sep 15 19:09:51 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B9A39106564A; Wed, 15 Sep 2010 19:09:51 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 884498FC12; Wed, 15 Sep 2010 19:09:51 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 152BD46B8D; Wed, 15 Sep 2010 15:09:51 -0400 (EDT) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 3E64E8A03C; Wed, 15 Sep 2010 15:09:50 -0400 (EDT) From: John Baldwin To: Andriy Gapon Date: Wed, 15 Sep 2010 14:37:22 -0400 User-Agent: KMail/1.13.5 (FreeBSD/7.3-CBSD-20100819; KDE/4.4.5; amd64; ; ) References: <201009151002.o8FA2kvO029237@svn.freebsd.org> <4C90F4B9.3060400@freebsd.org> <4C90F780.8080402@freebsd.org> In-Reply-To: <4C90F780.8080402@freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201009151437.22412.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Wed, 15 Sep 2010 15:09:50 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=4.2 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r212647 - head/sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2010 19:09:51 -0000 On Wednesday, September 15, 2010 12:42:40 pm Andriy Gapon wrote: > on 15/09/2010 19:30 Andriy Gapon said the following: > > SET_DECLARE would expand to exactly those two lines. > > I am not sure why comment even said that it's impossible to use SET_DECLARE(), > > perhaps previously it used to expand to something bigger? > > Having said that, I am not sure if it makes logical sense to use SET_DECLARE() in > pcpu.h. Family of SET_* macros seems to be geared towards sets that contain > arrays of identical items (e.g. see SET_ITEM, SET_COUNT). set_pcpu reserves space > for items of various types and sizes. So I am not sure if using any SET_* macros > would not be confusing in the future. > > What do you think? Hmm, you could use SET_START() and SET_LIMIT() at least, but it's not a big deal either way. The comment seemed to imply that it would have used SET_DECLARE() if there had not been technical difficulties. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Wed Sep 15 19:35:31 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 16A7C1065679; Wed, 15 Sep 2010 19:35:31 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id BC41D8FC0C; Wed, 15 Sep 2010 19:35:29 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id WAA15518; Wed, 15 Sep 2010 22:35:28 +0300 (EEST) (envelope-from avg@freebsd.org) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1OvxlP-00015A-VW; Wed, 15 Sep 2010 22:35:27 +0300 Message-ID: <4C911FFD.7090109@freebsd.org> Date: Wed, 15 Sep 2010 22:35:25 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.9) Gecko/20100912 Lightning/1.0b2 Thunderbird/3.1.3 MIME-Version: 1.0 To: John Baldwin References: <201009151002.o8FA2kvO029237@svn.freebsd.org> <4C90F4B9.3060400@freebsd.org> <4C90F780.8080402@freebsd.org> <201009151437.22412.jhb@freebsd.org> In-Reply-To: <201009151437.22412.jhb@freebsd.org> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r212647 - head/sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2010 19:35:31 -0000 on 15/09/2010 21:37 John Baldwin said the following: > Hmm, you could use SET_START() and SET_LIMIT() at least, but it's not a big > deal either way. The comment seemed to imply that it would have used > SET_DECLARE() if there had not been technical difficulties. Well, the comment was nonsense, saying what it said, if we consider to what SET_DECLARE() expands today. -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Wed Sep 15 19:40:09 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 40859106566C; Wed, 15 Sep 2010 19:40:09 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3088D8FC1B; Wed, 15 Sep 2010 19:40:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8FJe9vF048407; Wed, 15 Sep 2010 19:40:09 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8FJe97W048405; Wed, 15 Sep 2010 19:40:09 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201009151940.o8FJe97W048405@svn.freebsd.org> From: Warner Losh Date: Wed, 15 Sep 2010 19:40:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212692 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2010 19:40:09 -0000 Author: imp Date: Wed Sep 15 19:40:08 2010 New Revision: 212692 URL: http://svn.freebsd.org/changeset/base/212692 Log: Don't suggest using bwn for the bcm4306 cards in the list. The bcm4306 cards are ambiguous. BCM4306 rev 2 requires bwi. BCM4306 rev 3 will work with either. Since we can't easily determine which is which, just remove them. Modified: head/share/man/man4/bwn.4 Modified: head/share/man/man4/bwn.4 ============================================================================== --- head/share/man/man4/bwn.4 Wed Sep 15 19:34:18 2010 (r212691) +++ head/share/man/man4/bwn.4 Wed Sep 15 19:40:08 2010 (r212692) @@ -78,18 +78,14 @@ driver supports Broadcom BCM43xx based w .Pp .Bl -column -compact "Apple Airport Extreme" "BCM4306" "Mini PCI" "a/b/g" -offset 6n .It Em "Card Chip Bus Standard" -.It "Apple Airport Extreme BCM4306 PCI b/g" .It "Apple Airport Extreme BCM4318 PCI b/g" .It "ASUS WL-138g BCM4318 PCI b/g" .It "Buffalo WLI-CB-G54S BCM4318 CardBus b/g" -.It "Buffalo WLI-PCI-G54S BCM4306 PCI b/g" -.It "Compaq R4035 onboard BCM4306 PCI b/g" .It "Dell Wireless 1470 BCM4318 Mini PCI b/g" .It "Dell Truemobile 1400 BCM4309 Mini PCI b/g" .It "HP nx6125 BCM4319 PCI b/g" .It "Linksys WPC54G Ver 3 BCM4318 CardBus b/g" .It "Linksys WPC54GS Ver 2 BCM4318 CardBus b/g" -.It "TRENDnet TEW-401PCplus BCM4306 CardBus b/g" .It "US Robotics 5411 BCM4318 CardBus b/g" .El .Pp From owner-svn-src-head@FreeBSD.ORG Wed Sep 15 19:40:42 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D725F10656C1; Wed, 15 Sep 2010 19:40:42 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C74628FC19; Wed, 15 Sep 2010 19:40:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8FJegaA048454; Wed, 15 Sep 2010 19:40:42 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8FJegSn048452; Wed, 15 Sep 2010 19:40:42 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201009151940.o8FJegSn048452@svn.freebsd.org> From: Warner Losh Date: Wed, 15 Sep 2010 19:40:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212693 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2010 19:40:42 -0000 Author: imp Date: Wed Sep 15 19:40:42 2010 New Revision: 212693 URL: http://svn.freebsd.org/changeset/base/212693 Log: Add note abotu bwn and newer chipsets Modified: head/share/man/man4/bwi.4 Modified: head/share/man/man4/bwi.4 ============================================================================== --- head/share/man/man4/bwi.4 Wed Sep 15 19:40:08 2010 (r212692) +++ head/share/man/man4/bwi.4 Wed Sep 15 19:40:42 2010 (r212693) @@ -90,6 +90,20 @@ driver supports Broadcom BCM43xx based w .It "TRENDnet TEW-401PCplus BCM4306 CardBus b/g" .It "US Robotics 5411 BCM4318 CardBus b/g" .El +.Pp +The +.Nm +driver uses the older v3 version of Broadcom's firmware. +While this older firmware does support most BCM43xx parts, the +.Xr bwn 4 +driver works better for the newer chips it supports. +You must use the +.Nm +driver if you are using older Broadcom chipsets (BCM4301, BCM4303 and +BCM4306 rev 2). +The v4 version of the firmware that +.Xr bwn 4 +uses does not support these chips. .Sh EXAMPLES Join an existing BSS network (i.e., connect to an access point): .Pp From owner-svn-src-head@FreeBSD.ORG Wed Sep 15 19:55:27 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0E00A106566C; Wed, 15 Sep 2010 19:55:27 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EFA6F8FC21; Wed, 15 Sep 2010 19:55:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8FJtQK8048793; Wed, 15 Sep 2010 19:55:26 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8FJtQI8048787; Wed, 15 Sep 2010 19:55:26 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201009151955.o8FJtQI8048787@svn.freebsd.org> From: Martin Matuska Date: Wed, 15 Sep 2010 19:55:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212694 - in head/sys/cddl: compat/opensolaris/sys contrib/opensolaris/uts/common/fs/zfs contrib/opensolaris/uts/common/fs/zfs/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2010 19:55:27 -0000 Author: mm Date: Wed Sep 15 19:55:26 2010 New Revision: 212694 URL: http://svn.freebsd.org/changeset/base/212694 Log: Fix kernel panic when moving a file to .zfs/shares Fix possible loss of correct error return code in ZFS mount OpenSolaris revisions and Bug IDs: 11824:53128e5db7cf 6863610 ZFS mount can lose correct error return 12079:13822b941977 6939941 problem with moving files in zfs (142901-12) Approved by: delphij (mentor) Obtained from: OpenSolaris (Bug ID 6863610, 6939941) MFC after: 3 days Modified: head/sys/cddl/compat/opensolaris/sys/vnode.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ctldir.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Modified: head/sys/cddl/compat/opensolaris/sys/vnode.h ============================================================================== --- head/sys/cddl/compat/opensolaris/sys/vnode.h Wed Sep 15 19:40:42 2010 (r212693) +++ head/sys/cddl/compat/opensolaris/sys/vnode.h Wed Sep 15 19:55:26 2010 (r212694) @@ -76,6 +76,7 @@ vn_is_readonly(vnode_t *vp) #define vn_invalid(vp) do { } while (0) #define vn_renamepath(tdvp, svp, tnm, lentnm) do { } while (0) #define vn_free(vp) do { } while (0) +#define vn_matchops(vp, vops) ((vp)->v_op == &(vops)) #define VN_HOLD(v) vref(v) #define VN_RELE(v) vrele(v) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ctldir.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ctldir.h Wed Sep 15 19:40:42 2010 (r212693) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ctldir.h Wed Sep 15 19:55:26 2010 (r212694) @@ -19,8 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2009 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. */ #ifndef _ZFS_CTLDIR_H @@ -48,6 +47,7 @@ void zfsctl_destroy(zfsvfs_t *); vnode_t *zfsctl_root(znode_t *); void zfsctl_init(void); void zfsctl_fini(void); +boolean_t zfsctl_is_node(vnode_t *); int zfsctl_rename_snapshot(const char *from, const char *to); int zfsctl_destroy_snapshot(const char *snapname, int force); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Wed Sep 15 19:40:42 2010 (r212693) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Wed Sep 15 19:55:26 2010 (r212694) @@ -19,8 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2009 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. */ /* @@ -152,6 +151,17 @@ zfsctl_fini(void) { } +boolean_t +zfsctl_is_node(vnode_t *vp) +{ + return (vn_matchops(vp, zfsctl_ops_root) || + vn_matchops(vp, zfsctl_ops_snapdir) || + vn_matchops(vp, zfsctl_ops_snapshot) || + vn_matchops(vp, zfsctl_ops_shares) || + vn_matchops(vp, zfsctl_ops_shares_dir)); + +} + /* * Return the inode number associated with the 'snapshot' or * 'shares' directory. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Wed Sep 15 19:40:42 2010 (r212693) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Wed Sep 15 19:55:26 2010 (r212694) @@ -1163,8 +1163,7 @@ zfs_mount(vfs_t *vfsp) */ error = secpolicy_fs_mount(cr, mvp, vfsp); if (error) { - error = dsl_deleg_access(osname, ZFS_DELEG_PERM_MOUNT, cr); - if (error != 0) + if (dsl_deleg_access(osname, ZFS_DELEG_PERM_MOUNT, cr) != 0) goto out; if (!(vfsp->vfs_flag & MS_REMOUNT)) { @@ -1178,7 +1177,7 @@ zfs_mount(vfs_t *vfsp) vattr.va_mask = AT_UID; vn_lock(mvp, LK_SHARED | LK_RETRY); - if (error = VOP_GETATTR(mvp, &vattr, cr)) { + if (VOP_GETATTR(mvp, &vattr, cr)) { VOP_UNLOCK(mvp, 0); goto out; } @@ -1433,9 +1432,8 @@ zfs_umount(vfs_t *vfsp, int fflag) ret = secpolicy_fs_unmount(cr, vfsp); if (ret) { - ret = dsl_deleg_access((char *)refstr_value(vfsp->vfs_resource), - ZFS_DELEG_PERM_MOUNT, cr); - if (ret) + if (dsl_deleg_access((char *)refstr_value(vfsp->vfs_resource), + ZFS_DELEG_PERM_MOUNT, cr)) return (ret); } /* Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Wed Sep 15 19:40:42 2010 (r212693) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Wed Sep 15 19:55:26 2010 (r212694) @@ -19,8 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2009 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. */ /* Portions Copyright 2007 Jeremy Teo */ @@ -3357,7 +3356,7 @@ zfs_rename(vnode_t *sdvp, char *snm, vno if (VOP_REALVP(tdvp, &realvp, ct) == 0) tdvp = realvp; - if (tdvp->v_vfsp != sdvp->v_vfsp) { + if (tdvp->v_vfsp != sdvp->v_vfsp || zfsctl_is_node(tdvp)) { ZFS_EXIT(zfsvfs); return (EXDEV); } @@ -3875,6 +3874,7 @@ zfs_link(vnode_t *tdvp, vnode_t *svp, ch vnode_t *realvp; int error; int zf = ZNEW; + uint64_t parent; uid_t owner; ASSERT(tdvp->v_type == VDIR); @@ -3886,13 +3886,30 @@ zfs_link(vnode_t *tdvp, vnode_t *svp, ch if (VOP_REALVP(svp, &realvp, ct) == 0) svp = realvp; - if (svp->v_vfsp != tdvp->v_vfsp) { + /* + * POSIX dictates that we return EPERM here. + * Better choices include ENOTSUP or EISDIR. + */ + if (svp->v_type == VDIR) { + ZFS_EXIT(zfsvfs); + return (EPERM); + } + + if (svp->v_vfsp != tdvp->v_vfsp || zfsctl_is_node(svp)) { ZFS_EXIT(zfsvfs); return (EXDEV); } + szp = VTOZ(svp); ZFS_VERIFY_ZP(szp); + /* Prevent links to .zfs/shares files */ + + if (szp->z_phys->zp_parent == zfsvfs->z_shares_dir) { + ZFS_EXIT(zfsvfs); + return (EPERM); + } + if (zfsvfs->z_utf8 && u8_validate(name, strlen(name), NULL, U8_VALIDATE_ENTIRE, &error) < 0) { ZFS_EXIT(zfsvfs); @@ -3901,7 +3918,6 @@ zfs_link(vnode_t *tdvp, vnode_t *svp, ch if (flags & FIGNORECASE) zf |= ZCILOOK; -top: /* * We do not support links between attributes and non-attributes * because of the potential security risk of creating links @@ -3914,14 +3930,6 @@ top: return (EINVAL); } - /* - * POSIX dictates that we return EPERM here. - * Better choices include ENOTSUP or EISDIR. - */ - if (svp->v_type == VDIR) { - ZFS_EXIT(zfsvfs); - return (EPERM); - } owner = zfs_fuid_map_id(zfsvfs, szp->z_phys->zp_uid, cr, ZFS_OWNER); if (owner != crgetuid(cr) && @@ -3935,6 +3943,7 @@ top: return (error); } +top: /* * Attempt to lock directory; fail if entry already exists. */ From owner-svn-src-head@FreeBSD.ORG Wed Sep 15 20:41:21 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 533B110656A3; Wed, 15 Sep 2010 20:41:21 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 42BCB8FC16; Wed, 15 Sep 2010 20:41:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8FKfLdC050137; Wed, 15 Sep 2010 20:41:21 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8FKfLCh050135; Wed, 15 Sep 2010 20:41:21 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201009152041.o8FKfLCh050135@svn.freebsd.org> From: Michael Tuexen Date: Wed, 15 Sep 2010 20:41:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212699 - head/sys/netinet6 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2010 20:41:21 -0000 Author: tuexen Date: Wed Sep 15 20:41:20 2010 New Revision: 212699 URL: http://svn.freebsd.org/changeset/base/212699 Log: Remove unused variables. MFC after: 2 weeks. Modified: head/sys/netinet6/sctp6_usrreq.c Modified: head/sys/netinet6/sctp6_usrreq.c ============================================================================== --- head/sys/netinet6/sctp6_usrreq.c Wed Sep 15 20:40:29 2010 (r212698) +++ head/sys/netinet6/sctp6_usrreq.c Wed Sep 15 20:41:20 2010 (r212699) @@ -73,7 +73,11 @@ sctp6_input(struct mbuf **i_pak, int *of struct sctp_nets *net; int refcount_up = 0; uint32_t vrf_id = 0; + +#ifdef IPSEC struct inpcb *in6p_ip; + +#endif struct sctp_chunkhdr *ch; int length, offset, iphlen; uint8_t ecn_bits; @@ -224,11 +228,11 @@ sctp_skip_csum: } else if (stcb == NULL) { refcount_up = 1; } - in6p_ip = (struct inpcb *)in6p; #ifdef IPSEC /* * Check AH/ESP integrity. */ + in6p_ip = (struct inpcb *)in6p; if (in6p_ip && (ipsec6_in_reject(m, in6p_ip))) { /* XXX */ MODULE_GLOBAL(ipsec6stat).in_polvio++; @@ -813,7 +817,6 @@ sctp6_send(struct socket *so, int flags, struct mbuf *control, struct thread *p) { struct sctp_inpcb *inp; - struct inpcb *in_inp; struct in6pcb *inp6; #ifdef INET @@ -832,7 +835,6 @@ sctp6_send(struct socket *so, int flags, SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, EINVAL); return EINVAL; } - in_inp = (struct inpcb *)inp; inp6 = (struct in6pcb *)inp; /* * For the TCP model we may get a NULL addr, if we are a connected From owner-svn-src-head@FreeBSD.ORG Wed Sep 15 20:53:20 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CB78E106564A; Wed, 15 Sep 2010 20:53:20 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BACBE8FC0A; Wed, 15 Sep 2010 20:53:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8FKrK6U050525; Wed, 15 Sep 2010 20:53:20 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8FKrKs2050523; Wed, 15 Sep 2010 20:53:20 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201009152053.o8FKrKs2050523@svn.freebsd.org> From: Michael Tuexen Date: Wed, 15 Sep 2010 20:53:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212702 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2010 20:53:20 -0000 Author: tuexen Date: Wed Sep 15 20:53:20 2010 New Revision: 212702 URL: http://svn.freebsd.org/changeset/base/212702 Log: * Use !TAILQ_EMPTY() for checking if a tail queue is not empty. * Remove assignment without any effect. MFC after: 2 weeks. Modified: head/sys/netinet/sctp_cc_functions.c Modified: head/sys/netinet/sctp_cc_functions.c ============================================================================== --- head/sys/netinet/sctp_cc_functions.c Wed Sep 15 20:50:51 2010 (r212701) +++ head/sys/netinet/sctp_cc_functions.c Wed Sep 15 20:53:20 2010 (r212702) @@ -171,7 +171,7 @@ sctp_cwnd_update_after_sack(struct sctp_ * So, first of all do we need to have a Early FR * timer running? */ - if (((TAILQ_FIRST(&asoc->sent_queue)) && + if ((!TAILQ_EMPTY(&asoc->sent_queue) && (net->ref_count > 1) && (net->flight_size < net->cwnd)) || (reneged_all)) { @@ -656,7 +656,6 @@ sctp_hs_cwnd_decrease(struct sctp_tcb *s int old_cwnd = net->cwnd; cur_val = net->cwnd >> 10; - indx = net->last_hs_used; if (cur_val < sctp_cwnd_adjust[0].cwnd) { /* normal mode */ net->ssthresh = net->cwnd / 2; @@ -793,7 +792,7 @@ sctp_hs_cwnd_update_after_sack(struct sc * So, first of all do we need to have a Early FR * timer running? */ - if (((TAILQ_FIRST(&asoc->sent_queue)) && + if ((!TAILQ_EMPTY(&asoc->sent_queue) && (net->ref_count > 1) && (net->flight_size < net->cwnd)) || (reneged_all)) { @@ -1279,7 +1278,7 @@ sctp_htcp_cwnd_update_after_sack(struct * So, first of all do we need to have a Early FR * timer running? */ - if (((TAILQ_FIRST(&asoc->sent_queue)) && + if ((!TAILQ_EMPTY(&asoc->sent_queue) && (net->ref_count > 1) && (net->flight_size < net->cwnd)) || (reneged_all)) { From owner-svn-src-head@FreeBSD.ORG Wed Sep 15 20:59:13 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B4BDC1065670; Wed, 15 Sep 2010 20:59:13 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A44318FC21; Wed, 15 Sep 2010 20:59:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8FKxDih050699; Wed, 15 Sep 2010 20:59:13 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8FKxDi2050697; Wed, 15 Sep 2010 20:59:13 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201009152059.o8FKxDi2050697@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 15 Sep 2010 20:59:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212703 - head/sys/geom/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2010 20:59:13 -0000 Author: pjd Date: Wed Sep 15 20:59:13 2010 New Revision: 212703 URL: http://svn.freebsd.org/changeset/base/212703 Log: Make the message that informs about bootcode being written to disk less confusing. Note there is still no information about 'partcode' being written to disk (gpart bootcode -p ). Maybe in the future all the messages printed by gpart(8) on success could be hidden under -v? PR: bin/150239 Reported by: Roddi Submitted by: arundel MFC after: 2 weeks Modified: head/sys/geom/part/g_part.c Modified: head/sys/geom/part/g_part.c ============================================================================== --- head/sys/geom/part/g_part.c Wed Sep 15 20:53:20 2010 (r212702) +++ head/sys/geom/part/g_part.c Wed Sep 15 20:59:13 2010 (r212703) @@ -636,7 +636,7 @@ g_part_ctl_bootcode(struct gctl_req *req /* Provide feedback if so requested. */ if (gpp->gpp_parms & G_PART_PARM_OUTPUT) { sb = sbuf_new_auto(); - sbuf_printf(sb, "%s has bootcode\n", gp->name); + sbuf_printf(sb, "bootcode written to %s\n", gp->name); sbuf_finish(sb); gctl_set_param(req, "output", sbuf_data(sb), sbuf_len(sb) + 1); sbuf_delete(sb); @@ -1032,7 +1032,7 @@ g_part_ctl_move(struct gctl_req *req, st { gctl_error(req, "%d verb 'move'", ENOSYS); return (ENOSYS); -} +} static int g_part_ctl_recover(struct gctl_req *req, struct g_part_parms *gpp) From owner-svn-src-head@FreeBSD.ORG Wed Sep 15 21:08:57 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7E06810656A4; Wed, 15 Sep 2010 21:08:57 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6D9F78FC13; Wed, 15 Sep 2010 21:08:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8FL8vHF050954; Wed, 15 Sep 2010 21:08:57 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8FL8v5W050952; Wed, 15 Sep 2010 21:08:57 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201009152108.o8FL8v5W050952@svn.freebsd.org> From: Michael Tuexen Date: Wed, 15 Sep 2010 21:08:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212704 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2010 21:08:57 -0000 Author: tuexen Date: Wed Sep 15 21:08:57 2010 New Revision: 212704 URL: http://svn.freebsd.org/changeset/base/212704 Log: Remove assignment without effect. MFC after: 2 weeks. Modified: head/sys/netinet/sctp_sysctl.c Modified: head/sys/netinet/sctp_sysctl.c ============================================================================== --- head/sys/netinet/sctp_sysctl.c Wed Sep 15 20:59:13 2010 (r212703) +++ head/sys/netinet/sctp_sysctl.c Wed Sep 15 21:08:57 2010 (r212704) @@ -200,8 +200,6 @@ copy_out_local_addresses(struct sctp_inp ipv6_addr_legal = 0; } - error = 0; - /* neither Mac OS X nor FreeBSD support mulitple routing functions */ if ((vrf = sctp_find_vrf(inp->def_vrf_id)) == NULL) { SCTP_INP_RUNLOCK(inp); From owner-svn-src-head@FreeBSD.ORG Wed Sep 15 21:11:30 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0431B106566C; Wed, 15 Sep 2010 21:11:30 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E7B9E8FC08; Wed, 15 Sep 2010 21:11:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8FLBT4s051061; Wed, 15 Sep 2010 21:11:29 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8FLBTlu051059; Wed, 15 Sep 2010 21:11:29 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201009152111.o8FLBTlu051059@svn.freebsd.org> From: Marius Strobl Date: Wed, 15 Sep 2010 21:11:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212705 - head/sys/sparc64/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2010 21:11:30 -0000 Author: marius Date: Wed Sep 15 21:11:29 2010 New Revision: 212705 URL: http://svn.freebsd.org/changeset/base/212705 Log: Add macros for alternate entry points. Modified: head/sys/sparc64/include/asm.h Modified: head/sys/sparc64/include/asm.h ============================================================================== --- head/sys/sparc64/include/asm.h Wed Sep 15 21:08:57 2010 (r212704) +++ head/sys/sparc64/include/asm.h Wed Sep 15 21:11:29 2010 (r212705) @@ -76,7 +76,7 @@ _ALIGN_TEXT /* - * Define a function entry point. + * Define function entry and alternate entry points. * * The compiler produces #function for the .type pseudo-op, but the '#' * character has special meaning in cpp macros, so we use @function like @@ -86,12 +86,19 @@ * value. Since this is difficult to predict and its expected that * assembler code is already optimized, we leave it out. */ + +#define _ALTENTRY(x) \ + .globl CNAME(x) ; \ + .type CNAME(x),@function ; \ +CNAME(x): + #define _ENTRY(x) \ _START_ENTRY ; \ .globl CNAME(x) ; \ .type CNAME(x),@function ; \ CNAME(x): +#define ALTENTRY(x) _ALTENTRY(x) #define ENTRY(x) _ENTRY(x) #define END(x) .size x, . - x From owner-svn-src-head@FreeBSD.ORG Wed Sep 15 21:15:01 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 426DC1065673; Wed, 15 Sep 2010 21:15:01 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2C7178FC18; Wed, 15 Sep 2010 21:15:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8FLF1eB051158; Wed, 15 Sep 2010 21:15:01 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8FLF1tP051155; Wed, 15 Sep 2010 21:15:01 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201009152115.o8FLF1tP051155@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 15 Sep 2010 21:15:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212706 - head/sys/geom/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2010 21:15:01 -0000 Author: pjd Date: Wed Sep 15 21:15:00 2010 New Revision: 212706 URL: http://svn.freebsd.org/changeset/base/212706 Log: Change message when setting or unsetting attribute less confusing. Before: ada0 has set After: set on ada0 MFC after: 2 weeks Modified: head/sys/geom/part/g_part.c Modified: head/sys/geom/part/g_part.c ============================================================================== --- head/sys/geom/part/g_part.c Wed Sep 15 21:11:29 2010 (r212705) +++ head/sys/geom/part/g_part.c Wed Sep 15 21:15:00 2010 (r212706) @@ -1160,9 +1160,10 @@ g_part_ctl_setunset(struct gctl_req *req /* Provide feedback if so requested. */ if (gpp->gpp_parms & G_PART_PARM_OUTPUT) { sb = sbuf_new_auto(); - G_PART_FULLNAME(table, entry, sb, gp->name); - sbuf_printf(sb, " has %s %sset\n", gpp->gpp_attrib, + sbuf_printf(sb, "%s %sset on ", gpp->gpp_attrib, (set) ? "" : "un"); + G_PART_FULLNAME(table, entry, sb, gp->name); + sbuf_printf(sb, "\n"); sbuf_finish(sb); gctl_set_param(req, "output", sbuf_data(sb), sbuf_len(sb) + 1); sbuf_delete(sb); From owner-svn-src-head@FreeBSD.ORG Wed Sep 15 21:19:54 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E166B1065674; Wed, 15 Sep 2010 21:19:54 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D0EA38FC0C; Wed, 15 Sep 2010 21:19:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8FLJsRZ051283; Wed, 15 Sep 2010 21:19:54 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8FLJskB051281; Wed, 15 Sep 2010 21:19:54 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201009152119.o8FLJskB051281@svn.freebsd.org> From: Michael Tuexen Date: Wed, 15 Sep 2010 21:19:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212707 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2010 21:19:55 -0000 Author: tuexen Date: Wed Sep 15 21:19:54 2010 New Revision: 212707 URL: http://svn.freebsd.org/changeset/base/212707 Log: Remove unused variable/assignment. MFC after: 2 weeks. Modified: head/sys/netinet/sctp_bsd_addr.c Modified: head/sys/netinet/sctp_bsd_addr.c ============================================================================== --- head/sys/netinet/sctp_bsd_addr.c Wed Sep 15 21:15:00 2010 (r212706) +++ head/sys/netinet/sctp_bsd_addr.c Wed Sep 15 21:19:54 2010 (r212707) @@ -298,7 +298,6 @@ sctp_init_vrf_list(int vrfid) void sctp_addr_change(struct ifaddr *ifa, int cmd) { - struct sctp_ifa *ifap = NULL; uint32_t ifa_flags = 0; /* @@ -339,7 +338,7 @@ sctp_addr_change(struct ifaddr *ifa, int return; } if (cmd == RTM_ADD) { - ifap = sctp_add_addr_to_vrf(SCTP_DEFAULT_VRFID, (void *)ifa->ifa_ifp, + (void)sctp_add_addr_to_vrf(SCTP_DEFAULT_VRFID, (void *)ifa->ifa_ifp, ifa->ifa_ifp->if_index, ifa->ifa_ifp->if_type, ifa->ifa_ifp->if_xname, (void *)ifa, ifa->ifa_addr, ifa_flags, 1); From owner-svn-src-head@FreeBSD.ORG Wed Sep 15 21:37:27 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2B206106566C; Wed, 15 Sep 2010 21:37:27 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1A13D8FC14; Wed, 15 Sep 2010 21:37:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8FLbQMO051735; Wed, 15 Sep 2010 21:37:26 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8FLbQqm051733; Wed, 15 Sep 2010 21:37:26 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201009152137.o8FLbQqm051733@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 15 Sep 2010 21:37:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212708 - head/sbin/geom/class/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2010 21:37:27 -0000 Author: pjd Date: Wed Sep 15 21:37:26 2010 New Revision: 212708 URL: http://svn.freebsd.org/changeset/base/212708 Log: GPART_PARAM_INDEX is now G_TYPE_NUMBER. Modified: head/sbin/geom/class/part/geom_part.c Modified: head/sbin/geom/class/part/geom_part.c ============================================================================== --- head/sbin/geom/class/part/geom_part.c Wed Sep 15 21:19:54 2010 (r212707) +++ head/sbin/geom/class/part/geom_part.c Wed Sep 15 21:37:26 2010 (r212708) @@ -285,12 +285,10 @@ gpart_autofill_resize(struct gctl_req *r off_t last, size, start, new_size; off_t lba, new_lba; const char *s; - char *val; int error, idx; - s = gctl_get_ascii(req, GPART_PARAM_INDEX); - idx = strtol(s, &val, 10); - if (idx < 1 || *s == '\0' || *val != '\0') + idx = (int)gctl_get_intmax(req, GPART_PARAM_INDEX); + if (idx < 1) errx(EXIT_FAILURE, "invalid partition index"); error = geom_gettree(&mesh); @@ -775,7 +773,6 @@ gpart_bootcode(struct gctl_req *req, uns struct gclass *classp; struct ggeom *gp; const char *s; - char *sp; void *bootcode, *partcode; size_t bootsize, partsize; int error, idx, vtoc8; @@ -830,9 +827,8 @@ gpart_bootcode(struct gctl_req *req, uns if (gctl_has_param(req, GPART_PARAM_INDEX)) { if (partcode == NULL) errx(EXIT_FAILURE, "-i is only valid with -p"); - s = gctl_get_ascii(req, GPART_PARAM_INDEX); - idx = strtol(s, &sp, 10); - if (idx < 1 || *s == '\0' || *sp != '\0') + idx = (int)gctl_get_intmax(req, GPART_PARAM_INDEX); + if (idx < 1) errx(EXIT_FAILURE, "invalid partition index"); error = gctl_delete_param(req, GPART_PARAM_INDEX); if (error) From owner-svn-src-head@FreeBSD.ORG Wed Sep 15 21:44:31 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E07A1065673; Wed, 15 Sep 2010 21:44:31 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7C3958FC0A; Wed, 15 Sep 2010 21:44:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8FLiVpe051926; Wed, 15 Sep 2010 21:44:31 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8FLiVmb051922; Wed, 15 Sep 2010 21:44:31 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201009152144.o8FLiVmb051922@svn.freebsd.org> From: Marius Strobl Date: Wed, 15 Sep 2010 21:44:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212709 - in head/sys/sparc64: include sparc64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2010 21:44:31 -0000 Author: marius Date: Wed Sep 15 21:44:31 2010 New Revision: 212709 URL: http://svn.freebsd.org/changeset/base/212709 Log: Add a VIS-based block copy function for SPARC64 V and later, which additionally takes advantage of the prefetch cache of these CPUs. Unlike the uncommitted US-III version, which provide no measurable speedup or even resulted in a slight slowdown on certain CPUs models compared to using the US-I version with these, the SPARC64 version actually results in a slight improvement. Modified: head/sys/sparc64/include/md_var.h head/sys/sparc64/sparc64/machdep.c head/sys/sparc64/sparc64/support.S Modified: head/sys/sparc64/include/md_var.h ============================================================================== --- head/sys/sparc64/include/md_var.h Wed Sep 15 21:37:26 2010 (r212708) +++ head/sys/sparc64/include/md_var.h Wed Sep 15 21:44:31 2010 (r212709) @@ -58,6 +58,8 @@ struct md_utrap *utrap_hold(struct md_ut cpu_block_copy_t spitfire_block_copy; cpu_block_zero_t spitfire_block_zero; +cpu_block_copy_t zeus_block_copy; +cpu_block_zero_t zeus_block_zero; extern cpu_block_copy_t *cpu_block_copy; extern cpu_block_zero_t *cpu_block_zero; Modified: head/sys/sparc64/sparc64/machdep.c ============================================================================== --- head/sys/sparc64/sparc64/machdep.c Wed Sep 15 21:37:26 2010 (r212708) +++ head/sys/sparc64/sparc64/machdep.c Wed Sep 15 21:44:31 2010 (r212709) @@ -495,7 +495,6 @@ sparc64_init(caddr_t mdp, u_long o1, u_l if (cpu_use_vis) { switch (cpu_impl) { case CPU_IMPL_SPARC64: - case CPU_IMPL_SPARC64V: case CPU_IMPL_ULTRASPARCI: case CPU_IMPL_ULTRASPARCII: case CPU_IMPL_ULTRASPARCIIi: @@ -509,6 +508,12 @@ sparc64_init(caddr_t mdp, u_long o1, u_l cpu_block_copy = spitfire_block_copy; cpu_block_zero = spitfire_block_zero; break; + case CPU_IMPL_SPARC64V: + cpu_block_copy = zeus_block_copy; + cpu_block_zero = zeus_block_zero; + cpu_block_copy = spitfire_block_copy; + cpu_block_zero = spitfire_block_zero; + break; } } Modified: head/sys/sparc64/sparc64/support.S ============================================================================== --- head/sys/sparc64/sparc64/support.S Wed Sep 15 21:37:26 2010 (r212708) +++ head/sys/sparc64/sparc64/support.S Wed Sep 15 21:44:31 2010 (r212709) @@ -661,8 +661,121 @@ ENTRY(spitfire_block_copy) END(spitfire_block_copy) /* + * void zeus_block_copy(void *src, void *dst, size_t len) + */ +ENTRY(zeus_block_copy) + prefetch [%o0 + (0 * 64)], 0 + + rdpr %pil, %o3 + wrpr %g0, PIL_TICK, %pil + + wr %g0, ASI_BLK_S, %asi + wr %g0, FPRS_FEF, %fprs + + sub PCB_REG, TF_SIZEOF, %o4 + ldx [%o4 + TF_FPRS], %o5 + andcc %o5, FPRS_FEF, %g0 + bz,a,pt %xcc, 1f + nop + stda %f0, [PCB_REG + PCB_UFP + (0 * 64)] %asi + stda %f16, [PCB_REG + PCB_UFP + (1 * 64)] %asi + stda %f32, [PCB_REG + PCB_UFP + (2 * 64)] %asi + stda %f48, [PCB_REG + PCB_UFP + (3 * 64)] %asi + membar #Sync + + andn %o5, FPRS_FEF, %o5 + stx %o5, [%o4 + TF_FPRS] + ldx [PCB_REG + PCB_FLAGS], %o4 + or %o4, PCB_FEF, %o4 + stx %o4, [PCB_REG + PCB_FLAGS] + +1: wrpr %o3, 0, %pil + + ldd [%o0 + (0 * 8)], %f0 + prefetch [%o0 + (1 * 64)], 0 + ldd [%o0 + (1 * 8)], %f2 + prefetch [%o0 + (2 * 64)], 0 + fmovd %f0, %f32 + ldd [%o0 + (2 * 8)], %f4 + prefetch [%o0 + (3 * 64)], 0 + fmovd %f2, %f34 + ldd [%o0 + (3 * 8)], %f6 + prefetch [%o0 + (4 * 64)], 1 + fmovd %f4, %f36 + ldd [%o0 + (4 * 8)], %f8 + prefetch [%o0 + (8 * 64)], 1 + fmovd %f6, %f38 + ldd [%o0 + (5 * 8)], %f10 + prefetch [%o0 + (12 * 64)], 1 + fmovd %f8, %f40 + ldd [%o0 + (6 * 8)], %f12 + prefetch [%o0 + (16 * 64)], 1 + fmovd %f10, %f42 + ldd [%o0 + (7 * 8)], %f14 + ldd [%o0 + (8 * 8)], %f0 + sub %o2, 64, %o2 + add %o0, 64, %o0 + prefetch [%o0 + (19 * 64)], 1 + ba,pt %xcc, 2f + prefetch [%o0 + (23 * 64)], 1 + .align 32 + +2: ldd [%o0 + (1 * 8)], %f2 + fmovd %f12, %f44 + ldd [%o0 + (2 * 8)], %f4 + fmovd %f14, %f46 + stda %f32, [%o1] %asi + ldd [%o0 + (3 * 8)], %f6 + fmovd %f0, %f32 + ldd [%o0 + (4 * 8)], %f8 + fmovd %f2, %f34 + ldd [%o0 + (5 * 8)], %f10 + fmovd %f4, %f36 + ldd [%o0 + (6 * 8)], %f12 + fmovd %f6, %f38 + ldd [%o0 + (7 * 8)], %f14 + fmovd %f8, %f40 + ldd [%o0 + (8 * 8)], %f0 + fmovd %f10, %f42 + sub %o2, 64, %o2 + prefetch [%o0 + (3 * 64)], 0 + add %o1, 64, %o1 + prefetch [%o0 + (24 * 64)], 1 + add %o0, 64, %o0 + cmp %o2, 64 + 8 + bgu,pt %xcc, 2b + prefetch [%o0 + (12 * 64)], 1 + ldd [%o0 + (1 * 8)], %f2 + fsrc1 %f12, %f44 + ldd [%o0 + (2 * 8)], %f4 + fsrc1 %f14, %f46 + stda %f32, [%o1] %asi + ldd [%o0 + (3 * 8)], %f6 + fsrc1 %f0, %f32 + ldd [%o0 + (4 * 8)], %f8 + fsrc1 %f2, %f34 + ldd [%o0 + (5 * 8)], %f10 + fsrc1 %f4, %f36 + ldd [%o0 + (6 * 8)], %f12 + fsrc1 %f6, %f38 + ldd [%o0 + (7 * 8)], %f14 + fsrc1 %f8, %f40 + add %o1, 64, %o1 + fsrc1 %f10, %f42 + fsrc1 %f12, %f44 + fsrc1 %f14, %f46 + stda %f32, [%o1] %asi + membar #Sync + + retl + wr %g0, 0, %fprs +END(zeus_block_copy) + +/* * void spitfire_block_zero(void *dst, size_t len) + * void zeus_block_zero(void *dst, size_t len) */ +ALTENTRY(zeus_block_zero) ENTRY(spitfire_block_zero) rdpr %pil, %o3 wrpr %g0, PIL_TICK, %pil From owner-svn-src-head@FreeBSD.ORG Wed Sep 15 21:50:38 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 461391065693; Wed, 15 Sep 2010 21:50:38 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1ABE28FC2E; Wed, 15 Sep 2010 21:50:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8FLobgL052106; Wed, 15 Sep 2010 21:50:38 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8FLobrJ052104; Wed, 15 Sep 2010 21:50:37 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201009152150.o8FLobrJ052104@svn.freebsd.org> From: Navdeep Parhar Date: Wed, 15 Sep 2010 21:50:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212710 - head/sys/dev/cxgb/common X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2010 21:50:38 -0000 Author: np Date: Wed Sep 15 21:50:37 2010 New Revision: 212710 URL: http://svn.freebsd.org/changeset/base/212710 Log: Fix t3_gate_rx_traffic and t3_open_rx_traffic. Parts of them always operated on XGMAC0 instead of the specified XGMAC. MFC after: 3 days Modified: head/sys/dev/cxgb/common/cxgb_t3_hw.c Modified: head/sys/dev/cxgb/common/cxgb_t3_hw.c ============================================================================== --- head/sys/dev/cxgb/common/cxgb_t3_hw.c Wed Sep 15 21:44:31 2010 (r212709) +++ head/sys/dev/cxgb/common/cxgb_t3_hw.c Wed Sep 15 21:50:37 2010 (r212710) @@ -1441,16 +1441,18 @@ static void t3_gate_rx_traffic(struct cm t3_mac_disable_exact_filters(mac); /* stop broadcast, multicast, promiscuous mode traffic */ - *rx_cfg = t3_read_reg(mac->adapter, A_XGM_RX_CFG); - t3_set_reg_field(mac->adapter, A_XGM_RX_CFG, + *rx_cfg = t3_read_reg(mac->adapter, A_XGM_RX_CFG + mac->offset); + t3_set_reg_field(mac->adapter, A_XGM_RX_CFG + mac->offset, F_ENHASHMCAST | F_DISBCAST | F_COPYALLFRAMES, F_DISBCAST); - *rx_hash_high = t3_read_reg(mac->adapter, A_XGM_RX_HASH_HIGH); - t3_write_reg(mac->adapter, A_XGM_RX_HASH_HIGH, 0); - - *rx_hash_low = t3_read_reg(mac->adapter, A_XGM_RX_HASH_LOW); - t3_write_reg(mac->adapter, A_XGM_RX_HASH_LOW, 0); + *rx_hash_high = t3_read_reg(mac->adapter, A_XGM_RX_HASH_HIGH + + mac->offset); + t3_write_reg(mac->adapter, A_XGM_RX_HASH_HIGH + mac->offset, 0); + + *rx_hash_low = t3_read_reg(mac->adapter, A_XGM_RX_HASH_LOW + + mac->offset); + t3_write_reg(mac->adapter, A_XGM_RX_HASH_LOW + mac->offset, 0); /* Leave time to drain max RX fifo */ msleep(1); @@ -1460,11 +1462,13 @@ static void t3_open_rx_traffic(struct cm u32 rx_hash_high, u32 rx_hash_low) { t3_mac_enable_exact_filters(mac); - t3_set_reg_field(mac->adapter, A_XGM_RX_CFG, + t3_set_reg_field(mac->adapter, A_XGM_RX_CFG + mac->offset, F_ENHASHMCAST | F_DISBCAST | F_COPYALLFRAMES, rx_cfg); - t3_write_reg(mac->adapter, A_XGM_RX_HASH_HIGH, rx_hash_high); - t3_write_reg(mac->adapter, A_XGM_RX_HASH_LOW, rx_hash_low); + t3_write_reg(mac->adapter, A_XGM_RX_HASH_HIGH + mac->offset, + rx_hash_high); + t3_write_reg(mac->adapter, A_XGM_RX_HASH_LOW + mac->offset, + rx_hash_low); } static int t3_detect_link_fault(adapter_t *adapter, int port_id) From owner-svn-src-head@FreeBSD.ORG Wed Sep 15 21:53:10 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C6CE2106564A; Wed, 15 Sep 2010 21:53:10 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B62BD8FC15; Wed, 15 Sep 2010 21:53:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8FLrA3f052207; Wed, 15 Sep 2010 21:53:10 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8FLrA8m052205; Wed, 15 Sep 2010 21:53:10 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201009152153.o8FLrA8m052205@svn.freebsd.org> From: Michael Tuexen Date: Wed, 15 Sep 2010 21:53:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212711 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2010 21:53:10 -0000 Author: tuexen Date: Wed Sep 15 21:53:10 2010 New Revision: 212711 URL: http://svn.freebsd.org/changeset/base/212711 Log: Use TAILQ_EMPTY() for testing if a tail queue is empty. Set whoFrom to NULL after freeing whoFrom. Modified: head/sys/netinet/sctp_indata.c Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Wed Sep 15 21:50:37 2010 (r212710) +++ head/sys/netinet/sctp_indata.c Wed Sep 15 21:53:10 2010 (r212711) @@ -708,9 +708,10 @@ protocol_error: control->data = NULL; asoc->size_on_all_streams -= control->length; sctp_ucount_decr(asoc->cnt_on_all_streams); - if (control->whoFrom) + if (control->whoFrom) { sctp_free_remote_addr(control->whoFrom); - control->whoFrom = NULL; + control->whoFrom = NULL; + } sctp_free_a_readq(stcb, control); return; } else { @@ -4845,7 +4846,7 @@ sctp_handle_sack(struct mbuf *m, int off if (asoc->pr_sctp_cnt != 0) asoc->pr_sctp_cnt--; } - if ((TAILQ_FIRST(&asoc->sent_queue) == NULL) && + if (TAILQ_EMPTY(&asoc->sent_queue) && (asoc->total_flight > 0)) { #ifdef INVARIANTS panic("Warning flight size is postive and should be 0"); @@ -5818,7 +5819,7 @@ sctp_handle_forward_tsn(struct sctp_tcb */ sctp_slide_mapping_arrays(stcb); - if (TAILQ_FIRST(&asoc->reasmqueue)) { + if (!TAILQ_EMPTY(&asoc->reasmqueue)) { /* now lets kick out and check for more fragmented delivery */ /* sa_ignore NO_NULL_CHK */ sctp_deliver_reasm_check(stcb, &stcb->asoc); From owner-svn-src-head@FreeBSD.ORG Wed Sep 15 23:10:45 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B236F1065673; Wed, 15 Sep 2010 23:10:45 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A04F48FC08; Wed, 15 Sep 2010 23:10:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8FNAjuP053904; Wed, 15 Sep 2010 23:10:45 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8FNAjbX053895; Wed, 15 Sep 2010 23:10:45 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201009152310.o8FNAjbX053895@svn.freebsd.org> From: Michael Tuexen Date: Wed, 15 Sep 2010 23:10:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212712 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2010 23:10:45 -0000 Author: tuexen Date: Wed Sep 15 23:10:45 2010 New Revision: 212712 URL: http://svn.freebsd.org/changeset/base/212712 Log: Delay the assignment of a path for DATA chunk until they hit the sent_queue. Honor a given path when the SCTP_ADDR_OVER flag is set. MFC after: 2 weeks. Modified: head/sys/netinet/sctp_asconf.c head/sys/netinet/sctp_asconf.h head/sys/netinet/sctp_input.c head/sys/netinet/sctp_output.c head/sys/netinet/sctp_output.h head/sys/netinet/sctp_pcb.c head/sys/netinet/sctp_timer.c head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctp_asconf.c ============================================================================== --- head/sys/netinet/sctp_asconf.c Wed Sep 15 21:53:10 2010 (r212711) +++ head/sys/netinet/sctp_asconf.c Wed Sep 15 23:10:45 2010 (r212712) @@ -581,8 +581,8 @@ sctp_process_asconf_set_primary(struct m } if (sctp_is_mobility_feature_on(stcb->sctp_ep, SCTP_MOBILITY_BASE)) { - sctp_move_chunks_from_deleted_prim(stcb, - stcb->asoc.primary_destination); + sctp_move_chunks_from_net(stcb, + stcb->asoc.deleted_primary); } sctp_delete_prim_timer(stcb->sctp_ep, stcb, stcb->asoc.deleted_primary); @@ -1041,47 +1041,6 @@ sctp_asconf_nets_cleanup(struct sctp_tcb } } -void -sctp_move_chunks_from_deleted_prim(struct sctp_tcb *stcb, struct sctp_nets *dst) -{ - struct sctp_association *asoc; - struct sctp_stream_out *outs; - struct sctp_tmit_chunk *chk; - struct sctp_stream_queue_pending *sp; - - if (dst->dest_state & SCTP_ADDR_UNCONFIRMED) { - return; - } - if (stcb->asoc.deleted_primary == NULL) { - return; - } - asoc = &stcb->asoc; - - /* - * now through all the streams checking for chunks sent to our bad - * network. - */ - TAILQ_FOREACH(outs, &asoc->out_wheel, next_spoke) { - /* now clean up any chunks here */ - TAILQ_FOREACH(sp, &outs->outqueue, next) { - if (sp->net == asoc->deleted_primary) { - sctp_free_remote_addr(sp->net); - sp->net = dst; - atomic_add_int(&dst->ref_count, 1); - } - } - } - /* Now check the pending queue */ - TAILQ_FOREACH(chk, &asoc->send_queue, sctp_next) { - if (chk->whoTo == asoc->deleted_primary) { - sctp_free_remote_addr(chk->whoTo); - chk->whoTo = dst; - atomic_add_int(&dst->ref_count, 1); - } - } - -} - void sctp_assoc_immediate_retrans(struct sctp_tcb *stcb, struct sctp_nets *dstnet) @@ -2080,13 +2039,11 @@ sctp_asconf_iterator_ep(struct sctp_inpc struct sctp_asconf_iterator *asc; struct sctp_ifa *ifa; struct sctp_laddr *l; - int type; int cnt_invalid = 0; asc = (struct sctp_asconf_iterator *)ptr; LIST_FOREACH(l, &asc->list_of_work, sctp_nxt_addr) { ifa = l->ifa; - type = l->action; if (ifa->address.sa.sa_family == AF_INET6) { /* invalid if we're not a v6 endpoint */ if ((inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) == 0) { Modified: head/sys/netinet/sctp_asconf.h ============================================================================== --- head/sys/netinet/sctp_asconf.h Wed Sep 15 21:53:10 2010 (r212711) +++ head/sys/netinet/sctp_asconf.h Wed Sep 15 23:10:45 2010 (r212712) @@ -80,8 +80,6 @@ sctp_check_address_list(struct sctp_tcb struct sockaddr *, uint16_t, uint16_t, uint16_t, uint16_t); extern void - sctp_move_chunks_from_deleted_prim(struct sctp_tcb *, struct sctp_nets *); -extern void sctp_assoc_immediate_retrans(struct sctp_tcb *, struct sctp_nets *); extern void sctp_net_immediate_retrans(struct sctp_tcb *, struct sctp_nets *); Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Wed Sep 15 21:53:10 2010 (r212711) +++ head/sys/netinet/sctp_input.c Wed Sep 15 23:10:45 2010 (r212712) @@ -232,7 +232,10 @@ sctp_is_there_unsent_data(struct sctp_tc } atomic_subtract_int(&stcb->asoc.stream_queue_cnt, 1); TAILQ_REMOVE(&strq->outqueue, sp, next); - sctp_free_remote_addr(sp->net); + if (sp->net) { + sctp_free_remote_addr(sp->net); + sp->net = NULL; + } if (sp->data) { sctp_m_freem(sp->data); sp->data = NULL; @@ -263,7 +266,7 @@ sctp_process_init(struct sctp_init_chunk /* save off parameters */ asoc->peer_vtag = ntohl(init->initiate_tag); asoc->peers_rwnd = ntohl(init->a_rwnd); - if (TAILQ_FIRST(&asoc->nets)) { + if (!TAILQ_EMPTY(&asoc->nets)) { /* update any ssthresh's that may have a default */ TAILQ_FOREACH(lnet, &asoc->nets, sctp_next) { lnet->ssthresh = asoc->peers_rwnd; @@ -318,8 +321,10 @@ sctp_process_init(struct sctp_init_chunk sctp_m_freem(sp->data); sp->data = NULL; } - sctp_free_remote_addr(sp->net); - sp->net = NULL; + if (sp->net) { + sctp_free_remote_addr(sp->net); + sp->net = NULL; + } /* Free the chunk */ sctp_free_a_strmoq(stcb, sp); /* sa_ignore FREED_MEMORY */ @@ -650,8 +655,8 @@ sctp_handle_heartbeat_ack(struct sctp_he } if (sctp_is_mobility_feature_on(stcb->sctp_ep, SCTP_MOBILITY_BASE)) { - sctp_move_chunks_from_deleted_prim(stcb, - stcb->asoc.primary_destination); + sctp_move_chunks_from_net(stcb, + stcb->asoc.deleted_primary); } sctp_delete_prim_timer(stcb->sctp_ep, stcb, stcb->asoc.deleted_primary); Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Wed Sep 15 21:53:10 2010 (r212711) +++ head/sys/netinet/sctp_output.c Wed Sep 15 23:10:45 2010 (r212712) @@ -5911,10 +5911,10 @@ sctp_msg_append(struct sctp_tcb *stcb, sp->strseq = 0; if (sp->sinfo_flags & SCTP_ADDR_OVER) { sp->net = net; + atomic_add_int(&sp->net->ref_count, 1); } else { - sp->net = stcb->asoc.primary_destination; + sp->net = NULL; } - atomic_add_int(&sp->net->ref_count, 1); (void)SCTP_GETTIME_TIMEVAL(&sp->ts); sp->stream = srcv->sinfo_stream; sp->msg_is_complete = 1; @@ -6513,7 +6513,6 @@ sctp_toss_old_asconf(struct sctp_tcb *st static void sctp_clean_up_datalist(struct sctp_tcb *stcb, - struct sctp_association *asoc, struct sctp_tmit_chunk **data_list, int bundle_at, @@ -6524,7 +6523,9 @@ sctp_clean_up_datalist(struct sctp_tcb * for (i = 0; i < bundle_at; i++) { /* off of the send queue */ - if (i) { + TAILQ_REMOVE(&asoc->send_queue, data_list[i], sctp_next); + asoc->send_queue_cnt--; + if (i > 0) { /* * Any chunk NOT 0 you zap the time chunk 0 gets * zapped or set based on if a RTO measurment is @@ -6535,9 +6536,10 @@ sctp_clean_up_datalist(struct sctp_tcb * /* record time */ data_list[i]->sent_rcv_time = net->last_sent_time; data_list[i]->rec.data.fast_retran_tsn = data_list[i]->rec.data.TSN_seq; - TAILQ_REMOVE(&asoc->send_queue, - data_list[i], - sctp_next); + if (data_list[i]->whoTo == NULL) { + data_list[i]->whoTo = net; + atomic_add_int(&net->ref_count, 1); + } /* on to the sent queue */ tp1 = TAILQ_LAST(&asoc->sent_queue, sctpchunk_listhead); if ((tp1) && (compare_with_wrap(tp1->rec.data.TSN_seq, @@ -6565,7 +6567,6 @@ sctp_clean_up_datalist(struct sctp_tcb * all_done: /* This does not lower until the cum-ack passes it */ asoc->sent_queue_cnt++; - asoc->send_queue_cnt--; if ((asoc->peers_rwnd <= 0) && (asoc->total_flight == 0) && (bundle_at == 1)) { @@ -6703,7 +6704,7 @@ sctp_can_we_split_this(struct sctp_tcb * } static uint32_t -sctp_move_to_outqueue(struct sctp_tcb *stcb, struct sctp_nets *net, +sctp_move_to_outqueue(struct sctp_tcb *stcb, struct sctp_stream_out *strq, uint32_t goal_mtu, uint32_t frag_point, @@ -6772,7 +6773,10 @@ one_more_time: } atomic_subtract_int(&asoc->stream_queue_cnt, 1); TAILQ_REMOVE(&strq->outqueue, sp, next); - sctp_free_remote_addr(sp->net); + if (sp->net) { + sctp_free_remote_addr(sp->net); + sp->net = NULL; + } if (sp->data) { sctp_m_freem(sp->data); sp->data = NULL; @@ -7089,8 +7093,11 @@ dont_do_it: chk->rec.data.timetodrop = sp->ts; chk->flags = sp->act_flags; - chk->whoTo = net; - atomic_add_int(&chk->whoTo->ref_count, 1); + if (sp->net) { + chk->whoTo = sp->net; + atomic_add_int(&chk->whoTo->ref_count, 1); + } else + chk->whoTo = NULL; if (sp->holds_key_ref) { chk->auth_keyid = sp->auth_keyid; @@ -7175,7 +7182,10 @@ dont_do_it: send_lock_up = 1; } TAILQ_REMOVE(&strq->outqueue, sp, next); - sctp_free_remote_addr(sp->net); + if (sp->net) { + sctp_free_remote_addr(sp->net); + sp->net = NULL; + } if (sp->data) { sctp_m_freem(sp->data); sp->data = NULL; @@ -7248,31 +7258,29 @@ sctp_fill_outqueue(struct sctp_tcb *stcb goal_mtu &= 0xfffffffc; if (asoc->locked_on_sending) { /* We are stuck on one stream until the message completes. */ - strqn = strq = asoc->locked_on_sending; + strq = asoc->locked_on_sending; locked = 1; } else { - strqn = strq = sctp_select_a_stream(stcb, asoc); + strq = sctp_select_a_stream(stcb, asoc); locked = 0; } - + strqn = strq; while ((goal_mtu > 0) && strq) { sp = TAILQ_FIRST(&strq->outqueue); - /* - * If CMT is off, we must validate that the stream in - * question has the first item pointed towards are network - * destionation requested by the caller. Note that if we - * turn out to be locked to a stream (assigning TSN's then - * we must stop, since we cannot look for another stream - * with data to send to that destination). In CMT's case, by - * skipping this check, we will send one data packet towards - * the requested net. - */ if (sp == NULL) { break; } - if ((sp->net != net) && - (asoc->sctp_cmt_on_off == 0)) { - /* none for this network */ + /** + * Honor the users' choice if given. If not given, + * pull it only to the primary path in case of not using + * CMT. + */ + if (((sp->net != NULL) && + (sp->net != net)) || + ((sp->net == NULL) && + (asoc->sctp_cmt_on_off == 0) && + (asoc->primary_destination != net))) { + /* Do not pull to this network */ if (locked) { break; } else { @@ -7289,7 +7297,7 @@ sctp_fill_outqueue(struct sctp_tcb *stcb } giveup = 0; bail = 0; - moved_how_much = sctp_move_to_outqueue(stcb, net, strq, goal_mtu, frag_point, &locked, + moved_how_much = sctp_move_to_outqueue(stcb, strq, goal_mtu, frag_point, &locked, &giveup, eeor_mode, &bail); if (moved_how_much) asoc->last_out_stream = strq; @@ -7353,43 +7361,32 @@ sctp_fix_ecn_echo(struct sctp_associatio } } -static void -sctp_move_to_an_alt(struct sctp_tcb *stcb, - struct sctp_association *asoc, - struct sctp_nets *net) +void +sctp_move_chunks_from_net(struct sctp_tcb *stcb, struct sctp_nets *net) { + struct sctp_association *asoc; + struct sctp_stream_out *outs; struct sctp_tmit_chunk *chk; - struct sctp_nets *a_net; + struct sctp_stream_queue_pending *sp; - SCTP_TCB_LOCK_ASSERT(stcb); - /* - * JRS 5/14/07 - If CMT PF is turned on, find an alternate - * destination using the PF algorithm for finding alternate - * destinations. - */ - if ((asoc->sctp_cmt_on_off == 1) && - (asoc->sctp_cmt_pf > 0)) { - a_net = sctp_find_alternate_net(stcb, net, 2); - } else { - a_net = sctp_find_alternate_net(stcb, net, 0); + if (net == NULL) { + return; } - if ((a_net != net) && - ((a_net->dest_state & SCTP_ADDR_REACHABLE) == SCTP_ADDR_REACHABLE)) { - /* - * We only proceed if a valid alternate is found that is not - * this one and is reachable. Here we must move all chunks - * queued in the send queue off of the destination address - * to our alternate. - */ - TAILQ_FOREACH(chk, &asoc->send_queue, sctp_next) { - if (chk->whoTo == net) { - /* Move the chunk to our alternate */ - sctp_free_remote_addr(chk->whoTo); - chk->whoTo = a_net; - atomic_add_int(&a_net->ref_count, 1); + asoc = &stcb->asoc; + TAILQ_FOREACH(outs, &asoc->out_wheel, next_spoke) { + TAILQ_FOREACH(sp, &outs->outqueue, next) { + if (sp->net == net) { + sctp_free_remote_addr(sp->net); + sp->net = NULL; } } } + TAILQ_FOREACH(chk, &asoc->send_queue, sctp_next) { + if (chk->whoTo == net) { + sctp_free_remote_addr(chk->whoTo); + chk->whoTo = NULL; + } + } } int @@ -7497,7 +7494,8 @@ sctp_med_chunk_output(struct sctp_inpcb * copy by reference (we hope). */ net->window_probe = 0; - if ((net->dest_state & SCTP_ADDR_NOT_REACHABLE) || (net->dest_state & SCTP_ADDR_UNCONFIRMED)) { + if ((net->dest_state & SCTP_ADDR_NOT_REACHABLE) || + (net->dest_state & SCTP_ADDR_UNCONFIRMED)) { if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_LOGGING_ENABLE) { sctp_log_cwnd(stcb, net, 1, SCTP_CWND_LOG_FILL_OUTQ_CALLED); @@ -7505,6 +7503,7 @@ sctp_med_chunk_output(struct sctp_inpcb continue; } if ((asoc->sctp_cmt_on_off == 0) && + (asoc->primary_destination != net) && (net->ref_count < 2)) { /* nothing can be in queue for this guy */ if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_LOGGING_ENABLE) { @@ -7534,9 +7533,9 @@ sctp_med_chunk_output(struct sctp_inpcb } /* now service each destination and send out what we can for it */ /* Nothing to send? */ - if ((TAILQ_FIRST(&asoc->control_send_queue) == NULL) && - (TAILQ_FIRST(&asoc->asconf_send_queue) == NULL) && - (TAILQ_FIRST(&asoc->send_queue) == NULL)) { + if (TAILQ_EMPTY(&asoc->control_send_queue) && + TAILQ_EMPTY(&asoc->asconf_send_queue) && + TAILQ_EMPTY(&asoc->send_queue)) { *reason_code = 8; return (0); } @@ -7566,15 +7565,17 @@ again_one_more_time: break; } tsns_sent = 0xa; - if ((asoc->sctp_cmt_on_off == 0) && (net->ref_count < 2)) { + if ((asoc->sctp_cmt_on_off == 0) && + (asoc->primary_destination != net) && + (net->ref_count < 2)) { /* * Ref-count of 1 so we cannot have data or control * queued to this address. Skip it (non-CMT). */ continue; } - if ((TAILQ_FIRST(&asoc->control_send_queue) == NULL) && - (TAILQ_FIRST(&asoc->asconf_send_queue) == NULL) && + if (TAILQ_EMPTY(&asoc->control_send_queue) && + TAILQ_EMPTY(&asoc->asconf_send_queue) && (net->flight_size >= net->cwnd)) { /* * Nothing on control or asconf and flight is full, @@ -7778,7 +7779,7 @@ again_one_more_time: * unreachable * during this send */ - sctp_move_to_an_alt(stcb, asoc, net); + sctp_move_chunks_from_net(stcb, net); } *reason_code = 7; continue; @@ -8001,7 +8002,7 @@ again_one_more_time: * unreachable * during this send */ - sctp_move_to_an_alt(stcb, asoc, net); + sctp_move_chunks_from_net(stcb, net); } *reason_code = 7; continue; @@ -8102,19 +8103,9 @@ again_one_more_time: break; } nchk = TAILQ_NEXT(chk, sctp_next); - if (asoc->sctp_cmt_on_off == 1) { - if (chk->whoTo != net) { - /* - * For CMT, steal the data - * to this network if its - * not set here. - */ - sctp_free_remote_addr(chk->whoTo); - chk->whoTo = net; - atomic_add_int(&chk->whoTo->ref_count, 1); - } - } else if (chk->whoTo != net) { - /* No, not sent to this net */ + if ((chk->whoTo != NULL) && + (chk->whoTo != net)) { + /* Don't send the chunk on this net */ continue; } if ((chk->send_size > omtu) && ((chk->flags & CHUNK_FLAGS_FRAGMENT_OK) == 0)) { @@ -8330,7 +8321,7 @@ no_data_fill: * Destination went unreachable * during this send */ - sctp_move_to_an_alt(stcb, asoc, net); + sctp_move_chunks_from_net(stcb, net); } *reason_code = 6; /*- @@ -9584,7 +9575,7 @@ sctp_chunk_output(struct sctp_inpcb *inp * out wheel to this alternate address. */ if (net->ref_count > 1) - sctp_move_to_an_alt(stcb, asoc, net); + sctp_move_chunks_from_net(stcb, net); } else if ((asoc->sctp_cmt_on_off == 1) && (asoc->sctp_cmt_pf > 0) && ((net->dest_state & SCTP_ADDR_PF) == SCTP_ADDR_PF)) { @@ -9594,7 +9585,7 @@ sctp_chunk_output(struct sctp_inpcb *inp * to an alternate desination. */ if (net->ref_count > 1) - sctp_move_to_an_alt(stcb, asoc, net); + sctp_move_chunks_from_net(stcb, net); } else { /*- * if ((asoc->sat_network) || (net->addr_is_local)) @@ -12103,10 +12094,10 @@ skip_copy: } else { if (sp->sinfo_flags & SCTP_ADDR_OVER) { sp->net = net; + atomic_add_int(&sp->net->ref_count, 1); } else { - sp->net = asoc->primary_destination; + sp->net = NULL; } - atomic_add_int(&sp->net->ref_count, 1); sctp_set_prsctp_policy(sp); } out_now: Modified: head/sys/netinet/sctp_output.h ============================================================================== --- head/sys/netinet/sctp_output.h Wed Sep 15 21:53:10 2010 (r212711) +++ head/sys/netinet/sctp_output.h Wed Sep 15 23:10:45 2010 (r212712) @@ -129,6 +129,8 @@ void sctp_toss_old_asconf(struct sctp_tc void sctp_fix_ecn_echo(struct sctp_association *); +void sctp_move_chunks_from_net(struct sctp_tcb *stcb, struct sctp_nets *net); + int sctp_output(struct sctp_inpcb *, struct mbuf *, struct sockaddr *, struct mbuf *, struct thread *, int); Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Wed Sep 15 21:53:10 2010 (r212711) +++ head/sys/netinet/sctp_pcb.c Wed Sep 15 23:10:45 2010 (r212712) @@ -4843,7 +4843,10 @@ sctp_free_assoc(struct sctp_inpcb *inp, sp->tail_mbuf = NULL; } } - sctp_free_remote_addr(sp->net); + if (sp->net) { + sctp_free_remote_addr(sp->net); + sp->net = NULL; + } sctp_free_spbufspace(stcb, asoc, sp); if (sp->holds_key_ref) sctp_auth_key_release(stcb, sp->auth_keyid); @@ -4914,7 +4917,10 @@ sctp_free_assoc(struct sctp_inpcb *inp, if (chk->holds_key_ref) sctp_auth_key_release(stcb, chk->auth_keyid); ccnt++; - sctp_free_remote_addr(chk->whoTo); + if (chk->whoTo) { + sctp_free_remote_addr(chk->whoTo); + chk->whoTo = NULL; + } SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_chunk), chk); SCTP_DECR_CHK_COUNT(); /* sa_ignore FREED_MEMORY */ Modified: head/sys/netinet/sctp_timer.c ============================================================================== --- head/sys/netinet/sctp_timer.c Wed Sep 15 21:53:10 2010 (r212711) +++ head/sys/netinet/sctp_timer.c Wed Sep 15 23:10:45 2010 (r212712) @@ -969,46 +969,6 @@ start_again: return (0); } -static void -sctp_move_all_chunks_to_alt(struct sctp_tcb *stcb, - struct sctp_nets *net, - struct sctp_nets *alt) -{ - struct sctp_association *asoc; - struct sctp_stream_out *outs; - struct sctp_tmit_chunk *chk; - struct sctp_stream_queue_pending *sp; - - if (net == alt) - /* nothing to do */ - return; - - asoc = &stcb->asoc; - - /* - * now through all the streams checking for chunks sent to our bad - * network. - */ - TAILQ_FOREACH(outs, &asoc->out_wheel, next_spoke) { - /* now clean up any chunks here */ - TAILQ_FOREACH(sp, &outs->outqueue, next) { - if (sp->net == net) { - sctp_free_remote_addr(sp->net); - sp->net = alt; - atomic_add_int(&alt->ref_count, 1); - } - } - } - /* Now check the pending queue */ - TAILQ_FOREACH(chk, &asoc->send_queue, sctp_next) { - if (chk->whoTo == net) { - sctp_free_remote_addr(chk->whoTo); - chk->whoTo = alt; - atomic_add_int(&alt->ref_count, 1); - } - } - -} int sctp_t3rxt_timer(struct sctp_inpcb *inp, @@ -1141,7 +1101,7 @@ sctp_t3rxt_timer(struct sctp_inpcb *inp, } if (net->dest_state & SCTP_ADDR_NOT_REACHABLE) { /* Move all pending over too */ - sctp_move_all_chunks_to_alt(stcb, net, alt); + sctp_move_chunks_from_net(stcb, net); /* * Get the address that failed, to force a new src address @@ -1256,7 +1216,7 @@ sctp_t1init_timer(struct sctp_inpcb *inp alt = sctp_find_alternate_net(stcb, stcb->asoc.primary_destination, 0); if ((alt != NULL) && (alt != stcb->asoc.primary_destination)) { - sctp_move_all_chunks_to_alt(stcb, stcb->asoc.primary_destination, alt); + sctp_move_chunks_from_net(stcb, stcb->asoc.primary_destination); stcb->asoc.primary_destination = alt; } } @@ -1396,7 +1356,7 @@ sctp_strreset_timer(struct sctp_inpcb *i * If the address went un-reachable, we need to move to * alternates for ALL chk's in queue */ - sctp_move_all_chunks_to_alt(stcb, net, alt); + sctp_move_chunks_from_net(stcb, net); } /* mark the retran info */ if (strrst->sent != SCTP_DATAGRAM_RESEND) @@ -1487,8 +1447,7 @@ sctp_asconf_timer(struct sctp_inpcb *inp * If the address went un-reachable, we need to move * to the alternate for ALL chunks in queue */ - sctp_move_all_chunks_to_alt(stcb, net, alt); - net = alt; + sctp_move_chunks_from_net(stcb, net); } /* mark the retran info */ if (asconf->sent != SCTP_DATAGRAM_RESEND) Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Wed Sep 15 21:53:10 2010 (r212711) +++ head/sys/netinet/sctputil.c Wed Sep 15 23:10:45 2010 (r212712) @@ -2500,7 +2500,6 @@ sctp_mtu_size_reset(struct sctp_inpcb *i } eff_mtu = mtu - ovh; TAILQ_FOREACH(chk, &asoc->send_queue, sctp_next) { - if (chk->send_size > eff_mtu) { chk->flags |= CHUNK_FLAGS_FRAGMENT_OK; } @@ -3763,9 +3762,10 @@ sctp_report_all_outbound(struct sctp_tcb sp->data = NULL; } } - if (sp->net) + if (sp->net) { sctp_free_remote_addr(sp->net); - sp->net = NULL; + sp->net = NULL; + } /* Free the chunk */ sctp_free_a_strmoq(stcb, sp); /* sa_ignore FREED_MEMORY */ @@ -4818,7 +4818,10 @@ next_on_sent: chk->rec.data.payloadtype = sp->ppid; chk->rec.data.context = sp->context; chk->flags = sp->act_flags; - chk->whoTo = sp->net; + if (sp->net) + chk->whoTo = sp->net; + else + chk->whoTo = stcb->asoc.primary_destination; atomic_add_int(&chk->whoTo->ref_count, 1); chk->rec.data.TSN_seq = atomic_fetchadd_int(&stcb->asoc.sending_seq, 1); stcb->asoc.pr_sctp_cnt++; From owner-svn-src-head@FreeBSD.ORG Wed Sep 15 23:40:36 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 860111065693; Wed, 15 Sep 2010 23:40:36 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 753298FC23; Wed, 15 Sep 2010 23:40:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8FNeapH054572; Wed, 15 Sep 2010 23:40:36 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8FNeaFN054570; Wed, 15 Sep 2010 23:40:36 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201009152340.o8FNeaFN054570@svn.freebsd.org> From: Michael Tuexen Date: Wed, 15 Sep 2010 23:40:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212713 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2010 23:40:36 -0000 Author: tuexen Date: Wed Sep 15 23:40:36 2010 New Revision: 212713 URL: http://svn.freebsd.org/changeset/base/212713 Log: Remove unused variable/assignment. MFC after: 3 weeks. Modified: head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Wed Sep 15 23:10:45 2010 (r212712) +++ head/sys/netinet/sctputil.c Wed Sep 15 23:40:36 2010 (r212713) @@ -5135,7 +5135,7 @@ sctp_sorecvmsg(struct socket *so, int my_len = 0; int cp_len = 0, error = 0; struct sctp_queued_to_read *control = NULL, *ctl = NULL, *nxt = NULL; - struct mbuf *m = NULL, *embuf = NULL; + struct mbuf *m = NULL; struct sctp_tcb *stcb = NULL; int wakeup_read_socket = 0; int freecnt_applied = 0; @@ -5731,7 +5731,6 @@ get_more_data: sctp_sblog(&so->so_rcv, control->do_not_ref_stcb ? NULL : stcb, SCTP_LOG_SBRESULT, 0); } - embuf = m; copied_so_far += cp_len; freed_so_far += cp_len; freed_so_far += MSIZE; @@ -5783,7 +5782,6 @@ get_more_data: atomic_subtract_int(&stcb->asoc.sb_cc, cp_len); } copied_so_far += cp_len; - embuf = m; freed_so_far += cp_len; freed_so_far += MSIZE; if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_SB_LOGGING_ENABLE) { From owner-svn-src-head@FreeBSD.ORG Wed Sep 15 23:56:25 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ED2D91065672; Wed, 15 Sep 2010 23:56:25 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DBCCA8FC12; Wed, 15 Sep 2010 23:56:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8FNuP3L054921; Wed, 15 Sep 2010 23:56:25 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8FNuPqI054916; Wed, 15 Sep 2010 23:56:25 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201009152356.o8FNuPqI054916@svn.freebsd.org> From: Michael Tuexen Date: Wed, 15 Sep 2010 23:56:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212714 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2010 23:56:26 -0000 Author: tuexen Date: Wed Sep 15 23:56:25 2010 New Revision: 212714 URL: http://svn.freebsd.org/changeset/base/212714 Log: Remove old debug code. MFC after: 2 weeks. Modified: head/sys/netinet/sctp_output.c head/sys/netinet/sctp_pcb.c head/sys/netinet/sctp_usrreq.c head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Wed Sep 15 23:40:36 2010 (r212713) +++ head/sys/netinet/sctp_output.c Wed Sep 15 23:56:25 2010 (r212714) @@ -3803,9 +3803,6 @@ sctp_lowlevel_chunk_output(struct sctp_i mtu -= sizeof(struct udphdr); } if (mtu && (stcb->asoc.smallest_mtu > mtu)) { -#ifdef SCTP_PRINT_FOR_B_AND_M - SCTP_PRINTF("sctp_mtu_size_reset called after ip_output mtu-change:%d\n", mtu); -#endif sctp_mtu_size_reset(inp, &stcb->asoc, mtu); net->mtu = mtu; } @@ -4134,10 +4131,6 @@ sctp_lowlevel_chunk_output(struct sctp_i mtu = SCTP_GATHER_MTU_FROM_ROUTE(net->ro._s_addr, &net->ro._l_addr.sa, ro->ro_rt); if (mtu && (stcb->asoc.smallest_mtu > mtu)) { -#ifdef SCTP_PRINT_FOR_B_AND_M - SCTP_PRINTF("sctp_mtu_size_reset called after ip6_output mtu-change:%d\n", - mtu); -#endif sctp_mtu_size_reset(inp, &stcb->asoc, mtu); net->mtu = mtu; if (net->port) { @@ -4147,10 +4140,6 @@ sctp_lowlevel_chunk_output(struct sctp_i } else if (ifp) { if (ND_IFINFO(ifp)->linkmtu && (stcb->asoc.smallest_mtu > ND_IFINFO(ifp)->linkmtu)) { -#ifdef SCTP_PRINT_FOR_B_AND_M - SCTP_PRINTF("sctp_mtu_size_reset called via ifp ND_IFINFO() linkmtu:%d\n", - ND_IFINFO(ifp)->linkmtu); -#endif sctp_mtu_size_reset(inp, &stcb->asoc, ND_IFINFO(ifp)->linkmtu); Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Wed Sep 15 23:40:36 2010 (r212713) +++ head/sys/netinet/sctp_pcb.c Wed Sep 15 23:56:25 2010 (r212714) @@ -3916,9 +3916,6 @@ sctp_add_remote_addr(struct sctp_tcb *st } else { net->mtu = 0; } -#ifdef SCTP_PRINT_FOR_B_AND_M - SCTP_PRINTF("We have found an interface mtu of %d\n", net->mtu); -#endif if (net->mtu == 0) { /* Huh ?? */ net->mtu = SCTP_DEFAULT_MTU; @@ -3926,9 +3923,6 @@ sctp_add_remote_addr(struct sctp_tcb *st uint32_t rmtu; rmtu = SCTP_GATHER_MTU_FROM_ROUTE(net->ro._s_addr, &net->ro._l_addr.sa, net->ro.ro_rt); -#ifdef SCTP_PRINT_FOR_B_AND_M - SCTP_PRINTF("The route mtu is %d\n", rmtu); -#endif if (rmtu == 0) { /* * Start things off to match mtu of @@ -3946,9 +3940,6 @@ sctp_add_remote_addr(struct sctp_tcb *st } } if (from == SCTP_ALLOC_ASOC) { -#ifdef SCTP_PRINT_FOR_B_AND_M - SCTP_PRINTF("New assoc sets mtu to :%d\n", net->mtu); -#endif stcb->asoc.smallest_mtu = net->mtu; } } else { @@ -3966,10 +3957,6 @@ sctp_add_remote_addr(struct sctp_tcb *st net->mtu -= sizeof(struct udphdr); } if (stcb->asoc.smallest_mtu > net->mtu) { -#ifdef SCTP_PRINT_FOR_B_AND_M - SCTP_PRINTF("new address mtu:%d smaller than smallest:%d\n", - net->mtu, stcb->asoc.smallest_mtu); -#endif stcb->asoc.smallest_mtu = net->mtu; } /* JRS - Use the congestion control given in the CC module */ Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Wed Sep 15 23:40:36 2010 (r212713) +++ head/sys/netinet/sctp_usrreq.c Wed Sep 15 23:56:25 2010 (r212714) @@ -111,10 +111,6 @@ sctp_pathmtu_adjustment(struct sctp_inpc /* Adjust that too */ stcb->asoc.smallest_mtu = nxtsz; /* now off to subtract IP_DF flag if needed */ -#ifdef SCTP_PRINT_FOR_B_AND_M - SCTP_PRINTF("sctp_pathmtu_adjust called inp:%p stcb:%p net:%p nxtsz:%d\n", - inp, stcb, net, nxtsz); -#endif overhead = IP_HDR_SIZE; if (sctp_auth_is_required_chunk(SCTP_DATA, stcb->asoc.peer_auth_chunks)) { overhead += sctp_get_auth_chunk_len(stcb->asoc.peer_hmac_id); @@ -215,10 +211,6 @@ sctp_notify_mbuf(struct sctp_inpcb *inp, } /* now what about the ep? */ if (stcb->asoc.smallest_mtu > nxtsz) { -#ifdef SCTP_PRINT_FOR_B_AND_M - SCTP_PRINTF("notify_mbuf (ICMP) calls sctp_pathmtu_adjust mtu:%d\n", - nxtsz); -#endif sctp_pathmtu_adjustment(inp, stcb, net, nxtsz); } if (tmr_stopped) @@ -3806,10 +3798,6 @@ sctp_setopt(struct socket *so, int optna if (paddrp->spp_pathmtu > SCTP_DEFAULT_MINSEGMENT) { net->mtu = paddrp->spp_pathmtu + ovh; if (net->mtu < stcb->asoc.smallest_mtu) { -#ifdef SCTP_PRINT_FOR_B_AND_M - SCTP_PRINTF("SCTP_PMTU_DISABLE calls sctp_pathmtu_adjustment:%d\n", - net->mtu); -#endif sctp_pathmtu_adjustment(inp, stcb, net, net->mtu); } } @@ -3854,10 +3842,6 @@ sctp_setopt(struct socket *so, int optna if (paddrp->spp_pathmtu > SCTP_DEFAULT_MINSEGMENT) { net->mtu = paddrp->spp_pathmtu + ovh; if (net->mtu < stcb->asoc.smallest_mtu) { -#ifdef SCTP_PRINT_FOR_B_AND_M - SCTP_PRINTF("SCTP_PMTU_DISABLE calls sctp_pathmtu_adjustment:%d\n", - net->mtu); -#endif sctp_pathmtu_adjustment(inp, stcb, net, net->mtu); } } Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Wed Sep 15 23:40:36 2010 (r212713) +++ head/sys/netinet/sctputil.c Wed Sep 15 23:56:25 2010 (r212714) @@ -1004,10 +1004,6 @@ sctp_init_asoc(struct sctp_inpcb *m, str asoc->peers_rwnd = SCTP_SB_LIMIT_RCV(m->sctp_socket); asoc->smallest_mtu = m->sctp_frag_point; -#ifdef SCTP_PRINT_FOR_B_AND_M - SCTP_PRINTF("smallest_mtu init'd with asoc to :%d\n", - asoc->smallest_mtu); -#endif asoc->minrto = m->sctp_ep.sctp_minrto; asoc->maxrto = m->sctp_ep.sctp_maxrto; @@ -2488,10 +2484,6 @@ sctp_mtu_size_reset(struct sctp_inpcb *i struct sctp_tmit_chunk *chk; unsigned int eff_mtu, ovh; -#ifdef SCTP_PRINT_FOR_B_AND_M - SCTP_PRINTF("sctp_mtu_size_reset(%p, asoc:%p mtu:%d\n", - inp, asoc, mtu); -#endif asoc->smallest_mtu = mtu; if (inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) { ovh = SCTP_MIN_OVERHEAD; From owner-svn-src-head@FreeBSD.ORG Thu Sep 16 00:22:25 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B71E106564A; Thu, 16 Sep 2010 00:22:25 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5894B8FC19; Thu, 16 Sep 2010 00:22:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8G0MPl0055541; Thu, 16 Sep 2010 00:22:25 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8G0MPr5055534; Thu, 16 Sep 2010 00:22:25 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201009160022.o8G0MPr5055534@svn.freebsd.org> From: Nathan Whitehorn Date: Thu, 16 Sep 2010 00:22:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212715 - in head/sys/powerpc: aim include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Sep 2010 00:22:25 -0000 Author: nwhitehorn Date: Thu Sep 16 00:22:25 2010 New Revision: 212715 URL: http://svn.freebsd.org/changeset/base/212715 Log: Replace the SLB backing store splay tree used on 64-bit PowerPC AIM hardware with a lockless sparse tree design. This marginally improves the performance of PMAP and allows copyin()/copyout() to run without acquiring locks when used on wired mappings. Submitted by: mdf Modified: head/sys/powerpc/aim/copyinout.c head/sys/powerpc/aim/mmu_oea64.c head/sys/powerpc/aim/slb.c head/sys/powerpc/aim/trap.c head/sys/powerpc/include/pcb.h head/sys/powerpc/include/pmap.h Modified: head/sys/powerpc/aim/copyinout.c ============================================================================== --- head/sys/powerpc/aim/copyinout.c Wed Sep 15 23:56:25 2010 (r212714) +++ head/sys/powerpc/aim/copyinout.c Thu Sep 16 00:22:25 2010 (r212715) @@ -80,16 +80,28 @@ int setfault(faultbuf); /* defined in lo static __inline void set_user_sr(pmap_t pm, const void *addr) { + struct slb *slb; register_t esid, vsid, slb1, slb2; esid = USER_ADDR >> ADDR_SR_SHFT; - PMAP_LOCK(pm); - vsid = va_to_vsid(pm, (vm_offset_t)addr); - PMAP_UNLOCK(pm); + + /* Try lockless look-up first */ + slb = user_va_to_slb_entry(pm, (vm_offset_t)addr); + + if (slb == NULL) { + /* If it isn't there, we need to pre-fault the VSID */ + PMAP_LOCK(pm); + vsid = va_to_vsid(pm, (vm_offset_t)addr); + PMAP_UNLOCK(pm); + } else { + vsid = slb->slbv >> SLBV_VSID_SHIFT; + } slb1 = vsid << SLBV_VSID_SHIFT; slb2 = (esid << SLBE_ESID_SHIFT) | SLBE_VALID | USER_SR; + curthread->td_pcb->pcb_cpu.aim.usr_segm = + (uintptr_t)addr >> ADDR_SR_SHFT; __asm __volatile ("slbie %0; slbmte %1, %2" :: "r"(esid << 28), "r"(slb1), "r"(slb2)); isync(); Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Wed Sep 15 23:56:25 2010 (r212714) +++ head/sys/powerpc/aim/mmu_oea64.c Thu Sep 16 00:22:25 2010 (r212715) @@ -2097,7 +2097,7 @@ moea64_pinit(mmu_t mmu, pmap_t pmap) { PMAP_LOCK_INIT(pmap); - SPLAY_INIT(&pmap->pm_slbtree); + pmap->pm_slb_tree_root = slb_alloc_tree(); pmap->pm_slb = slb_alloc_user_cache(); } #else @@ -2252,7 +2252,7 @@ moea64_release(mmu_t mmu, pmap_t pmap) * Free segment registers' VSIDs */ #ifdef __powerpc64__ - free_vsids(pmap); + slb_free_tree(pmap); slb_free_user_cache(pmap->pm_slb); #else KASSERT(pmap->pm_sr[0] != 0, ("moea64_release: pm_sr[0] = 0")); @@ -2622,18 +2622,25 @@ moea64_pvo_find_va(pmap_t pm, vm_offset_ int ptegidx; uint64_t vsid; #ifdef __powerpc64__ - struct slb slb; + uint64_t slbv; - /* The page is not mapped if the segment isn't */ - if (va_to_slb_entry(pm, va, &slb) != 0) - return NULL; + if (pm == kernel_pmap) { + slbv = kernel_va_to_slbv(va); + } else { + struct slb *slb; + slb = user_va_to_slb_entry(pm, va); + /* The page is not mapped if the segment isn't */ + if (slb == NULL) + return NULL; + slbv = slb->slbv; + } - vsid = (slb.slbv & SLBV_VSID_MASK) >> SLBV_VSID_SHIFT; - if (slb.slbv & SLBV_L) + vsid = (slbv & SLBV_VSID_MASK) >> SLBV_VSID_SHIFT; + if (slbv & SLBV_L) va &= ~moea64_large_page_mask; else va &= ~ADDR_POFF; - ptegidx = va_to_pteg(vsid, va, slb.slbv & SLBV_L); + ptegidx = va_to_pteg(vsid, va, slbv & SLBV_L); #else va &= ~ADDR_POFF; vsid = va_to_vsid(pm, va); Modified: head/sys/powerpc/aim/slb.c ============================================================================== --- head/sys/powerpc/aim/slb.c Wed Sep 15 23:56:25 2010 (r212714) +++ head/sys/powerpc/aim/slb.c Thu Sep 16 00:22:25 2010 (r212715) @@ -32,7 +32,6 @@ #include #include #include -#include #include #include @@ -45,65 +44,212 @@ uintptr_t moea64_get_unique_vsid(void); void moea64_release_vsid(uint64_t vsid); +static void slb_zone_init(void *); + +uma_zone_t slbt_zone; +uma_zone_t slb_cache_zone; -struct slbcontainer { - struct slb slb; - SPLAY_ENTRY(slbcontainer) slb_node; +SYSINIT(slb_zone_init, SI_SUB_KMEM, SI_ORDER_ANY, slb_zone_init, NULL); + +struct slbtnode { + uint16_t ua_alloc; + uint8_t ua_level; + /* Only 36 bits needed for full 64-bit address space. */ + uint64_t ua_base; + union { + struct slbtnode *ua_child[16]; + struct slb slb_entries[16]; + } u; }; -static int slb_compare(struct slbcontainer *a, struct slbcontainer *b); -static void slb_zone_init(void *); +/* + * For a full 64-bit address space, there are 36 bits in play in an + * esid, so 8 levels, with the leaf being at level 0. + * + * |3333|3322|2222|2222|1111|1111|11 | | | esid + * |5432|1098|7654|3210|9876|5432|1098|7654|3210| bits + * +----+----+----+----+----+----+----+----+----+-------- + * | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | level + */ +#define UAD_ROOT_LEVEL 8 +#define UAD_LEAF_LEVEL 0 + +static inline int +esid2idx(uint64_t esid, int level) +{ + int shift; -SPLAY_PROTOTYPE(slb_tree, slbcontainer, slb_node, slb_compare); -SPLAY_GENERATE(slb_tree, slbcontainer, slb_node, slb_compare); + shift = level * 4; + return ((esid >> shift) & 0xF); +} -uma_zone_t slb_zone; -uma_zone_t slb_cache_zone; +/* + * The ua_base field should have 0 bits after the first 4*(level+1) + * bits; i.e. only + */ +#define uad_baseok(ua) \ + (esid2base(ua->ua_base, ua->ua_level) == ua->ua_base) -SYSINIT(slb_zone_init, SI_SUB_KMEM, SI_ORDER_ANY, slb_zone_init, NULL); -int -va_to_slb_entry(pmap_t pm, vm_offset_t va, struct slb *slb) +static inline uint64_t +esid2base(uint64_t esid, int level) { - struct slbcontainer cont, *found; - uint64_t esid; + uint64_t mask; + int shift; - esid = (uintptr_t)va >> ADDR_SR_SHFT; - slb->slbe = (esid << SLBE_ESID_SHIFT) | SLBE_VALID; + shift = (level + 1) * 4; + mask = ~((1ULL << shift) - 1); + return (esid & mask); +} - if (pm == kernel_pmap) { - /* Set kernel VSID to deterministic value */ - slb->slbv = va_to_vsid(kernel_pmap, va) << SLBV_VSID_SHIFT; - - /* Figure out if this is a large-page mapping */ - if (hw_direct_map && va < VM_MIN_KERNEL_ADDRESS) { - /* - * XXX: If we have set up a direct map, assumes - * all physical memory is mapped with large pages. - */ - if (mem_valid(va, 0) == 0) - slb->slbv |= SLBV_L; - } - - return (0); - } +/* + * Allocate a new leaf node for the specified esid/vmhandle from the + * parent node. + */ +static struct slb * +make_new_leaf(uint64_t esid, uint64_t slbv, struct slbtnode *parent) +{ + struct slbtnode *child; + struct slb *retval; + int idx; + + idx = esid2idx(esid, parent->ua_level); + KASSERT(parent->u.ua_child[idx] == NULL, ("Child already exists!")); + + /* unlock and M_WAITOK and loop? */ + child = uma_zalloc(slbt_zone, M_NOWAIT | M_ZERO); + KASSERT(child != NULL, ("unhandled NULL case")); + + child->ua_level = UAD_LEAF_LEVEL; + child->ua_base = esid2base(esid, child->ua_level); + idx = esid2idx(esid, child->ua_level); + child->u.slb_entries[idx].slbv = slbv; + child->u.slb_entries[idx].slbe = (esid << SLBE_ESID_SHIFT) | SLBE_VALID; + setbit(&child->ua_alloc, idx); - PMAP_LOCK_ASSERT(pm, MA_OWNED); + retval = &child->u.slb_entries[idx]; + + /* + * The above stores must be visible before the next one, so + * that a lockless searcher always sees a valid path through + * the tree. + */ + powerpc_sync(); + + idx = esid2idx(esid, parent->ua_level); + parent->u.ua_child[idx] = child; + setbit(&parent->ua_alloc, idx); + + return (retval); +} + +/* + * Allocate a new intermediate node to fit between the parent and + * esid. + */ +static struct slbtnode* +make_intermediate(uint64_t esid, struct slbtnode *parent) +{ + struct slbtnode *child, *inter; + int idx, level; + + idx = esid2idx(esid, parent->ua_level); + child = parent->u.ua_child[idx]; + KASSERT(esid2base(esid, child->ua_level) != child->ua_base, + ("No need for an intermediate node?")); + + /* + * Find the level where the existing child and our new esid + * meet. It must be lower than parent->ua_level or we would + * have chosen a different index in parent. + */ + level = child->ua_level + 1; + while (esid2base(esid, level) != + esid2base(child->ua_base, level)) + level++; + KASSERT(level < parent->ua_level, + ("Found splitting level %d for %09jx and %09jx, " + "but it's the same as %p's", + level, esid, child->ua_base, parent)); + + /* unlock and M_WAITOK and loop? */ + inter = uma_zalloc(slbt_zone, M_NOWAIT | M_ZERO); + KASSERT(inter != NULL, ("unhandled NULL case")); + + /* Set up intermediate node to point to child ... */ + inter->ua_level = level; + inter->ua_base = esid2base(esid, inter->ua_level); + idx = esid2idx(child->ua_base, inter->ua_level); + inter->u.ua_child[idx] = child; + setbit(&inter->ua_alloc, idx); + powerpc_sync(); + + /* Set up parent to point to intermediate node ... */ + idx = esid2idx(inter->ua_base, parent->ua_level); + parent->u.ua_child[idx] = inter; + setbit(&parent->ua_alloc, idx); + + return (inter); +} + +uint64_t +kernel_va_to_slbv(vm_offset_t va) +{ + uint64_t esid, slbv; - cont.slb.slbe = slb->slbe; - found = SPLAY_FIND(slb_tree, &pm->pm_slbtree, &cont); + esid = (uintptr_t)va >> ADDR_SR_SHFT; - if (found == NULL) - return (-1); + /* Set kernel VSID to deterministic value */ + slbv = va_to_vsid(kernel_pmap, va) << SLBV_VSID_SHIFT; - slb->slbv = found->slb.slbv; - return (0); + /* Figure out if this is a large-page mapping */ + if (hw_direct_map && va < VM_MIN_KERNEL_ADDRESS) { + /* + * XXX: If we have set up a direct map, assumes + * all physical memory is mapped with large pages. + */ + if (mem_valid(va, 0) == 0) + slbv |= SLBV_L; + } + + return (slbv); +} + +struct slb * +user_va_to_slb_entry(pmap_t pm, vm_offset_t va) +{ + uint64_t esid = va >> ADDR_SR_SHFT; + struct slbtnode *ua; + int idx; + + ua = pm->pm_slb_tree_root; + + for (;;) { + KASSERT(uad_baseok(ua), ("uad base %016jx level %d bad!", + ua->ua_base, ua->ua_level)); + idx = esid2idx(esid, ua->ua_level); + + /* + * This code is specific to ppc64 where a load is + * atomic, so no need for atomic_load macro. + */ + if (ua->ua_level == UAD_LEAF_LEVEL) + return ((ua->u.slb_entries[idx].slbe & SLBE_VALID) ? + &ua->u.slb_entries[idx] : NULL); + + ua = ua->u.ua_child[idx]; + if (ua == NULL || + esid2base(esid, ua->ua_level) != ua->ua_base) + return (NULL); + } + + return (NULL); } uint64_t va_to_vsid(pmap_t pm, vm_offset_t va) { - struct slb entry; + struct slb *entry; /* Shortcut kernel case */ if (pm == kernel_pmap) @@ -114,56 +260,149 @@ va_to_vsid(pmap_t pm, vm_offset_t va) * to the PMAP's segment table. */ - if (va_to_slb_entry(pm, va, &entry) != 0) + entry = user_va_to_slb_entry(pm, va); + + if (entry == NULL) return (allocate_vsid(pm, (uintptr_t)va >> ADDR_SR_SHFT, 0)); - return ((entry.slbv & SLBV_VSID_MASK) >> SLBV_VSID_SHIFT); + return ((entry->slbv & SLBV_VSID_MASK) >> SLBV_VSID_SHIFT); } uint64_t allocate_vsid(pmap_t pm, uint64_t esid, int large) { - uint64_t vsid; - struct slbcontainer *slb_entry, kern_entry; - struct slb *prespill; - - prespill = NULL; - - if (pm == kernel_pmap) { - vsid = va_to_vsid(pm, esid << ADDR_SR_SHFT); - slb_entry = &kern_entry; - prespill = PCPU_GET(slb); - } else { - vsid = moea64_get_unique_vsid(); - slb_entry = uma_zalloc(slb_zone, M_NOWAIT); + uint64_t vsid, slbv; + struct slbtnode *ua, *next, *inter; + struct slb *slb; + int idx; - if (slb_entry == NULL) - panic("Could not allocate SLB mapping!"); - - prespill = pm->pm_slb; - } + KASSERT(pm != kernel_pmap, ("Attempting to allocate a kernel VSID")); - slb_entry->slb.slbe = (esid << SLBE_ESID_SHIFT) | SLBE_VALID; - slb_entry->slb.slbv = vsid << SLBV_VSID_SHIFT; + PMAP_LOCK_ASSERT(pm, MA_OWNED); + vsid = moea64_get_unique_vsid(); + slbv = vsid << SLBV_VSID_SHIFT; if (large) - slb_entry->slb.slbv |= SLBV_L; + slbv |= SLBV_L; + + ua = pm->pm_slb_tree_root; + + /* Descend to the correct leaf or NULL pointer. */ + for (;;) { + KASSERT(uad_baseok(ua), + ("uad base %09jx level %d bad!", ua->ua_base, ua->ua_level)); + idx = esid2idx(esid, ua->ua_level); + + if (ua->ua_level == UAD_LEAF_LEVEL) { + ua->u.slb_entries[idx].slbv = slbv; + eieio(); + ua->u.slb_entries[idx].slbe = (esid << SLBE_ESID_SHIFT) + | SLBE_VALID; + setbit(&ua->ua_alloc, idx); + slb = &ua->u.slb_entries[idx]; + break; + } + + next = ua->u.ua_child[idx]; + if (next == NULL) { + slb = make_new_leaf(esid, slbv, ua); + break; + } + + /* + * Check if the next item down has an okay ua_base. + * If not, we need to allocate an intermediate node. + */ + if (esid2base(esid, next->ua_level) != next->ua_base) { + inter = make_intermediate(esid, ua); + slb = make_new_leaf(esid, slbv, inter); + break; + } - if (pm != kernel_pmap) { - PMAP_LOCK_ASSERT(pm, MA_OWNED); - SPLAY_INSERT(slb_tree, &pm->pm_slbtree, slb_entry); + ua = next; } /* * Someone probably wants this soon, and it may be a wired * SLB mapping, so pre-spill this entry. */ - if (prespill != NULL) - slb_insert(pm, prespill, &slb_entry->slb); + eieio(); + slb_insert(pm, pm->pm_slb, slb); return (vsid); } +void +free_vsid(pmap_t pm, uint64_t esid, int large) +{ + struct slbtnode *ua; + int idx; + + PMAP_LOCK_ASSERT(pm, MA_OWNED); + + ua = pm->pm_slb_tree_root; + /* Descend to the correct leaf. */ + for (;;) { + KASSERT(uad_baseok(ua), + ("uad base %09jx level %d bad!", ua->ua_base, ua->ua_level)); + + idx = esid2idx(esid, ua->ua_level); + if (ua->ua_level == UAD_LEAF_LEVEL) { + ua->u.slb_entries[idx].slbv = 0; + eieio(); + ua->u.slb_entries[idx].slbe = 0; + clrbit(&ua->ua_alloc, idx); + return; + } + + ua = ua->u.ua_child[idx]; + if (ua == NULL || + esid2base(esid, ua->ua_level) != ua->ua_base) { + /* Perhaps just return instead of assert? */ + KASSERT(0, + ("Asked to remove an entry that was never inserted!")); + return; + } + } +} + +static void +free_slb_tree_node(struct slbtnode *ua) +{ + int idx; + + for (idx = 0; idx < 16; idx++) { + if (ua->ua_level != UAD_LEAF_LEVEL) { + if (ua->u.ua_child[idx] != NULL) + free_slb_tree_node(ua->u.ua_child[idx]); + } else { + if (ua->u.slb_entries[idx].slbv != 0) + moea64_release_vsid(ua->u.slb_entries[idx].slbv + >> SLBV_VSID_SHIFT); + } + } + + uma_zfree(slbt_zone, ua); +} + +void +slb_free_tree(pmap_t pm) +{ + + free_slb_tree_node(pm->pm_slb_tree_root); +} + +struct slbtnode * +slb_alloc_tree(void) +{ + struct slbtnode *root; + + root = uma_zalloc(slbt_zone, M_NOWAIT | M_ZERO); + root->ua_level = UAD_ROOT_LEVEL; + + return (root); +} + /* Lock entries mapping kernel text and stacks */ #define SLB_SPILLABLE(slbe) \ @@ -222,62 +461,12 @@ slb_insert(pmap_t pm, struct slb *slbcac critical_exit(); } -int -vsid_to_esid(pmap_t pm, uint64_t vsid, uint64_t *esid) -{ - uint64_t slbv; - struct slbcontainer *entry; - -#ifdef INVARIANTS - if (pm == kernel_pmap) - panic("vsid_to_esid only works on user pmaps"); - - PMAP_LOCK_ASSERT(pm, MA_OWNED); -#endif - - slbv = vsid << SLBV_VSID_SHIFT; - - SPLAY_FOREACH(entry, slb_tree, &pm->pm_slbtree) { - if (slbv == entry->slb.slbv) { - *esid = entry->slb.slbe >> SLBE_ESID_SHIFT; - return (0); - } - } - - return (-1); -} - -void -free_vsids(pmap_t pm) -{ - struct slbcontainer *entry; - - while (!SPLAY_EMPTY(&pm->pm_slbtree)) { - entry = SPLAY_MIN(slb_tree, &pm->pm_slbtree); - - SPLAY_REMOVE(slb_tree, &pm->pm_slbtree, entry); - - moea64_release_vsid(entry->slb.slbv >> SLBV_VSID_SHIFT); - uma_zfree(slb_zone, entry); - } -} - -static int -slb_compare(struct slbcontainer *a, struct slbcontainer *b) -{ - if (a->slb.slbe == b->slb.slbe) - return (0); - else if (a->slb.slbe < b->slb.slbe) - return (-1); - else - return (1); -} static void slb_zone_init(void *dummy) { - slb_zone = uma_zcreate("SLB segment", sizeof(struct slbcontainer), + slbt_zone = uma_zcreate("SLB tree node", sizeof(struct slbtnode), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_VM); slb_cache_zone = uma_zcreate("SLB cache", 64*sizeof(struct slb), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_VM); Modified: head/sys/powerpc/aim/trap.c ============================================================================== --- head/sys/powerpc/aim/trap.c Wed Sep 15 23:56:25 2010 (r212714) +++ head/sys/powerpc/aim/trap.c Thu Sep 16 00:22:25 2010 (r212715) @@ -445,33 +445,37 @@ syscall(struct trapframe *frame) static int handle_slb_spill(pmap_t pm, vm_offset_t addr) { - struct slb slb_entry; - int error, i; + struct slb kern_entry, *user_entry; + uint64_t esid; + int i; + + esid = (uintptr_t)addr >> ADDR_SR_SHFT; if (pm == kernel_pmap) { - error = va_to_slb_entry(pm, addr, &slb_entry); - if (error) - return (error); + kern_entry.slbv = kernel_va_to_slbv(addr); + kern_entry.slbe = (esid << SLBE_ESID_SHIFT) | SLBE_VALID; - slb_insert(pm, PCPU_GET(slb), &slb_entry); + slb_insert(pm, PCPU_GET(slb), &kern_entry); return (0); } PMAP_LOCK(pm); - error = va_to_slb_entry(pm, addr, &slb_entry); - if (error != 0) - (void)allocate_vsid(pm, (uintptr_t)addr >> ADDR_SR_SHFT, 0); - else { + user_entry = user_va_to_slb_entry(pm, addr); + + if (user_entry == NULL) { + /* allocate_vsid auto-spills it */ + (void)allocate_vsid(pm, esid, 0); + } else { /* * Check that another CPU has not already mapped this. * XXX: Per-thread SLB caches would be better. */ for (i = 0; i < 64; i++) - if (pm->pm_slb[i].slbe == (slb_entry.slbe | i)) + if (pm->pm_slb[i].slbe == (user_entry->slbe | i)) break; if (i == 64) - slb_insert(pm, pm->pm_slb, &slb_entry); + slb_insert(pm, pm->pm_slb, user_entry); } PMAP_UNLOCK(pm); @@ -513,19 +517,7 @@ trap_pfault(struct trapframe *frame, int map = &p->p_vmspace->vm_map; #ifdef __powerpc64__ - user_sr = 0; - __asm ("slbmfev %0, %1" - : "=r"(user_sr) - : "r"(USER_SR)); - - PMAP_LOCK(&p->p_vmspace->vm_pmap); - user_sr >>= SLBV_VSID_SHIFT; - rv = vsid_to_esid(&p->p_vmspace->vm_pmap, user_sr, - &user_sr); - PMAP_UNLOCK(&p->p_vmspace->vm_pmap); - - if (rv != 0) - return (SIGSEGV); + user_sr = td->td_pcb->pcb_cpu.aim.usr_segm; #else __asm ("mfsr %0, %1" : "=r"(user_sr) Modified: head/sys/powerpc/include/pcb.h ============================================================================== --- head/sys/powerpc/include/pcb.h Wed Sep 15 23:56:25 2010 (r212714) +++ head/sys/powerpc/include/pcb.h Thu Sep 16 00:22:25 2010 (r212715) @@ -66,6 +66,7 @@ struct pcb { union { struct { + vm_offset_t usr_segm; /* Base address */ register_t usr_esid; /* USER_SR segment */ register_t usr_vsid; /* USER_SR segment */ } aim; Modified: head/sys/powerpc/include/pmap.h ============================================================================== --- head/sys/powerpc/include/pmap.h Wed Sep 15 23:56:25 2010 (r212714) +++ head/sys/powerpc/include/pmap.h Thu Sep 16 00:22:25 2010 (r212715) @@ -86,15 +86,13 @@ struct pmap_md { #define NPMAPS 32768 #endif /* !defined(NPMAPS) */ -struct slbcontainer; - -SPLAY_HEAD(slb_tree, slbcontainer); +struct slbtnode; struct pmap { struct mtx pm_mtx; #ifdef __powerpc64__ - struct slb_tree pm_slbtree; + struct slbtnode *pm_slb_tree_root; struct slb *pm_slb; #else register_t pm_sr[16]; @@ -139,12 +137,17 @@ struct md_page { * NB: The PMAP MUST be locked already. */ uint64_t va_to_vsid(pmap_t pm, vm_offset_t va); -int va_to_slb_entry(pmap_t pm, vm_offset_t va, struct slb *); + +/* Lock-free, non-allocating lookup routines */ +uint64_t kernel_va_to_slbv(vm_offset_t va); +struct slb *user_va_to_slb_entry(pmap_t pm, vm_offset_t va); uint64_t allocate_vsid(pmap_t pm, uint64_t esid, int large); -void slb_insert(pmap_t pm, struct slb *dst, struct slb *); -int vsid_to_esid(pmap_t pm, uint64_t vsid, uint64_t *esid); -void free_vsids(pmap_t pm); +void free_vsid(pmap_t pm, uint64_t esid, int large); +void slb_insert(pmap_t pm, struct slb *dst, struct slb *); + +struct slbtnode *slb_alloc_tree(void); +void slb_free_tree(pmap_t pm); struct slb *slb_alloc_user_cache(void); void slb_free_user_cache(struct slb *); From owner-svn-src-head@FreeBSD.ORG Thu Sep 16 01:43:55 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AB6201065679; Thu, 16 Sep 2010 01:43:55 +0000 (UTC) (envelope-from davidxu@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 7D83B8FC0C; Thu, 16 Sep 2010 01:43:55 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o8G1hrU1004987; Thu, 16 Sep 2010 01:43:54 GMT (envelope-from davidxu@freebsd.org) Message-ID: <4C91E6DA.8050907@freebsd.org> Date: Thu, 16 Sep 2010 09:43:54 +0000 From: David Xu User-Agent: Thunderbird 2.0.0.24 (X11/20100630) MIME-Version: 1.0 To: "M. Warner Losh" References: <201009150256.o8F2uXwX004579@svn.freebsd.org> <20100914231728.33ca7466@kan.dnsalias.net> <20100915.081234.83306312380114674.imp@bsdimp.com> In-Reply-To: <20100915.081234.83306312380114674.imp@bsdimp.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, kabaev@gmail.com Subject: Re: svn commit: r212630 - in head/lib/libthr: . thread X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Sep 2010 01:43:55 -0000 M. Warner Losh wrote: > In message: <20100914231728.33ca7466@kan.dnsalias.net> > Alexander Kabaev writes: > : On Wed, 15 Sep 2010 02:56:33 +0000 (UTC) > : David Xu wrote: > : > : > Author: davidxu > : > Date: Wed Sep 15 02:56:32 2010 > : > New Revision: 212630 > : > URL: http://svn.freebsd.org/changeset/base/212630 > : > > : > Log: > : > add code to support stack unwinding when thread exits. note that > : > only defer-mode cancellation works, asynchrnous mode does not work > : > because it lacks of libuwind's support. stack unwinding is not > : > enabled unless LIBTHR_UNWIND_STACK is defined in Makefile. > : > > : > Modified: > : > head/lib/libthr/Makefile > : > head/lib/libthr/thread/thr_clean.c > : > head/lib/libthr/thread/thr_create.c > : > head/lib/libthr/thread/thr_exit.c > : > head/lib/libthr/thread/thr_init.c > : > head/lib/libthr/thread/thr_private.h > : > > : > Modified: head/lib/libthr/Makefile > : > ============================================================================== > : > --- head/lib/libthr/Makefile Wed Sep 15 01:21:30 2010 > : > (r212629) +++ head/lib/libthr/Makefile Wed Sep 15 02:56:32 > : > 2010 (r212630) @@ -25,6 +25,14 @@ > : > CFLAGS+=-I${.CURDIR}/../../libexec/rtld- > : > CFLAGS+=-I${.CURDIR}/../../libexec/rtld-elf/${MACHINE_CPUARCH} > : > CFLAGS+=-I${.CURDIR}/../libthread_db CFLAGS+=-Winline > : > + > : > +LIBTHR_UNWIND_STACK=yes > : > + > : > +.ifdef LIBTHR_UNWIND_STACK > : > +CFLAGS+=-I${.CURDIR}/../../contrib/gcc -fexceptions > : > +CFLAGS+=-D_PTHREAD_FORCED_UNWIND > : > +.endif > : > + > : > > : > : Reaching into bowels of GCC like that is never good. > > Would this pulling in GPL'd code? > > Warner > It's being resolved. From owner-svn-src-head@FreeBSD.ORG Thu Sep 16 02:59:26 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 108401065670; Thu, 16 Sep 2010 02:59:26 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D97418FC17; Thu, 16 Sep 2010 02:59:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8G2xPs3058966; Thu, 16 Sep 2010 02:59:25 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8G2xPMJ058964; Thu, 16 Sep 2010 02:59:25 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201009160259.o8G2xPMJ058964@svn.freebsd.org> From: Alexander Motin Date: Thu, 16 Sep 2010 02:59:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212721 - head/sys/x86/cpufreq X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Sep 2010 02:59:26 -0000 Author: mav Date: Thu Sep 16 02:59:25 2010 New Revision: 212721 URL: http://svn.freebsd.org/changeset/base/212721 Log: Few whitespace cleanups and comments tunings. Submitted by: arundel Modified: head/sys/x86/cpufreq/est.c Modified: head/sys/x86/cpufreq/est.c ============================================================================== --- head/sys/x86/cpufreq/est.c Thu Sep 16 02:47:09 2010 (r212720) +++ head/sys/x86/cpufreq/est.c Thu Sep 16 02:59:25 2010 (r212721) @@ -110,14 +110,16 @@ CTASSERT(EST_MAX_SETTINGS <= MAX_SETTING #define EST_TRANS_LAT 1000 /* - * Frequency (MHz) and voltage (mV) settings. Data from the - * Intel Pentium M Processor Datasheet (Order Number 252612), Table 5. + * Frequency (MHz) and voltage (mV) settings. * * Dothan processors have multiple VID#s with different settings for * each VID#. Since we can't uniquely identify this info * without undisclosed methods from Intel, we can't support newer * processors with this table method. If ACPI Px states are supported, * we get info from them. + * + * Data from the "Intel Pentium M Processor Datasheet", + * Order Number 252612-003, Table 5. */ static freq_info PM17_130[] = { /* 130nm 1.70GHz Pentium M */ @@ -217,7 +219,7 @@ static freq_info PM10_ULV_130[] = { /* * Data from "Intel Pentium M Processor on 90nm Process with - * 2-MB L2 Cache Datasheet", Order Number 302189, Table 5. + * 2-MB L2 Cache Datasheet", Order Number 302189-008, Table 5. */ static freq_info PM_765A_90[] = { /* 90 nm 2.10GHz Pentium M, VID #A */ @@ -985,7 +987,7 @@ est_probe(device_t dev) device_t perf_dev; uint64_t msr; int error, type; - + if (resource_disabled("est", 0)) return (ENXIO); @@ -1125,7 +1127,7 @@ est_acpi_info(device_t dev, freq_info ** if (sets[i].freq > 0) { error = est_set_id16(dev, sets[i].spec[0], strict); if (error != 0) { - if (bootverbose) + if (bootverbose) device_printf(dev, "Invalid freq %u, " "ignored.\n", sets[i].freq); continue; @@ -1221,7 +1223,7 @@ est_msr_info(device_t dev, uint64_t msr, device_printf(dev, "Guessed bus clock (low) of %d MHz\n", bus); if (!bus_speed_ok(bus)) return (EOPNOTSUPP); - + /* Calculate high frequency. */ id = msr >> 32; freq = ((id >> 8) & 0xff) * bus; @@ -1282,14 +1284,14 @@ est_set_id16(device_t dev, uint16_t id16 msr = rdmsr(MSR_PERF_CTL); msr = (msr & ~0xffff) | id16; wrmsr(MSR_PERF_CTL, msr); - + /* Wait a short while for the new setting. XXX Is this necessary? */ DELAY(EST_TRANS_LAT); - + if (need_check) { - est_get_id16(&new_id16); + est_get_id16(&new_id16); if (new_id16 != id16) { - if (bootverbose) + if (bootverbose) device_printf(dev, "Invalid id16 (set, cur) " "= (%u, %u)\n", id16, new_id16); ret = ENXIO; From owner-svn-src-head@FreeBSD.ORG Thu Sep 16 03:46:18 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D2DE106564A; Thu, 16 Sep 2010 03:46:18 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3AA3A8FC0A; Thu, 16 Sep 2010 03:46:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8G3kIUD060157; Thu, 16 Sep 2010 03:46:18 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8G3kIFt060149; Thu, 16 Sep 2010 03:46:18 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201009160346.o8G3kIFt060149@svn.freebsd.org> From: Nathan Whitehorn Date: Thu, 16 Sep 2010 03:46:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212722 - in head/sys/powerpc: aim include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Sep 2010 03:46:18 -0000 Author: nwhitehorn Date: Thu Sep 16 03:46:17 2010 New Revision: 212722 URL: http://svn.freebsd.org/changeset/base/212722 Log: Split the SLB mirror cache into two kinds of object, one for kernel maps which are similar to the previous ones, and one for user maps, which are arrays of pointers into the SLB tree. This changes makes user SLB updates atomic, closing a window for memory corruption. While here, rearrange the allocation functions to make context switches faster. Modified: head/sys/powerpc/aim/mmu_oea64.c head/sys/powerpc/aim/slb.c head/sys/powerpc/aim/trap.c head/sys/powerpc/aim/trap_subr64.S head/sys/powerpc/include/pcpu.h head/sys/powerpc/include/pmap.h head/sys/powerpc/include/sr.h Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Thu Sep 16 02:59:25 2010 (r212721) +++ head/sys/powerpc/aim/mmu_oea64.c Thu Sep 16 03:46:17 2010 (r212722) @@ -838,7 +838,7 @@ moea64_bootstrap_slb_prefault(vm_offset_ if (large) entry.slbv |= SLBV_L; - slb_insert(kernel_pmap, cache, &entry); + slb_insert_kernel(entry.slbe, entry.slbv); } #endif @@ -2099,6 +2099,7 @@ moea64_pinit(mmu_t mmu, pmap_t pmap) pmap->pm_slb_tree_root = slb_alloc_tree(); pmap->pm_slb = slb_alloc_user_cache(); + pmap->pm_slb_len = 0; } #else void Modified: head/sys/powerpc/aim/slb.c ============================================================================== --- head/sys/powerpc/aim/slb.c Thu Sep 16 02:59:25 2010 (r212721) +++ head/sys/powerpc/aim/slb.c Thu Sep 16 03:46:17 2010 (r212722) @@ -263,13 +263,14 @@ va_to_vsid(pmap_t pm, vm_offset_t va) entry = user_va_to_slb_entry(pm, va); if (entry == NULL) - return (allocate_vsid(pm, (uintptr_t)va >> ADDR_SR_SHFT, 0)); + return (allocate_user_vsid(pm, + (uintptr_t)va >> ADDR_SR_SHFT, 0)); return ((entry->slbv & SLBV_VSID_MASK) >> SLBV_VSID_SHIFT); } uint64_t -allocate_vsid(pmap_t pm, uint64_t esid, int large) +allocate_user_vsid(pmap_t pm, uint64_t esid, int large) { uint64_t vsid, slbv; struct slbtnode *ua, *next, *inter; @@ -327,7 +328,7 @@ allocate_vsid(pmap_t pm, uint64_t esid, * SLB mapping, so pre-spill this entry. */ eieio(); - slb_insert(pm, pm->pm_slb, slb); + slb_insert_user(pm, slb); return (vsid); } @@ -410,57 +411,68 @@ slb_alloc_tree(void) (slbe & SLBE_ESID_MASK) > 16*SEGMENT_LENGTH) || \ (slbe & SLBE_ESID_MASK) > VM_MAX_KERNEL_ADDRESS) void -slb_insert(pmap_t pm, struct slb *slbcache, struct slb *slb_entry) +slb_insert_kernel(uint64_t slbe, uint64_t slbv) { - uint64_t slbe, slbv; - int i, j, to_spill; + struct slb *slbcache; + int i, j; /* We don't want to be preempted while modifying the kernel map */ critical_enter(); - to_spill = -1; - slbv = slb_entry->slbv; - slbe = slb_entry->slbe; + slbcache = PCPU_GET(slb); - /* Hunt for a likely candidate */ + /* Check for an unused slot, abusing the USER_SR slot as a full flag */ + if (slbcache[USER_SR].slbe == 0) { + for (i = 0; i < USER_SR; i++) { + if (!(slbcache[i].slbe & SLBE_VALID)) + goto fillkernslb; + } + + if (i == USER_SR) + slbcache[USER_SR].slbe = 1; + } for (i = mftb() % 64, j = 0; j < 64; j++, i = (i+1) % 64) { - if (pm == kernel_pmap && i == USER_SR) - continue; + if (i == USER_SR) + continue; - if (!(slbcache[i].slbe & SLBE_VALID)) { - to_spill = i; + if (SLB_SPILLABLE(slbcache[i].slbe)) break; - } - - if (to_spill < 0 && (pm != kernel_pmap || - SLB_SPILLABLE(slbcache[i].slbe))) - to_spill = i; - } - - if (to_spill < 0) - panic("SLB spill on ESID %#lx, but no available candidates!\n", - (slbe & SLBE_ESID_MASK) >> SLBE_ESID_SHIFT); - - if (slbcache[to_spill].slbe & SLBE_VALID) { - /* Invalidate this first to avoid races */ - slbcache[to_spill].slbe = 0; - mb(); } - slbcache[to_spill].slbv = slbv; - slbcache[to_spill].slbe = slbe | (uint64_t)to_spill; + + KASSERT(j < 64, ("All kernel SLB slots locked!")); + +fillkernslb: + slbcache[i].slbv = slbv; + slbcache[i].slbe = slbe | (uint64_t)i; /* If it is for this CPU, put it in the SLB right away */ - if (pm == kernel_pmap && pmap_bootstrapped) { + if (pmap_bootstrapped) { /* slbie not required */ __asm __volatile ("slbmte %0, %1" :: - "r"(slbcache[to_spill].slbv), - "r"(slbcache[to_spill].slbe)); + "r"(slbcache[i].slbv), "r"(slbcache[i].slbe)); } critical_exit(); } +void +slb_insert_user(pmap_t pm, struct slb *slb) +{ + int i; + + PMAP_LOCK_ASSERT(pm, MA_OWNED); + + if (pm->pm_slb_len < 64) { + i = pm->pm_slb_len; + pm->pm_slb_len++; + } else { + i = mftb() % 64; + } + + /* Note that this replacement is atomic with respect to trap_subr */ + pm->pm_slb[i] = slb; +} static void slb_zone_init(void *dummy) @@ -468,18 +480,18 @@ slb_zone_init(void *dummy) slbt_zone = uma_zcreate("SLB tree node", sizeof(struct slbtnode), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_VM); - slb_cache_zone = uma_zcreate("SLB cache", 64*sizeof(struct slb), + slb_cache_zone = uma_zcreate("SLB cache", 64*sizeof(struct slb *), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_VM); } -struct slb * +struct slb ** slb_alloc_user_cache(void) { return (uma_zalloc(slb_cache_zone, M_ZERO)); } void -slb_free_user_cache(struct slb *slb) +slb_free_user_cache(struct slb **slb) { uma_zfree(slb_cache_zone, slb); } Modified: head/sys/powerpc/aim/trap.c ============================================================================== --- head/sys/powerpc/aim/trap.c Thu Sep 16 02:59:25 2010 (r212721) +++ head/sys/powerpc/aim/trap.c Thu Sep 16 03:46:17 2010 (r212722) @@ -445,17 +445,15 @@ syscall(struct trapframe *frame) static int handle_slb_spill(pmap_t pm, vm_offset_t addr) { - struct slb kern_entry, *user_entry; + struct slb *user_entry; uint64_t esid; int i; esid = (uintptr_t)addr >> ADDR_SR_SHFT; if (pm == kernel_pmap) { - kern_entry.slbv = kernel_va_to_slbv(addr); - kern_entry.slbe = (esid << SLBE_ESID_SHIFT) | SLBE_VALID; - - slb_insert(pm, PCPU_GET(slb), &kern_entry); + slb_insert_kernel((esid << SLBE_ESID_SHIFT) | SLBE_VALID, + kernel_va_to_slbv(addr)); return (0); } @@ -464,18 +462,18 @@ handle_slb_spill(pmap_t pm, vm_offset_t if (user_entry == NULL) { /* allocate_vsid auto-spills it */ - (void)allocate_vsid(pm, esid, 0); + (void)allocate_user_vsid(pm, esid, 0); } else { /* * Check that another CPU has not already mapped this. * XXX: Per-thread SLB caches would be better. */ - for (i = 0; i < 64; i++) - if (pm->pm_slb[i].slbe == (user_entry->slbe | i)) + for (i = 0; i < pm->pm_slb_len; i++) + if (pm->pm_slb[i] == user_entry) break; - if (i == 64) - slb_insert(pm, pm->pm_slb, user_entry); + if (i == pm->pm_slb_len) + slb_insert_user(pm, user_entry); } PMAP_UNLOCK(pm); Modified: head/sys/powerpc/aim/trap_subr64.S ============================================================================== --- head/sys/powerpc/aim/trap_subr64.S Thu Sep 16 02:59:25 2010 (r212721) +++ head/sys/powerpc/aim/trap_subr64.S Thu Sep 16 03:46:17 2010 (r212722) @@ -49,45 +49,59 @@ * Requires that r28-r31 be scratch, with r28 initialized to the SLB cache */ -restoresrs: +/* + * User SRs are loaded through a pointer to the current pmap. + */ +restore_usersrs: + GET_CPUINFO(%r28); + ld %r28,PC_USERSLB(%r28); li %r29, 0 /* Set the counter to zero */ slbia slbmfee %r31,%r29 clrrdi %r31,%r31,28 slbie %r31 -instslb: - ld %r31, 8(%r28); /* Load SLBE */ - - cmpli 0, %r31, 0; /* If SLBE is not valid, get the next */ - beq nslb; - - ld %r30, 0(%r28) /* Load SLBV */ +instuserslb: + ld %r31, 0(%r28); /* Load SLB entry pointer */ + cmpli 0, %r31, 0; /* If NULL, stop */ + beqlr; + + ld %r30, 0(%r31) /* Load SLBV */ + ld %r31, 8(%r31) /* Load SLBE */ + or %r31, %r31, %r29 /* Set SLBE slot */ slbmte %r30, %r31; /* Install SLB entry */ -nslb: - addi %r28, %r28, 16; /* Advance */ + addi %r28, %r28, 8; /* Advance pointer */ addi %r29, %r29, 1; cmpli 0, %r29, 64; /* Repeat if we are not at the end */ - blt instslb; - + blt instuserslb; blr; /* - * User SRs are loaded through a pointer to the current pmap. + * Kernel SRs are loaded directly from the PCPU fields */ -#define RESTORE_USER_SRS() \ - GET_CPUINFO(%r28); \ - ld %r28,PC_USERSLB(%r28); \ - bl restoresrs; +restore_kernsrs: + GET_CPUINFO(%r28); + addi %r28,%r28,PC_KERNSLB; + li %r29, 0 /* Set the counter to zero */ -/* - * Kernel SRs are loaded directly from kernel_pmap_ - */ -#define RESTORE_KERN_SRS() \ - GET_CPUINFO(%r28); \ - addi %r28,%r28,PC_KERNSLB; \ - bl restoresrs; + slbia + slbmfee %r31,%r29 + clrrdi %r31,%r31,28 + slbie %r31 +instkernslb: + ld %r31, 8(%r28); /* Load SLBE */ + + cmpli 0, %r31, 0; /* If SLBE is not valid, stop */ + beqlr; + ld %r30, 0(%r28) /* Load SLBV */ + slbmte %r30, %r31; /* Install SLB entry */ + + addi %r28, %r28, 16; /* Advance pointer */ + addi %r29, %r29, 1; + cmpli 0, %r29, USER_SR; /* Repeat if we are not at the end */ + blt instkernslb; + blr; /* * FRAME_SETUP assumes: @@ -237,7 +251,7 @@ nslb: std %r30,(savearea+CPUSAVE_R30)(%r3); \ std %r31,(savearea+CPUSAVE_R31)(%r3); \ mflr %r27; /* preserve LR */ \ - RESTORE_USER_SRS(); /* uses r28-r31 */ \ + bl restore_usersrs; /* uses r28-r31 */ \ mtlr %r27; \ ld %r31,(savearea+CPUSAVE_R31)(%r3); \ ld %r30,(savearea+CPUSAVE_R30)(%r3); \ @@ -432,7 +446,7 @@ realtrap: ld %r1,PC_CURPCB(%r1) mr %r27,%r28 /* Save LR, r29 */ mtsprg2 %r29 - RESTORE_KERN_SRS() /* enable kernel mapping */ + bl restore_kernsrs /* enable kernel mapping */ mfsprg2 %r29 mr %r28,%r27 ba s_trap @@ -482,7 +496,7 @@ u_trap: ld %r1,PC_CURPCB(%r1) mr %r27,%r28 /* Save LR, r29 */ mtsprg2 %r29 - RESTORE_KERN_SRS() /* enable kernel mapping */ + bl restore_kernsrs /* enable kernel mapping */ mfsprg2 %r29 mr %r28,%r27 Modified: head/sys/powerpc/include/pcpu.h ============================================================================== --- head/sys/powerpc/include/pcpu.h Thu Sep 16 02:59:25 2010 (r212721) +++ head/sys/powerpc/include/pcpu.h Thu Sep 16 03:46:17 2010 (r212722) @@ -55,7 +55,7 @@ struct pmap; #define PCPU_MD_AIM64_FIELDS \ struct slb pc_slb[64]; \ - struct slb *pc_userslb; + struct slb **pc_userslb; #ifdef __powerpc64__ #define PCPU_MD_AIM_FIELDS PCPU_MD_AIM64_FIELDS Modified: head/sys/powerpc/include/pmap.h ============================================================================== --- head/sys/powerpc/include/pmap.h Thu Sep 16 02:59:25 2010 (r212721) +++ head/sys/powerpc/include/pmap.h Thu Sep 16 03:46:17 2010 (r212722) @@ -93,7 +93,8 @@ struct pmap { #ifdef __powerpc64__ struct slbtnode *pm_slb_tree_root; - struct slb *pm_slb; + struct slb **pm_slb; + int pm_slb_len; #else register_t pm_sr[16]; #endif @@ -142,14 +143,15 @@ uint64_t va_to_vsid(pmap_t pm, vm_offset uint64_t kernel_va_to_slbv(vm_offset_t va); struct slb *user_va_to_slb_entry(pmap_t pm, vm_offset_t va); -uint64_t allocate_vsid(pmap_t pm, uint64_t esid, int large); +uint64_t allocate_user_vsid(pmap_t pm, uint64_t esid, int large); void free_vsid(pmap_t pm, uint64_t esid, int large); -void slb_insert(pmap_t pm, struct slb *dst, struct slb *); +void slb_insert_user(pmap_t pm, struct slb *slb); +void slb_insert_kernel(uint64_t slbe, uint64_t slbv); struct slbtnode *slb_alloc_tree(void); void slb_free_tree(pmap_t pm); -struct slb *slb_alloc_user_cache(void); -void slb_free_user_cache(struct slb *); +struct slb **slb_alloc_user_cache(void); +void slb_free_user_cache(struct slb **); #else Modified: head/sys/powerpc/include/sr.h ============================================================================== --- head/sys/powerpc/include/sr.h Thu Sep 16 02:59:25 2010 (r212721) +++ head/sys/powerpc/include/sr.h Thu Sep 16 03:46:17 2010 (r212722) @@ -42,7 +42,11 @@ #define SR_VSID_MASK 0x00ffffff /* Virtual Segment ID mask */ /* Kernel segment register usage */ +#ifdef __powerpc64__ +#define USER_SR 63 +#else #define USER_SR 12 +#endif #define KERNEL_SR 13 #define KERNEL2_SR 14 #define KERNEL3_SR 15 From owner-svn-src-head@FreeBSD.ORG Thu Sep 16 05:20:05 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 09ECB106567A; Thu, 16 Sep 2010 05:20:05 +0000 (UTC) (envelope-from cvs-src@yandex.ru) Received: from forward15.mail.yandex.net (forward15.mail.yandex.net [95.108.130.119]) by mx1.freebsd.org (Postfix) with ESMTP id A97478FC14; Thu, 16 Sep 2010 05:20:04 +0000 (UTC) Received: from smtp11.mail.yandex.net (smtp11.mail.yandex.net [95.108.130.67]) by forward15.mail.yandex.net (Yandex) with ESMTP id 783B4445988F; Thu, 16 Sep 2010 09:02:23 +0400 (MSD) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1284613343; bh=9FublKDCjfboOK4so1QQwvuwr+UtW/Lr36nCYVZpAZw=; h=Message-ID:Date:From:MIME-Version:To:CC:Subject:References: In-Reply-To:Content-Type:Content-Transfer-Encoding; b=EpyLdVzPqXfnmp2abX2HNLrASuaM6dEwBfn0DFZ6+fD5OQCojyVYWKYZKV1m2Y9lF 03wqmeu+u5fjMVwj9ohw3u1Ofbb495/moFnkBR4nRGBtdJSYFBExgNLQaQRgRzW/2P 7zksAl6NiIK3tTOiJ0jeqfj7lD/Zc3JtKuAUljyk= Received: from smeshariki2.local (unknown [77.66.145.223]) by smtp11.mail.yandex.net (Yandex) with ESMTPSA id 9D8CA44D806C; Thu, 16 Sep 2010 09:02:22 +0400 (MSD) Message-ID: <4C91A46D.1060903@yandex.ru> Date: Thu, 16 Sep 2010 09:00:29 +0400 From: Ruslan Mahmatkhanov User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; ru-RU; rv:1.9.2.9) Gecko/20100908 Thunderbird/3.1.3 MIME-Version: 1.0 To: Warner Losh References: <201009151940.o8FJe97W048405@svn.freebsd.org> In-Reply-To: <201009151940.o8FJe97W048405@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Yandex-TimeMark: 1284613343 X-Yandex-Spam: 1 X-Yandex-Front: smtp11.mail.yandex.net Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r212692 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Sep 2010 05:20:05 -0000 15.09.2010 23:40, Warner Losh пишет: > Author: imp > Date: Wed Sep 15 19:40:08 2010 > New Revision: 212692 > URL: http://svn.freebsd.org/changeset/base/212692 > > Log: > Don't suggest using bwn for the bcm4306 cards in the list. The > bcm4306 cards are ambiguous. BCM4306 rev 2 requires bwi. BCM4306 rev > 3 will work with either. Since we can't easily determine which is > which, just remove them. > > Modified: > head/share/man/man4/bwn.4 > > Modified: head/share/man/man4/bwn.4 > ============================================================================== > --- head/share/man/man4/bwn.4 Wed Sep 15 19:34:18 2010 (r212691) > +++ head/share/man/man4/bwn.4 Wed Sep 15 19:40:08 2010 (r212692) > @@ -78,18 +78,14 @@ driver supports Broadcom BCM43xx based w > .Pp > .Bl -column -compact "Apple Airport Extreme" "BCM4306" "Mini PCI" "a/b/g" -offset 6n > .It Em "Card Chip Bus Standard" > -.It "Apple Airport Extreme BCM4306 PCI b/g" > .It "Apple Airport Extreme BCM4318 PCI b/g" > .It "ASUS WL-138g BCM4318 PCI b/g" > .It "Buffalo WLI-CB-G54S BCM4318 CardBus b/g" > -.It "Buffalo WLI-PCI-G54S BCM4306 PCI b/g" > -.It "Compaq R4035 onboard BCM4306 PCI b/g" > .It "Dell Wireless 1470 BCM4318 Mini PCI b/g" > .It "Dell Truemobile 1400 BCM4309 Mini PCI b/g" > .It "HP nx6125 BCM4319 PCI b/g" > .It "Linksys WPC54G Ver 3 BCM4318 CardBus b/g" > .It "Linksys WPC54GS Ver 2 BCM4318 CardBus b/g" > -.It "TRENDnet TEW-401PCplus BCM4306 CardBus b/g" > .It "US Robotics 5411 BCM4318 CardBus b/g" > .El > .Pp I don't know if you are trying to keep this list exhaustive, but if you do this card is working for me with success: siba_bwn0@pci0:16:0:0: class=0x028000 card=0x1364103c chip=0x431114e4 rev=0x01 hdr=0x00 vendor = 'Broadcom Corporation' device = 'Broadcom Corporation Dell Wireless 1390 WLAN Mini-PCI Card (BCM4311)' class = network -- Regards, Ruslan From owner-svn-src-head@FreeBSD.ORG Thu Sep 16 07:56:35 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 361D6106564A; Thu, 16 Sep 2010 07:56:35 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2677F8FC14; Thu, 16 Sep 2010 07:56:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8G7uZCc065334; Thu, 16 Sep 2010 07:56:35 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8G7uZrg065332; Thu, 16 Sep 2010 07:56:35 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201009160756.o8G7uZrg065332@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Thu, 16 Sep 2010 07:56:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212723 - head/sys/compat/linprocfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Sep 2010 07:56:35 -0000 Author: des Date: Thu Sep 16 07:56:34 2010 New Revision: 212723 URL: http://svn.freebsd.org/changeset/base/212723 Log: Implement proc/$$/environment. Submitted by: Fernando Apesteguía MFC after: 3 weeks Modified: head/sys/compat/linprocfs/linprocfs.c Modified: head/sys/compat/linprocfs/linprocfs.c ============================================================================== --- head/sys/compat/linprocfs/linprocfs.c Thu Sep 16 03:46:17 2010 (r212722) +++ head/sys/compat/linprocfs/linprocfs.c Thu Sep 16 07:56:34 2010 (r212723) @@ -939,15 +939,123 @@ linprocfs_doproccmdline(PFS_FILL_ARGS) return (0); } +extern int proc_rwmem(struct proc *p, struct uio *uio); + +#define MAX_ARGV_STR 512 /* Max number of argv-like strings */ +#define UIO_CHUNK_SZ 256 /* Max chunk size (bytes) for uiomove */ + +static int +linprocfs_doargv(struct thread *td, struct proc *p, struct sbuf *sb, + void (*resolver)(const struct ps_strings, u_long *, int *)) +{ + struct iovec iov; + struct uio tmp_uio; + struct ps_strings pss; + int ret, i, n_elements, found_end; + u_long addr; + char* env_vector[MAX_ARGV_STR]; + char env_string[UIO_CHUNK_SZ]; + char *pbegin; + + + +#define UIO_HELPER(uio, iov, base, len, cnt, offset, sz, flg, rw, td) \ +do { \ + iov.iov_base = (caddr_t)(base); \ + iov.iov_len = (len); \ + uio.uio_iov = &(iov); \ + uio.uio_iovcnt = (cnt); \ + uio.uio_offset = (off_t)(offset); \ + uio.uio_resid = (sz); \ + uio.uio_segflg = (flg); \ + uio.uio_rw = (rw); \ + uio.uio_td = (td); \ +} while (0) + + UIO_HELPER(tmp_uio, iov, &pss, sizeof(struct ps_strings), 1, + (off_t)(p->p_sysent->sv_psstrings), sizeof(struct ps_strings), + UIO_SYSSPACE, UIO_READ, td); + + ret = proc_rwmem(p, &tmp_uio); + if (ret != 0) + return ret; + + /* Get the array address and the number of elements */ + resolver(pss, &addr, &n_elements); + + /* Consistent with lib/libkvm/kvm_proc.c */ + if (n_elements > MAX_ARGV_STR || (u_long)addr < VM_MIN_ADDRESS || + (u_long)addr >= VM_MAXUSER_ADDRESS) { + /* What error code should we return? */ + return 0; + } + + UIO_HELPER(tmp_uio, iov, env_vector, MAX_ARGV_STR, 1, + (vm_offset_t)(addr), iov.iov_len, UIO_SYSSPACE, UIO_READ, td); + + ret = proc_rwmem(p, &tmp_uio); + if (ret != 0) + return ret; + + /* Now we can iterate through the list of strings */ + for (i = 0; i < n_elements; i++) { + found_end = 0; + pbegin = env_vector[i]; + while(!found_end) { + UIO_HELPER(tmp_uio, iov, env_string, sizeof(env_string), 1, + (vm_offset_t) pbegin, iov.iov_len, UIO_SYSSPACE, + UIO_READ, td); + + ret = proc_rwmem(p, &tmp_uio); + if (ret != 0) + return ret; + + if (!strvalid(env_string, UIO_CHUNK_SZ)) { + /* + * We didn't find the end of the string + * Add the string to the buffer and move + * the pointer + */ + sbuf_bcat(sb, env_string, UIO_CHUNK_SZ); + pbegin = &(*pbegin) + UIO_CHUNK_SZ; + } else { + found_end = 1; + } + } + sbuf_printf(sb, "%s", env_string); + } + +#undef UIO_HELPER + + return (0); +} + +static void +ps_string_env(const struct ps_strings ps, u_long *addr, int *n) +{ + + *addr = (u_long) ps.ps_envstr; + *n = ps.ps_nenvstr; +} + /* * Filler function for proc/pid/environ */ static int linprocfs_doprocenviron(PFS_FILL_ARGS) { + int ret; - sbuf_printf(sb, "doprocenviron\n%c", '\0'); - return (0); + PROC_LOCK(p); + + if ((ret = p_cansee(td, p)) != 0) { + PROC_UNLOCK(p); + return ret; + } + + ret = linprocfs_doargv(td, p, sb, ps_string_env); + PROC_UNLOCK(p); + return (ret); } /* From owner-svn-src-head@FreeBSD.ORG Thu Sep 16 08:16:54 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 092561065672; Thu, 16 Sep 2010 08:16:54 +0000 (UTC) (envelope-from brian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EE3D28FC18; Thu, 16 Sep 2010 08:16:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8G8GrCF065810; Thu, 16 Sep 2010 08:16:53 GMT (envelope-from brian@svn.freebsd.org) Received: (from brian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8G8Grmj065808; Thu, 16 Sep 2010 08:16:53 GMT (envelope-from brian@svn.freebsd.org) Message-Id: <201009160816.o8G8Grmj065808@svn.freebsd.org> From: Brian Somers Date: Thu, 16 Sep 2010 08:16:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212724 - head/sbin/fdisk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Sep 2010 08:16:54 -0000 Author: brian Date: Thu Sep 16 08:16:53 2010 New Revision: 212724 URL: http://svn.freebsd.org/changeset/base/212724 Log: Add support for identifying a journaled root filesystem. Fix support for identifying the given /dev/vinum/root example. MFC after: 3 weeks Modified: head/sbin/fdisk/fdisk.c Modified: head/sbin/fdisk/fdisk.c ============================================================================== --- head/sbin/fdisk/fdisk.c Thu Sep 16 07:56:34 2010 (r212723) +++ head/sbin/fdisk/fdisk.c Thu Sep 16 08:16:53 2010 (r212724) @@ -1462,6 +1462,7 @@ sanitize_partition(struct dos_partition * /dev/da0a => /dev/da0 * /dev/vinum/root => /dev/vinum/root * A ".eli" part is removed if it exists (see geli(8)). + * A ".journal" ending is removed if it exists (see gjournal(8)). */ static char * get_rootdisk(void) @@ -1476,7 +1477,7 @@ get_rootdisk(void) if (statfs("/", &rootfs) == -1) err(1, "statfs(\"/\")"); - if ((rv = regcomp(&re, "^(/dev/[a-z/]+[0-9]+)([sp][0-9]+)?[a-h]?$", + if ((rv = regcomp(&re, "^(/dev/[a-z/]+[0-9]*)([sp][0-9]+)?[a-h]?(\\.journal)?$", REG_EXTENDED)) != 0) errx(1, "regcomp() failed (%d)", rv); strlcpy(dev, rootfs.f_mntfromname, sizeof (dev)); From owner-svn-src-head@FreeBSD.ORG Thu Sep 16 08:59:11 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1E5B2106564A; Thu, 16 Sep 2010 08:59:11 +0000 (UTC) (envelope-from prvs=18684819c6=brian@FreeBSD.org) Received: from idcmail-mo1so.shaw.ca (idcmail-mo1so.shaw.ca [24.71.223.10]) by mx1.freebsd.org (Postfix) with ESMTP id C106C8FC0A; Thu, 16 Sep 2010 08:59:10 +0000 (UTC) Received: from pd2ml1so-ssvc.prod.shaw.ca ([10.0.141.139]) by pd2mo1so-svcs.prod.shaw.ca with ESMTP; 16 Sep 2010 02:44:08 -0600 X-Cloudmark-SP-Filtered: true X-Cloudmark-SP-Result: v=1.1 cv=6EkEX6JM2LCztCEhkE317K9SpBSN4cB8nbuuHVfFIzI= c=1 sm=1 a=9fUDse7kmeoA:10 a=BLceEmwcHowA:10 a=kj9zAlcOel0A:10 a=MJPcHhXccCG8eBs0us8XwA==:17 a=6I5d2MoRAAAA:8 a=MMwg4So0AAAA:8 a=bQswk-ucj_17iOK-MwkA:9 a=_7DtvMzIEwt9-Y0m_bUA:7 a=8hhyb2-YBQI508o0oNYS5gFcixEA:4 a=CjuIK1q_8ugA:10 a=SV7veod9ZcQA:10 a=WJ3hkfHDukgA:10 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 Received: from unknown (HELO store.lan.Awfulhak.org) ([70.79.162.198]) by pd2ml1so-dmz.prod.shaw.ca with ESMTP; 16 Sep 2010 02:44:08 -0600 Received: from store.lan.Awfulhak.org (localhost.localdomain [127.0.0.1]) by localhost (Email Security Appliance) with SMTP id 44048C433AC_C91D8D8B; Thu, 16 Sep 2010 08:44:08 +0000 (GMT) Received: from gw.Awfulhak.org (gw.lan.Awfulhak.org [172.16.0.1]) by store.lan.Awfulhak.org (Sophos Email Appliance) with ESMTP id EA1F2C460F7_C91D8D4F; Thu, 16 Sep 2010 08:44:04 +0000 (GMT) Received: from dev.lan.Awfulhak.org (brian@dev.lan.Awfulhak.org [172.16.0.5]) by gw.Awfulhak.org (8.14.4/8.14.4) with ESMTP id o8G8i49M036858; Thu, 16 Sep 2010 01:44:04 -0700 (PDT) (envelope-from brian@FreeBSD.org) Date: Thu, 16 Sep 2010 01:44:04 -0700 From: Brian Somers To: Kirk McKusick Message-ID: <20100916014404.0409017f@dev.lan.Awfulhak.org> In-Reply-To: <201009141804.o8EI45kp088466@svn.freebsd.org> References: <201009141804.o8EI45kp088466@svn.freebsd.org> X-Mailer: Claws Mail 3.7.6 (GTK+ 2.20.1; i386-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r212617 - head/sys/ufs/ffs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Sep 2010 08:59:11 -0000 On Tue, 14 Sep 2010 18:04:05 +0000 (UTC) Kirk McKusick wrote: > Author: mckusick > Date: Tue Sep 14 18:04:05 2010 > New Revision: 212617 > URL: http://svn.freebsd.org/changeset/base/212617 > > Log: > Update comments in soft updates code to more fully describe > the addition of journalling. Only functional change is to > tighten a KASSERT. > > Reviewed by: jeff Roberson > > Modified: > head/sys/ufs/ffs/ffs_softdep.c > head/sys/ufs/ffs/fs.h > head/sys/ufs/ffs/softdep.h > > Modified: head/sys/ufs/ffs/ffs_softdep.c > ============================================================================== > --- head/sys/ufs/ffs/ffs_softdep.c Tue Sep 14 17:22:06 2010 (r212616) > +++ head/sys/ufs/ffs/ffs_softdep.c Tue Sep 14 18:04:05 2010 (r212617) > @@ -2378,7 +2378,8 @@ remove_from_journal(wk) > /* > * We emulate a TAILQ to save space in most structures which do not > * require TAILQ semantics. Here we must update the tail position > - * when removing the tail which is not the final entry. > + * when removing the tail which is not the final entry. This works > + * only if the worklist linkage are at the beginning of the structure. > */ > if (ump->softdep_journal_tail == wk) > ump->softdep_journal_tail = > @@ -2605,7 +2606,7 @@ jremref_write(jremref, jseg, data) > inoref_write(&jremref->jr_ref, jseg, rec); > } > > -static void > +static void > jmvref_write(jmvref, jseg, data) > struct jmvref *jmvref; > struct jseg *jseg; > @@ -2906,9 +2907,9 @@ complete_jseg(jseg) > waiting = wk->wk_state & IOWAITING; > wk->wk_state &= ~(IOSTARTED | IOWAITING); > wk->wk_state |= COMPLETE; > - KASSERT(i < jseg->js_cnt, > + KASSERT(i++ < jseg->js_cnt, > ("handle_written_jseg: overflow %d >= %d", [.....] If INVARIANTS is not defined, the above i++ will not happen. -- Brian Somers Don't _EVER_ lose your sense of humour ! From owner-svn-src-head@FreeBSD.ORG Thu Sep 16 09:04:14 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1F89B106564A; Thu, 16 Sep 2010 09:04:14 +0000 (UTC) (envelope-from obrien@NUXI.org) Received: from dragon.nuxi.org (trang.nuxi.org [74.95.12.85]) by mx1.freebsd.org (Postfix) with ESMTP id 006C48FC23; Thu, 16 Sep 2010 09:04:13 +0000 (UTC) Received: from dragon.nuxi.org (obrien@localhost [127.0.0.1]) by dragon.nuxi.org (8.14.4/8.14.4) with ESMTP id o8G8ihUU034889; Thu, 16 Sep 2010 01:44:43 -0700 (PDT) (envelope-from obrien@dragon.nuxi.org) Received: (from obrien@localhost) by dragon.nuxi.org (8.14.4/8.14.4/Submit) id o8G8ihuk034888; Thu, 16 Sep 2010 01:44:43 -0700 (PDT) (envelope-from obrien) Date: Thu, 16 Sep 2010 01:44:42 -0700 From: "David O'Brien" To: Juli Mallett Message-ID: <20100916084442.GB21622@dragon.NUXI.org> References: <201009091927.o89JReXm022426@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=unknown-8bit Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Operating-System: FreeBSD 9.0-CURRENT X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? User-Agent: Mutt/1.5.16 (2007-06-09) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r212374 - head/usr.bin/printf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: obrien@FreeBSD.org List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Sep 2010 09:04:14 -0000 On Thu, Sep 09, 2010 at 12:51:11PM -0700, Juli Mallett wrote: > On Thu, Sep 9, 2010 at 12:27, David E. O'Brien wrote: > > Author: obrien > > Date: Thu Sep  9 19:27:40 2010 > > New Revision: 212374 > > URL: http://svn.freebsd.org/changeset/base/212374 > > > > Log: > >  Note bug in trying to printf(1) things like: '-%s\n' "foo" > > Should we also add something like this note to every manual page for a > program that operates on files as command line arguments after options > w.r.t. operating on files whose names begin with '-'? No. Because most programs have a synopsis like: ls [-ABCFGHILPRSTUWZabcdfghiklmnopqrstuwx1] [-D format] [file ...] However, printf(1)'s is printf format [arguments ...] Which does not say it takes ANY command-line options. Thus why should one expect to have to trick out any command-line arguments "--" as one would with 'grep -- --i *.c'? Is a sentence or two a burden to the man page vs. saving someone the time I spent trying to figure out why printf(1) kept throwing up errors? -- -- David (obrien@FreeBSD.org) From owner-svn-src-head@FreeBSD.ORG Thu Sep 16 09:29:48 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B2AAD106564A; Thu, 16 Sep 2010 09:29:48 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 97B598FC1B; Thu, 16 Sep 2010 09:29:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8G9Tmde067446; Thu, 16 Sep 2010 09:29:48 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8G9Tmt3067441; Thu, 16 Sep 2010 09:29:48 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201009160929.o8G9Tmt3067441@svn.freebsd.org> From: Marius Strobl Date: Thu, 16 Sep 2010 09:29:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212725 - in head/sys: dev/gem modules/gem X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Sep 2010 09:29:48 -0000 Author: marius Date: Thu Sep 16 09:29:48 2010 New Revision: 212725 URL: http://svn.freebsd.org/changeset/base/212725 Log: Merge r207585 from cas(4): - Don't probe for PHYs if we already know to use a SERDES. Unlike as with cas(4) this only serves to speed up the the device attach though and can only be determined via the OFW device tree but not from the VPD. - Don't touch the MIF when using a SERDES. - Add some missing bus space barriers, mainly in the PCS code path. Modified: head/sys/dev/gem/if_gem.c head/sys/dev/gem/if_gem_pci.c head/sys/dev/gem/if_gem_sbus.c head/sys/modules/gem/Makefile Modified: head/sys/dev/gem/if_gem.c ============================================================================== --- head/sys/dev/gem/if_gem.c Thu Sep 16 08:16:53 2010 (r212724) +++ head/sys/dev/gem/if_gem.c Thu Sep 16 09:29:48 2010 (r212725) @@ -268,10 +268,17 @@ gem_attach(struct gem_softc *sc) sc->sc_rxsoft[i].rxs_mbuf = NULL; } + /* Bypass probing PHYs if we already know for sure to use a SERDES. */ + if ((sc->sc_flags & GEM_SERDES) != 0) + goto serdes; + /* Bad things will happen when touching this register on ERI. */ - if (sc->sc_variant != GEM_SUN_ERI) + if (sc->sc_variant != GEM_SUN_ERI) { GEM_BANK1_WRITE_4(sc, GEM_MII_DATAPATH_MODE, GEM_MII_DATAPATH_MII); + GEM_BANK1_BARRIER(sc, GEM_MII_DATAPATH_MODE, 4, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); + } gem_mifinit(sc); @@ -283,6 +290,8 @@ gem_attach(struct gem_softc *sc) if ((v & GEM_MIF_CONFIG_MDI1) != 0) { v |= GEM_MIF_CONFIG_PHY_SEL; GEM_BANK1_WRITE_4(sc, GEM_MIF_CONFIG, v); + GEM_BANK1_BARRIER(sc, GEM_MIF_CONFIG, 4, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); switch (sc->sc_variant) { case GEM_SUN_ERI: sc->sc_phyad = GEM_PHYAD_EXTERNAL; @@ -304,6 +313,8 @@ gem_attach(struct gem_softc *sc) ((v & GEM_MIF_CONFIG_MDI0) != 0 || GEM_IS_APPLE(sc))) { v &= ~GEM_MIF_CONFIG_PHY_SEL; GEM_BANK1_WRITE_4(sc, GEM_MIF_CONFIG, v); + GEM_BANK1_BARRIER(sc, GEM_MIF_CONFIG, 4, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); switch (sc->sc_variant) { case GEM_SUN_ERI: case GEM_APPLE_K2_GMAC: @@ -324,17 +335,23 @@ gem_attach(struct gem_softc *sc) * Try the external PCS SERDES if we didn't find any PHYs. */ if (error != 0 && sc->sc_variant == GEM_SUN_GEM) { + serdes: GEM_BANK1_WRITE_4(sc, GEM_MII_DATAPATH_MODE, GEM_MII_DATAPATH_SERDES); + GEM_BANK1_BARRIER(sc, GEM_MII_DATAPATH_MODE, 4, + BUS_SPACE_BARRIER_WRITE); GEM_BANK1_WRITE_4(sc, GEM_MII_SLINK_CONTROL, GEM_MII_SLINK_LOOPBACK | GEM_MII_SLINK_EN_SYNC_D); + GEM_BANK1_BARRIER(sc, GEM_MII_SLINK_CONTROL, 4, + BUS_SPACE_BARRIER_WRITE); GEM_BANK1_WRITE_4(sc, GEM_MII_CONFIG, GEM_MII_CONFIG_ENABLE); + GEM_BANK1_BARRIER(sc, GEM_MII_CONFIG, 4, + BUS_SPACE_BARRIER_WRITE); sc->sc_flags |= GEM_SERDES; sc->sc_phyad = GEM_PHYAD_EXTERNAL; error = mii_phy_probe(sc->sc_dev, &sc->sc_miibus, gem_mediachange, gem_mediastatus); } - if (error != 0) { device_printf(sc->sc_dev, "PHY probe failed: %d\n", error); goto fail_rxd; @@ -918,8 +935,9 @@ gem_init_locked(struct gem_softc *sc) __func__); #endif - /* Re-initialize the MIF. */ - gem_mifinit(sc); + if ((sc->sc_flags & GEM_SERDES) == 0) + /* Re-initialize the MIF. */ + gem_mifinit(sc); /* step 3. Setup data structures in host memory. */ if (gem_meminit(sc) != 0) @@ -1800,6 +1818,8 @@ gem_mifinit(struct gem_softc *sc) /* Configure the MIF in frame mode. */ GEM_BANK1_WRITE_4(sc, GEM_MIF_CONFIG, GEM_BANK1_READ_4(sc, GEM_MIF_CONFIG) & ~GEM_MIF_CONFIG_BB_ENA); + GEM_BANK1_BARRIER(sc, GEM_MIF_CONFIG, 4, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); } /* @@ -1914,10 +1934,16 @@ gem_mii_writereg(device_t dev, int phy, GEM_BANK1_BARRIER(sc, GEM_MII_CONFIG, 4, BUS_SPACE_BARRIER_WRITE); GEM_BANK1_WRITE_4(sc, GEM_MII_ANAR, val); + GEM_BANK1_BARRIER(sc, GEM_MII_ANAR, 4, + BUS_SPACE_BARRIER_WRITE); GEM_BANK1_WRITE_4(sc, GEM_MII_SLINK_CONTROL, GEM_MII_SLINK_LOOPBACK | GEM_MII_SLINK_EN_SYNC_D); + GEM_BANK1_BARRIER(sc, GEM_MII_SLINK_CONTROL, 4, + BUS_SPACE_BARRIER_WRITE); GEM_BANK1_WRITE_4(sc, GEM_MII_CONFIG, GEM_MII_CONFIG_ENABLE); + GEM_BANK1_BARRIER(sc, GEM_MII_CONFIG, 4, + BUS_SPACE_BARRIER_WRITE); return (0); case MII_ANLPAR: reg = GEM_MII_ANLPAR; @@ -1928,6 +1954,8 @@ gem_mii_writereg(device_t dev, int phy, return (0); } GEM_BANK1_WRITE_4(sc, reg, val); + GEM_BANK1_BARRIER(sc, reg, 4, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); return (0); } Modified: head/sys/dev/gem/if_gem_pci.c ============================================================================== --- head/sys/dev/gem/if_gem_pci.c Thu Sep 16 08:16:53 2010 (r212724) +++ head/sys/dev/gem/if_gem_pci.c Thu Sep 16 09:29:48 2010 (r212725) @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include #if defined(__powerpc__) || defined(__sparc64__) +#include #include #include #endif @@ -140,12 +141,17 @@ static struct resource_spec gem_pci_res_ { -1, 0 } }; +#define GEM_SHARED_PINS "shared-pins" +#define GEM_SHARED_PINS_SERDES "serdes" + static int gem_pci_attach(device_t dev) { struct gem_softc *sc; int i; -#if !(defined(__powerpc__) || defined(__sparc64__)) +#if defined(__powerpc__) || defined(__sparc64__) + char buf[sizeof(GEM_SHARED_PINS)]; +#else int j; #endif @@ -207,6 +213,12 @@ gem_pci_attach(device_t dev) #if defined(__powerpc__) || defined(__sparc64__) OF_getetheraddr(dev, sc->sc_enaddr); + if (OF_getprop(ofw_bus_get_node(dev), GEM_SHARED_PINS, buf, + sizeof(buf)) > 0) { + buf[sizeof(buf) - 1] = '\0'; + if (strcmp(buf, GEM_SHARED_PINS_SERDES) == 0) + sc->sc_flags |= GEM_SERDES; + } #else /* * Dig out VPD (vital product data) and read NA (network address). Modified: head/sys/dev/gem/if_gem_sbus.c ============================================================================== --- head/sys/dev/gem/if_gem_sbus.c Thu Sep 16 08:16:53 2010 (r212724) +++ head/sys/dev/gem/if_gem_sbus.c Thu Sep 16 09:29:48 2010 (r212725) @@ -131,6 +131,8 @@ gem_sbus_attach(device_t dev) sc = device_get_softc(dev); sc->sc_variant = GEM_SUN_GEM; sc->sc_dev = dev; + /* All known SBus models use a SERDES. */ + sc->sc_flags = GEM_SERDES; if (bus_alloc_resources(dev, gem_sbus_res_spec, sc->sc_res)) { device_printf(dev, "failed to allocate resources\n"); Modified: head/sys/modules/gem/Makefile ============================================================================== --- head/sys/modules/gem/Makefile Thu Sep 16 08:16:53 2010 (r212724) +++ head/sys/modules/gem/Makefile Thu Sep 16 09:29:48 2010 (r212725) @@ -3,10 +3,15 @@ .PATH: ${.CURDIR}/../../dev/gem KMOD= if_gem -SRCS= bus_if.h device_if.h if_gem.c if_gem_pci.c miibus_if.h pci_if.h +SRCS= bus_if.h device_if.h if_gem.c if_gem_pci.c ${if_gem_sbus} miibus_if.h +SRCS+= ${ofw_bus_if} pci_if.h .if ${MACHINE} == "sparc64" -SRCS+= if_gem_sbus.c ofw_bus_if.h +if_gem_sbus= if_gem_sbus.c +.endif + +.if ${MACHINE_CPUARCH} == "powerpc" || ${MACHINE_CPUARCH} == "sparc64" +ofw_bus_if= ofw_bus_if.h .endif .include From owner-svn-src-head@FreeBSD.ORG Thu Sep 16 10:44:18 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 71E6A1065695 for ; Thu, 16 Sep 2010 10:44:18 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) by mx1.freebsd.org (Postfix) with ESMTP id D5E238FC22 for ; Thu, 16 Sep 2010 10:44:17 +0000 (UTC) Received: (qmail 3450 invoked from network); 16 Sep 2010 10:38:55 -0000 Received: from localhost (HELO [127.0.0.1]) ([127.0.0.1]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 16 Sep 2010 10:38:55 -0000 Message-ID: <4C91F503.4000303@freebsd.org> Date: Thu, 16 Sep 2010 12:44:19 +0200 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.9) Gecko/20100825 Thunderbird/3.1.3 MIME-Version: 1.0 To: John Baldwin References: <201009151039.o8FAdU4H030416@svn.freebsd.org> <4C90B326.4000208@freebsd.org> <4C90D27D.4070306@freebsd.org> <201009151212.52337.jhb@freebsd.org> In-Reply-To: <201009151212.52337.jhb@freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, Lawrence Stewart , svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r212653 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Sep 2010 10:44:18 -0000 On 15.09.2010 18:12, John Baldwin wrote: > On Wednesday, September 15, 2010 10:04:45 am Andre Oppermann wrote: >> Below is the wording proposed by Lawrence: >> /* >> * The default Maximum Segment Size (MSS) to use when we do not have specific >> * knowledge (e.g. via path MTU discovery) that the destination host is prepared >> * to accept larger datagrams. The smallest allowable IP datagram MTU and >> * optionless IP/TCP header lengths are used for the calculation as per RFC879. >> * For IPv4 (RFC791): 576 - 20 - 20 = 536. >> * For IPv6 (RFC2460): 1280 - 40 - 20 = 1220. >> */ >> #define TCP_MSS 536 >> #define TCP6_MSS 1220 > > I think the existing text is fine for this comment, with one nit: > > * For IPv4 the MSS is 576 - sizeof(struct tcpiphdr) > > I would find it clearer if it was 'sizeof(struct ip) - sizeof(struct tcphdr)' > instead. I chose 'sizeof(struct tcpiphdr)' for consistency with other parts of the TCP code where the MSS is calculated this way. 'struct tcpiphdr' predates IPv6 and is commonly used in the BSD kernel code. >> * Limit the lowest MSS we accept for path MTU discovery and the TCP SYN MSS >> * option. Allowing low values of MSS can consume significant resources and be >> * used to mount a resource exhaustion attack. Connections requesting lower MSS >> * values will be rounded up to this value and the IP_DF flag will be cleared to >> * allow fragmentation along the path. >> * >> * See tcp_subr.c tcp_minmss SYSCTL declaration for more comments. Setting this >> * SYSCTL to "0" disables the minmss check. >> * >> * The default value is fine for TCP over IPv4 across the Internet's smallest >> * known link MTU (256 bytes for AX.25 packet radio). However, a connection is >> * very unlikely to come across such low MTU interfaces (anno domini 2003). >> */ >> #define TCP_MINMSS 216 > > I actually prefer the above text for this block. The 'amounts of resources' > phrase is certainly redundant and just 'resources' is clearer. OK. I'll update the comment with a small change to the third paragraph. -- Andre From owner-svn-src-head@FreeBSD.ORG Thu Sep 16 10:53:02 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2FD601065673; Thu, 16 Sep 2010 10:53:02 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1FC4F8FC12; Thu, 16 Sep 2010 10:53:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8GAr2rO086687; Thu, 16 Sep 2010 10:53:02 GMT (envelope-from zec@svn.freebsd.org) Received: (from zec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8GAr29r086685; Thu, 16 Sep 2010 10:53:02 GMT (envelope-from zec@svn.freebsd.org) Message-Id: <201009161053.o8GAr29r086685@svn.freebsd.org> From: Marko Zec Date: Thu, 16 Sep 2010 10:53:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212726 - head/sbin/sysctl X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Sep 2010 10:53:02 -0000 Author: zec Date: Thu Sep 16 10:53:01 2010 New Revision: 212726 URL: http://svn.freebsd.org/changeset/base/212726 Log: Make the format of "Real Memory" and "Virtual Memory" lines more consistent with the rest of sysctl vm.vmtotal output. MFC after: 3 days Modified: head/sbin/sysctl/sysctl.c Modified: head/sbin/sysctl/sysctl.c ============================================================================== --- head/sbin/sysctl/sysctl.c Thu Sep 16 09:29:48 2010 (r212725) +++ head/sbin/sysctl/sysctl.c Thu Sep 16 10:53:01 2010 (r212726) @@ -406,9 +406,9 @@ S_vmtotal(int l2, void *p) "%hd Sleep: %hd)\n", v->t_rq, v->t_dw, v->t_pw, v->t_sl); printf( - "Virtual Memory:\t\t(Total: %dK, Active %dK)\n", + "Virtual Memory:\t\t(Total: %dK Active: %dK)\n", v->t_vm * pageKilo, v->t_avm * pageKilo); - printf("Real Memory:\t\t(Total: %dK Active %dK)\n", + printf("Real Memory:\t\t(Total: %dK Active: %dK)\n", v->t_rm * pageKilo, v->t_arm * pageKilo); printf("Shared Virtual Memory:\t(Total: %dK Active: %dK)\n", v->t_vmshr * pageKilo, v->t_avmshr * pageKilo); From owner-svn-src-head@FreeBSD.ORG Thu Sep 16 11:33:31 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F140F1065672; Thu, 16 Sep 2010 11:33:31 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E0B218FC0A; Thu, 16 Sep 2010 11:33:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8GBXVIq087568; Thu, 16 Sep 2010 11:33:31 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8GBXVcK087566; Thu, 16 Sep 2010 11:33:31 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201009161133.o8GBXVcK087566@svn.freebsd.org> From: Rui Paulo Date: Thu, 16 Sep 2010 11:33:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212727 - head/usr.bin/kdump X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Sep 2010 11:33:32 -0000 Author: rpaulo Date: Thu Sep 16 11:33:31 2010 New Revision: 212727 URL: http://svn.freebsd.org/changeset/base/212727 Log: When generating functions to print the arguments of system calls with bitwise parameters (e.g. mmap), print the syscall parameter value first. The resulting output looks like the %b specifier of printf(9). Before: mmap(0,0x8000,PROT_READ|PROT_WRITE,... After: mmap(0,0x8000,0x3,... Submitted by: Norberto Lopes Idea from: freebsd-arch/2006-April/005116.html Modified: head/usr.bin/kdump/mksubr Modified: head/usr.bin/kdump/mksubr ============================================================================== --- head/usr.bin/kdump/mksubr Thu Sep 16 10:53:01 2010 (r212726) +++ head/usr.bin/kdump/mksubr Thu Sep 16 11:33:31 2010 (r212727) @@ -49,6 +49,7 @@ void $name (int arg) { int or = 0; + printf("%#x<", arg); _EOF_ egrep "^#[[:space:]]*define[[:space:]]+"${grep}"[[:space:]]*" \ $include_dir/$file | \ @@ -58,6 +59,7 @@ _EOF_ ++i; \ printf "\tif(!((arg>0)^((%s)>0)))\n\t\tif_print_or(arg, %s, or);\n", $i, $i }' cat <<_EOF_ + printf(">"); if (or == 0) (void)printf("%ld", (long)arg); } @@ -432,6 +434,8 @@ sendrecvflagsname (int flags) (void)printf("0"); return; } + + printf("%#x<", flags); _EOF_ egrep "^#[[:space:]]*define[[:space:]]+MSG_[A-Z]+[[:space:]]+0x[0-9]+[[:space:]]*" $include_dir/sys/socket.h | \ awk '{ for (i = 1; i <= NF; i++) \ @@ -440,6 +444,7 @@ egrep "^#[[:space:]]*define[[:space:]]+M ++i; \ printf "\tif(!((flags>0)^((%s)>0)))\n\t\tif_print_or(flags, %s, or);\n", $i, $i }' cat <<_EOF_ + printf(">"); } _EOF_ From owner-svn-src-head@FreeBSD.ORG Thu Sep 16 11:36:47 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 228AE1065670; Thu, 16 Sep 2010 11:36:47 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail03.syd.optusnet.com.au (mail03.syd.optusnet.com.au [211.29.132.184]) by mx1.freebsd.org (Postfix) with ESMTP id AAA058FC1C; Thu, 16 Sep 2010 11:36:46 +0000 (UTC) Received: from c122-107-116-249.carlnfd1.nsw.optusnet.com.au (c122-107-116-249.carlnfd1.nsw.optusnet.com.au [122.107.116.249]) by mail03.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o8GBahV3020358 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 16 Sep 2010 21:36:44 +1000 Date: Thu, 16 Sep 2010 21:36:43 +1000 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: "David O'Brien" In-Reply-To: <20100916084442.GB21622@dragon.NUXI.org> Message-ID: <20100916212043.N724@delplex.bde.org> References: <201009091927.o89JReXm022426@svn.freebsd.org> <20100916084442.GB21622@dragon.NUXI.org> MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="0-1360494272-1284637003=:724" Cc: Juli Mallett , svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r212374 - head/usr.bin/printf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Sep 2010 11:36:47 -0000 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --0-1360494272-1284637003=:724 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE On Thu, 16 Sep 2010, David O'Brien wrote: > On Thu, Sep 09, 2010 at 12:51:11PM -0700, Juli Mallett wrote: >> On Thu, Sep 9, 2010 at 12:27, David E. O'Brien wrot= e: >>> Author: obrien >>> Date: Thu Sep =A09 19:27:40 2010 >>> New Revision: 212374 >>> URL: http://svn.freebsd.org/changeset/base/212374 >>> >>> Log: >>> =A0Note bug in trying to printf(1) things like: '-%s\n' "foo" >> >> Should we also add something like this note to every manual page for a >> program that operates on files as command line arguments after options >> w.r.t. operating on files whose names begin with '-'? > > No. Because most programs have a synopsis like: > > ls [-ABCFGHILPRSTUWZabcdfghiklmnopqrstuwx1] [-D format] [file ...] > > However, printf(1)'s is > > printf format [arguments ...] > > Which does not say it takes ANY command-line options. Thus why should > one expect to have to trick out any command-line arguments "--" as one > would with 'grep -- --i *.c'? > > Is a sentence or two a burden to the man page vs. saving someone the time > I spent trying to figure out why printf(1) kept throwing up errors? WHat about the lesser burder on a character or two for putting -- in the synopsis where it is more visible: =09printf [--] format [arguments ...] POSIX doesn't do this, and it doesn't seem to say anything about the problem of a leading - in the format either. Presumably its general utilities specs require _all_ utilities to support "--". I wonder if there are any utilities that don't use getopt(3) and as a result aren't POSIX conformant since they don't support "--" and also need to support a first argument starting with "-" (which won't cause problems because getopt() is not there to mess it up, but the POSIX-specified way of a "--" before the arg won't work. sleep(1) was such a utility until recently -- FreeBSD hacked on it to remove its getopt(3) call, but didn't remove its man page's claim of "is expected to be (1003.2) POSIX compatible". 1003.2 is almost 20 years old now, so someone should know if sleep(1) was actually compatible with it. Bruce --0-1360494272-1284637003=:724-- From owner-svn-src-head@FreeBSD.ORG Thu Sep 16 11:40:42 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5A0F210656CA; Thu, 16 Sep 2010 11:40:42 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3D1C78FC22; Thu, 16 Sep 2010 11:40:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8GBegk3087745; Thu, 16 Sep 2010 11:40:42 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8GBegfC087743; Thu, 16 Sep 2010 11:40:42 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201009161140.o8GBegfC087743@svn.freebsd.org> From: Rui Paulo Date: Thu, 16 Sep 2010 11:40:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212728 - head/usr.bin/kdump X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Sep 2010 11:40:42 -0000 Author: rpaulo Date: Thu Sep 16 11:40:41 2010 New Revision: 212728 URL: http://svn.freebsd.org/changeset/base/212728 Log: Fix indenting of the previous commit. Modified: head/usr.bin/kdump/mksubr Modified: head/usr.bin/kdump/mksubr ============================================================================== --- head/usr.bin/kdump/mksubr Thu Sep 16 11:33:31 2010 (r212727) +++ head/usr.bin/kdump/mksubr Thu Sep 16 11:40:41 2010 (r212728) @@ -49,7 +49,7 @@ void $name (int arg) { int or = 0; - printf("%#x<", arg); + printf("%#x<", arg); _EOF_ egrep "^#[[:space:]]*define[[:space:]]+"${grep}"[[:space:]]*" \ $include_dir/$file | \ @@ -59,7 +59,7 @@ _EOF_ ++i; \ printf "\tif(!((arg>0)^((%s)>0)))\n\t\tif_print_or(arg, %s, or);\n", $i, $i }' cat <<_EOF_ - printf(">"); + printf(">"); if (or == 0) (void)printf("%ld", (long)arg); } @@ -435,7 +435,7 @@ sendrecvflagsname (int flags) return; } - printf("%#x<", flags); + printf("%#x<", flags); _EOF_ egrep "^#[[:space:]]*define[[:space:]]+MSG_[A-Z]+[[:space:]]+0x[0-9]+[[:space:]]*" $include_dir/sys/socket.h | \ awk '{ for (i = 1; i <= NF; i++) \ @@ -444,7 +444,7 @@ egrep "^#[[:space:]]*define[[:space:]]+M ++i; \ printf "\tif(!((flags>0)^((%s)>0)))\n\t\tif_print_or(flags, %s, or);\n", $i, $i }' cat <<_EOF_ - printf(">"); + printf(">"); } _EOF_ From owner-svn-src-head@FreeBSD.ORG Thu Sep 16 12:05:01 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 187C0106564A; Thu, 16 Sep 2010 12:05:01 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0423C8FC16; Thu, 16 Sep 2010 12:05:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8GC50bp088277; Thu, 16 Sep 2010 12:05:00 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8GC5081088275; Thu, 16 Sep 2010 12:05:00 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201009161205.o8GC5081088275@svn.freebsd.org> From: Marius Strobl Date: Thu, 16 Sep 2010 12:05:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212729 - head/sys/boot/sparc64/boot1 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Sep 2010 12:05:01 -0000 Author: marius Date: Thu Sep 16 12:05:00 2010 New Revision: 212729 URL: http://svn.freebsd.org/changeset/base/212729 Log: Merge from powerpc: - Change putc_func_t to use a char instead of an int for the character. - Make functions and variables not used outside of this source file static. - Remove unused prototypes and variables. - The OFW read and seek methods take 3 and not 4 input arguments. Modified: head/sys/boot/sparc64/boot1/boot1.c Modified: head/sys/boot/sparc64/boot1/boot1.c ============================================================================== --- head/sys/boot/sparc64/boot1/boot1.c Thu Sep 16 11:40:41 2010 (r212728) +++ head/sys/boot/sparc64/boot1/boot1.c Thu Sep 16 12:05:00 2010 (r212729) @@ -26,9 +26,7 @@ __FBSDID("$FreeBSD$"); #define _PATH_LOADER "/boot/loader" #define _PATH_KERNEL "/boot/kernel/kernel" -#define BSIZEMAX 16384 - -typedef int putc_func_t(int c, void *arg); +typedef int putc_func_t(char c, void *arg); typedef int32_t ofwh_t; struct sp_data { @@ -44,11 +42,6 @@ static char bootargs[128]; static ofwh_t bootdev; -static struct fs fs; -static ino_t inomap; -static char blkbuf[BSIZEMAX]; -static unsigned int fsblks; - static uint32_t fs_off; int main(int ac, char **av); @@ -66,14 +59,13 @@ static int mount(const char *device); static void panic(const char *fmt, ...) __dead2; static int printf(const char *fmt, ...); -static int putchar(int c, void *arg); +static int putchar(char c, void *arg); static int vprintf(const char *fmt, va_list ap); static int vsnprintf(char *str, size_t sz, const char *fmt, va_list ap); static int __printf(const char *fmt, putc_func_t *putc, void *arg, va_list ap); -static int __putc(int c, void *arg); static int __puts(const char *s, putc_func_t *putc, void *arg); -static int __sputc(int c, void *arg); +static int __sputc(char c, void *arg); static char *__uitoa(char *buf, u_int val, int base); static char *__ultoa(char *buf, u_long val, int base); @@ -83,19 +75,18 @@ static char *__ultoa(char *buf, u_long v typedef u_int64_t ofwcell_t; typedef u_int32_t u_ofwh_t; typedef int (*ofwfp_t)(ofwcell_t []); -ofwfp_t ofw; /* the prom Open Firmware entry */ +static ofwfp_t ofw; /* the PROM Open Firmware entry */ void ofw_init(int, int, int, int, ofwfp_t); -ofwh_t ofw_finddevice(const char *); -ofwh_t ofw_open(const char *); -int ofw_getprop(ofwh_t, const char *, void *, size_t); -int ofw_read(ofwh_t, void *, size_t); -int ofw_write(ofwh_t, const void *, size_t); -int ofw_seek(ofwh_t, u_int64_t); -void ofw_exit(void) __dead2; +static ofwh_t ofw_finddevice(const char *); +static ofwh_t ofw_open(const char *); +static int ofw_getprop(ofwh_t, const char *, void *, size_t); +static int ofw_read(ofwh_t, void *, size_t); +static int ofw_write(ofwh_t, const void *, size_t); +static int ofw_seek(ofwh_t, u_int64_t); +static void ofw_exit(void) __dead2; -ofwh_t bootdevh; -ofwh_t stdinh, stdouth; +static ofwh_t stdinh, stdouth; /* * This has to stay here, as the PROM seems to ignore the @@ -138,7 +129,7 @@ ofw_init(int d, int d1, int d2, int d3, exit(main(ac, av)); } -ofwh_t +static ofwh_t ofw_finddevice(const char *name) { ofwcell_t args[] = { @@ -156,7 +147,7 @@ ofw_finddevice(const char *name) return (args[4]); } -int +static int ofw_getprop(ofwh_t ofwh, const char *name, void *buf, size_t len) { ofwcell_t args[] = { @@ -178,7 +169,7 @@ ofw_getprop(ofwh_t ofwh, const char *nam return (0); } -ofwh_t +static ofwh_t ofw_open(const char *path) { ofwcell_t args[] = { @@ -196,7 +187,7 @@ ofw_open(const char *path) return (args[4]); } -int +static int ofw_close(ofwh_t devh) { ofwcell_t args[] = { @@ -213,12 +204,12 @@ ofw_close(ofwh_t devh) return (0); } -int +static int ofw_read(ofwh_t devh, void *buf, size_t len) { ofwcell_t args[] = { (ofwcell_t)"read", - 4, + 3, 1, (u_ofwh_t)devh, (ofwcell_t)buf, @@ -233,7 +224,7 @@ ofw_read(ofwh_t devh, void *buf, size_t return (0); } -int +static int ofw_write(ofwh_t devh, const void *buf, size_t len) { ofwcell_t args[] = { @@ -253,12 +244,12 @@ ofw_write(ofwh_t devh, const void *buf, return (0); } -int +static int ofw_seek(ofwh_t devh, u_int64_t off) { ofwcell_t args[] = { (ofwcell_t)"seek", - 4, + 3, 1, (u_ofwh_t)devh, off >> 32, @@ -273,7 +264,7 @@ ofw_seek(ofwh_t devh, u_int64_t off) return (0); } -void +static void ofw_exit(void) { ofwcell_t args[3]; @@ -299,6 +290,7 @@ bcopy(const void *src, void *dst, size_t static void memcpy(void *dst, const void *src, size_t len) { + bcopy(src, dst, len); } @@ -314,6 +306,7 @@ bzero(void *b, size_t len) static int strcmp(const char *s1, const char *s2) { + for (; *s1 == *s2 && *s1; s1++, s2++) ; return ((u_char)*s1 - (u_char)*s2); @@ -431,6 +424,7 @@ load(const char *fname) static int dskread(void *buf, u_int64_t lba, int nblk) { + /* * The Open Firmware should open the correct partition for us. * That means, if we read from offset zero on an open instance handle, @@ -468,7 +462,7 @@ printf(const char *fmt, ...) } static int -putchar(int c, void *arg) +putchar(char c, void *arg) { char buf; @@ -614,7 +608,7 @@ reswitch: c = *fmt++; } static int -__sputc(int c, void *arg) +__sputc(char c, void *arg) { struct sp_data *sp; From owner-svn-src-head@FreeBSD.ORG Thu Sep 16 12:05:47 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3531210656C7; Thu, 16 Sep 2010 12:05:47 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 24C2C8FC28; Thu, 16 Sep 2010 12:05:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8GC5lBE088330; Thu, 16 Sep 2010 12:05:47 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8GC5lKT088328; Thu, 16 Sep 2010 12:05:47 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201009161205.o8GC5lKT088328@svn.freebsd.org> From: Marius Strobl Date: Thu, 16 Sep 2010 12:05:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212730 - head/sys/sparc64/sparc64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Sep 2010 12:05:47 -0000 Author: marius Date: Thu Sep 16 12:05:46 2010 New Revision: 212730 URL: http://svn.freebsd.org/changeset/base/212730 Log: Remove accidentally committed test code which effectively prevented the use of the SPARC64 V VIS-based block copy function added in r212709. Reported by: Michael Moll Modified: head/sys/sparc64/sparc64/machdep.c Modified: head/sys/sparc64/sparc64/machdep.c ============================================================================== --- head/sys/sparc64/sparc64/machdep.c Thu Sep 16 12:05:00 2010 (r212729) +++ head/sys/sparc64/sparc64/machdep.c Thu Sep 16 12:05:46 2010 (r212730) @@ -511,8 +511,6 @@ sparc64_init(caddr_t mdp, u_long o1, u_l case CPU_IMPL_SPARC64V: cpu_block_copy = zeus_block_copy; cpu_block_zero = zeus_block_zero; - cpu_block_copy = spitfire_block_copy; - cpu_block_zero = spitfire_block_zero; break; } } From owner-svn-src-head@FreeBSD.ORG Thu Sep 16 12:13:07 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 33B7E1065695; Thu, 16 Sep 2010 12:13:07 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 232908FC24; Thu, 16 Sep 2010 12:13:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8GCD7Ul088509; Thu, 16 Sep 2010 12:13:07 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8GCD7uA088507; Thu, 16 Sep 2010 12:13:07 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201009161213.o8GCD7uA088507@svn.freebsd.org> From: Andre Oppermann Date: Thu, 16 Sep 2010 12:13:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212731 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Sep 2010 12:13:07 -0000 Author: andre Date: Thu Sep 16 12:13:06 2010 New Revision: 212731 URL: http://svn.freebsd.org/changeset/base/212731 Log: Improve comment to TCP_MINMSS by taking the wording from lstewart (with a small difference in the last paragraph though) as suggested by jhb. Clarify that the 'reviewed by' in r212653 by lstewart was for the functional change, not the comments in the committed version. Modified: head/sys/netinet/tcp.h Modified: head/sys/netinet/tcp.h ============================================================================== --- head/sys/netinet/tcp.h Thu Sep 16 12:05:46 2010 (r212730) +++ head/sys/netinet/tcp.h Thu Sep 16 12:13:06 2010 (r212731) @@ -120,18 +120,18 @@ struct tcphdr { #define TCP6_MSS 1220 /* - * Limit the lowest MSS we accept from path MTU discovery and the TCP SYN MSS - * option. Allowing too low values of MSS can consume significant amounts of - * resources and be used as a form of a resource exhaustion attack. + * Limit the lowest MSS we accept for path MTU discovery and the TCP SYN MSS + * option. Allowing low values of MSS can consume significant resources and + * be used to mount a resource exhaustion attack. * Connections requesting lower MSS values will be rounded up to this value - * and the IP_DF flag is cleared to allow fragmentation along the path. + * and the IP_DF flag will be cleared to allow fragmentation along the path. * * See tcp_subr.c tcp_minmss SYSCTL declaration for more comments. Setting * it to "0" disables the minmss check. * - * The default value is fine for the smallest official link MTU (256 bytes, - * AX.25 packet radio) in the Internet. However it is very unlikely to come - * across such low MTU interfaces these days (anno domini 2003). + * The default value is fine for TCP across the Internet's smallest official + * link MTU (256 bytes for AX.25 packet radio). However, a connection is very + * unlikely to come across such low MTU interfaces these days (anno domini 2003). */ #define TCP_MINMSS 216 From owner-svn-src-head@FreeBSD.ORG Thu Sep 16 12:39:51 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1A1791065693; Thu, 16 Sep 2010 12:39:51 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 08D828FC28; Thu, 16 Sep 2010 12:39:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8GCdot6089064; Thu, 16 Sep 2010 12:39:50 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8GCdoOA089060; Thu, 16 Sep 2010 12:39:50 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201009161239.o8GCdoOA089060@svn.freebsd.org> From: Alexander Motin Date: Thu, 16 Sep 2010 12:39:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212732 - in head/sys/dev: ahci mvs siis X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Sep 2010 12:39:51 -0000 Author: mav Date: Thu Sep 16 12:39:50 2010 New Revision: 212732 URL: http://svn.freebsd.org/changeset/base/212732 Log: Fix panic, when due to some kind of congestion on FIS-based switching port multiplier some command triggers false positive timeout, but then completes normally. MFC after: 2 weeks Modified: head/sys/dev/ahci/ahci.c head/sys/dev/mvs/mvs.c head/sys/dev/siis/siis.c Modified: head/sys/dev/ahci/ahci.c ============================================================================== --- head/sys/dev/ahci/ahci.c Thu Sep 16 12:13:06 2010 (r212731) +++ head/sys/dev/ahci/ahci.c Thu Sep 16 12:39:50 2010 (r212732) @@ -1854,6 +1854,7 @@ ahci_end_transaction(struct ahci_slot *s device_t dev = slot->dev; struct ahci_channel *ch = device_get_softc(dev); union ccb *ccb = slot->ccb; + int lastto; bus_dmamap_sync(ch->dma.work_tag, ch->dma.work_map, BUS_DMASYNC_POSTWRITE); @@ -1955,11 +1956,6 @@ ahci_end_transaction(struct ahci_slot *s ch->oslots &= ~(1 << slot->slot); ch->rslots &= ~(1 << slot->slot); ch->aslots &= ~(1 << slot->slot); - if (et != AHCI_ERR_TIMEOUT) { - if (ch->toslots == (1 << slot->slot)) - xpt_release_simq(ch->sim, TRUE); - ch->toslots &= ~(1 << slot->slot); - } slot->state = AHCI_SLOT_EMPTY; slot->ccb = NULL; /* Update channel stats. */ @@ -1970,6 +1966,13 @@ ahci_end_transaction(struct ahci_slot *s ch->numtslots--; ch->numtslotspd[ccb->ccb_h.target_id]--; } + /* Cancel timeout state if request completed normally. */ + if (et != AHCI_ERR_TIMEOUT) { + lastto = (ch->toslots == (1 << slot->slot)); + ch->toslots &= ~(1 << slot->slot); + if (lastto) + xpt_release_simq(ch->sim, TRUE); + } /* If it was first request of reset sequence and there is no error, * proceed to second request. */ if ((ccb->ccb_h.func_code == XPT_ATA_IO) && Modified: head/sys/dev/mvs/mvs.c ============================================================================== --- head/sys/dev/mvs/mvs.c Thu Sep 16 12:13:06 2010 (r212731) +++ head/sys/dev/mvs/mvs.c Thu Sep 16 12:39:50 2010 (r212732) @@ -1552,6 +1552,7 @@ mvs_end_transaction(struct mvs_slot *slo device_t dev = slot->dev; struct mvs_channel *ch = device_get_softc(dev); union ccb *ccb = slot->ccb; + int lastto; //device_printf(dev, "cmd done status %d\n", et); bus_dmamap_sync(ch->dma.workrq_tag, ch->dma.workrq_map, @@ -1634,11 +1635,6 @@ mvs_end_transaction(struct mvs_slot *slo ch->oslots &= ~(1 << slot->slot); ch->rslots &= ~(1 << slot->slot); ch->aslots &= ~(1 << slot->slot); - if (et != MVS_ERR_TIMEOUT) { - if (ch->toslots == (1 << slot->slot)) - xpt_release_simq(ch->sim, TRUE); - ch->toslots &= ~(1 << slot->slot); - } slot->state = MVS_SLOT_EMPTY; slot->ccb = NULL; /* Update channel stats. */ @@ -1658,6 +1654,13 @@ mvs_end_transaction(struct mvs_slot *slo ch->numpslots--; ch->basic_dma = 0; } + /* Cancel timeout state if request completed normally. */ + if (et != MVS_ERR_TIMEOUT) { + lastto = (ch->toslots == (1 << slot->slot)); + ch->toslots &= ~(1 << slot->slot); + if (lastto) + xpt_release_simq(ch->sim, TRUE); + } /* If it was our READ LOG command - process it. */ if (ch->readlog) { mvs_process_read_log(dev, ccb); Modified: head/sys/dev/siis/siis.c ============================================================================== --- head/sys/dev/siis/siis.c Thu Sep 16 12:13:06 2010 (r212731) +++ head/sys/dev/siis/siis.c Thu Sep 16 12:39:50 2010 (r212732) @@ -1179,6 +1179,7 @@ siis_end_transaction(struct siis_slot *s device_t dev = slot->dev; struct siis_channel *ch = device_get_softc(dev); union ccb *ccb = slot->ccb; + int lastto; mtx_assert(&ch->mtx, MA_OWNED); bus_dmamap_sync(ch->dma.work_tag, ch->dma.work_map, @@ -1262,11 +1263,6 @@ siis_end_transaction(struct siis_slot *s ch->oslots &= ~(1 << slot->slot); ch->rslots &= ~(1 << slot->slot); ch->aslots &= ~(1 << slot->slot); - if (et != SIIS_ERR_TIMEOUT) { - if (ch->toslots == (1 << slot->slot)) - xpt_release_simq(ch->sim, TRUE); - ch->toslots &= ~(1 << slot->slot); - } slot->state = SIIS_SLOT_EMPTY; slot->ccb = NULL; /* Update channel stats. */ @@ -1275,6 +1271,13 @@ siis_end_transaction(struct siis_slot *s (ccb->ataio.cmd.flags & CAM_ATAIO_FPDMA)) { ch->numtslots[ccb->ccb_h.target_id]--; } + /* Cancel timeout state if request completed normally. */ + if (et != SIIS_ERR_TIMEOUT) { + lastto = (ch->toslots == (1 << slot->slot)); + ch->toslots &= ~(1 << slot->slot); + if (lastto) + xpt_release_simq(ch->sim, TRUE); + } /* If it was our READ LOG command - process it. */ if (ch->readlog) { siis_process_read_log(dev, ccb); From owner-svn-src-head@FreeBSD.ORG Thu Sep 16 15:32:49 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A831A1065675; Thu, 16 Sep 2010 15:32:49 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail07.syd.optusnet.com.au (mail07.syd.optusnet.com.au [211.29.132.188]) by mx1.freebsd.org (Postfix) with ESMTP id 3CB1D8FC0C; Thu, 16 Sep 2010 15:32:45 +0000 (UTC) Received: from c122-107-116-249.carlnfd1.nsw.optusnet.com.au (c122-107-116-249.carlnfd1.nsw.optusnet.com.au [122.107.116.249]) by mail07.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o8GFWgUN025871 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 17 Sep 2010 01:32:43 +1000 Date: Fri, 17 Sep 2010 01:32:42 +1000 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Kostik Belousov In-Reply-To: <20100915150412.GM2465@deviant.kiev.zoral.com.ua> Message-ID: <20100916220620.W763@delplex.bde.org> References: <201009151424.o8FEOLZE039185@svn.freebsd.org> <20100915145209.GK2465@deviant.kiev.zoral.com.ua> <20100915150412.GM2465@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="0-1831366618-1284651162=:763" Cc: Attilio Rao , svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r212661 - head/sys/dev/aac X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Sep 2010 15:32:49 -0000 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --0-1831366618-1284651162=:763 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE On Wed, 15 Sep 2010, Kostik Belousov wrote: > On Wed, Sep 15, 2010 at 04:57:15PM +0200, Attilio Rao wrote: >> 2010/9/15 Kostik Belousov : >>> On Wed, Sep 15, 2010 at 02:24:21PM +0000, Attilio Rao wrote: >>>> ... >>>> Log: >>>> =9A Fix bogus busying mechanism from cdevsw callbacks: >>>> =9A - D_TRACKCLOSE may be used there as d_close() are expected to matc= h up >>>> =9A =9A d_open() calls Some mail program made this hard to read by converting ASCII to hard \x9a's= =2E D_TRACKCLOSE may be useful for something, but it isn't for determining busyness. Rather the reverse -- it can be used for getting the driver called in cases where there is a thread busy (but sleeping) in the driver. It can also repeat devfs/vfs's broken device busyness counting. I know of a couple of useful uses for it in FreeBSD, but these are unimplemented, and all of the uses that I looked at are nonsense or broken. One nonsense and broken case is in ast-tape.c. This driver used to enforce exclusive access using vfs counting. I think the vfs counting works with exclusive access. But with exclusive access all closes are last-ones so D_TRACKCLOSE has no effect. Now, this driver doesn't enforce exclusive access, so D_TRACKCLOSE just gives bugs like writing filemarks and rewinding the rewindable device for non-last closes, if anyone actually uses non-exclusive access. >>> VFS is not very good at properly calling VOP_CLOSE(). As example, prema= ture >>> vnode reclaim due to devfs unmount would cause VOP_CLOSE() to be called >>> only once despite the number of opens being =9A> 1. This seems to invalidate all cases where D_TRACKCLOSE is (ab)used for reference counting. One such case is geom_dev.c:g_dev_close(). This does nothing commital except to decrement some of the r/w/e access counters. But if it is not called once for every device open, it cannot do that. Also, there is a problem initializing its flags arg for forced VOP_CLOSE() from general context, and no way to its flags arg to pass the necessary combined r/w/e adjustments if these adjustments sum to less than -1 for any of r/w/e. For normal open/close pairs, the close flags arg must equal the open flags arg, and a forced close from unrelated context will find it either difficult to find the open flags arg if there was only 1 open, or usually impossible to combine 2 open flags args if there was > 1 open. Otherwise, g_dev_close is the only useful use of D_TRACKCLOSE that I know of. >> Yes. >> That makes implementing a similar semantic in drivers very difficult >> and not very well fixable, in particular within the d_* callbacks. Vfs doesn't properly determine busyness (due to complications in itself and at the driver level), so individualy drivers have no chance of determining it (since to do so they would have to understand not only therir own complications, but also vfs complications which vfs itself doesn't completely understand). >> I'm seriously wondering if we might just make a shortcut just for >> supporting such a feature (busying the device on real devfs entry >> activity) as several of them may be needing and may be probabilly >> needing to be 100%. >> Luckilly, it seems that such paths are not experienced very frequently. > > I am not sure what do you mean by "busying the device on real devfs entry > activity". Is the operation made by dev_refthread() and friends enough ? > > Device cannot be destroyed by destroy_dev() until all threads leave the > cdevsw methods. Note that there may be other threads in a cdevsw method even when d_close() is called for the last-close. I think no other threads can be in a cdevsw read, write or ioctl method when last-close is called (since they must hold a dup'ed fd open, so any close cannot be the last one). Also, no other thread can be in an open method, due to bugs in devfs/vfs last-close counting (the count is incremented before devfs_open() is called; so cdevsw close is never called if there is a thread in an open method and D_TRACKCLOSE is not set). But any number of threads can be in the close method when cdevsw close is called, even if D_TRACKCLOSE is not set, due to a lesser bug in devfs/vfs last-close counting (the count is decremented before devfs_close() is called, so cdevsw close may be called for last-close before a previous call completes)= =2E Bruce --0-1831366618-1284651162=:763-- From owner-svn-src-head@FreeBSD.ORG Thu Sep 16 16:03:13 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 455FE106564A; Thu, 16 Sep 2010 16:03:13 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 34B6B8FC0A; Thu, 16 Sep 2010 16:03:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8GG3DKP098105; Thu, 16 Sep 2010 16:03:13 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8GG3DUJ098103; Thu, 16 Sep 2010 16:03:13 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201009161603.o8GG3DUJ098103@svn.freebsd.org> From: John Baldwin Date: Thu, 16 Sep 2010 16:03:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212749 - head/usr.sbin/pciconf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Sep 2010 16:03:13 -0000 Author: jhb Date: Thu Sep 16 16:03:12 2010 New Revision: 212749 URL: http://svn.freebsd.org/changeset/base/212749 Log: Only attempt to list extended capabilities for devices that have a PCI-express capabilities. Non-PCI-express PCI devices may simply ignore the upper bits in a config register address effectively aliasing the device ID register to 0x100 rather than returning 0xFFFFFFFF. Previously the code relied on these reads returning 0xFFFFFFFF. MFC after: 3 days Modified: head/usr.sbin/pciconf/cap.c Modified: head/usr.sbin/pciconf/cap.c ============================================================================== --- head/usr.sbin/pciconf/cap.c Thu Sep 16 15:42:56 2010 (r212748) +++ head/usr.sbin/pciconf/cap.c Thu Sep 16 16:03:12 2010 (r212749) @@ -460,6 +460,7 @@ cap_pciaf(int fd, struct pci_conf *p, ui void list_caps(int fd, struct pci_conf *p) { + int express; uint16_t sta; uint8_t ptr, cap; @@ -481,6 +482,7 @@ list_caps(int fd, struct pci_conf *p) } /* Walk the capability list. */ + express = 0; ptr = read_config(fd, &p->pc_sel, ptr, 1); while (ptr != 0 && ptr != 0xff) { cap = read_config(fd, &p->pc_sel, ptr + PCICAP_ID, 1); @@ -514,6 +516,7 @@ list_caps(int fd, struct pci_conf *p) cap_subvendor(fd, p, ptr); break; case PCIY_EXPRESS: + express = 1; cap_express(fd, p, ptr); break; case PCIY_MSIX: @@ -533,7 +536,8 @@ list_caps(int fd, struct pci_conf *p) ptr = read_config(fd, &p->pc_sel, ptr + PCICAP_NEXTPTR, 1); } - list_ecaps(fd, p); + if (express) + list_ecaps(fd, p); } /* From . */ From owner-svn-src-head@FreeBSD.ORG Thu Sep 16 16:13:12 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E83991065672; Thu, 16 Sep 2010 16:13:12 +0000 (UTC) (envelope-from mdf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D63D18FC1D; Thu, 16 Sep 2010 16:13:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8GGDCIe098344; Thu, 16 Sep 2010 16:13:12 GMT (envelope-from mdf@svn.freebsd.org) Received: (from mdf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8GGDCKm098332; Thu, 16 Sep 2010 16:13:12 GMT (envelope-from mdf@svn.freebsd.org) Message-Id: <201009161613.o8GGDCKm098332@svn.freebsd.org> From: Matthew D Fleming Date: Thu, 16 Sep 2010 16:13:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212750 - in head/sys: dev/cxgb kern sys vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Sep 2010 16:13:13 -0000 Author: mdf Date: Thu Sep 16 16:13:12 2010 New Revision: 212750 URL: http://svn.freebsd.org/changeset/base/212750 Log: Re-add r212370 now that the LOR in powerpc64 has been resolved: Add a drain function for struct sysctl_req, and use it for a variety of handlers, some of which had to do awkward things to get a large enough SBUF_FIXEDLEN buffer. Note that some sysctl handlers were explicitly outputting a trailing NUL byte. This behaviour was preserved, though it should not be necessary. Reviewed by: phk (original patch) Modified: head/sys/dev/cxgb/cxgb_sge.c head/sys/kern/kern_malloc.c head/sys/kern/kern_sysctl.c head/sys/kern/subr_lock.c head/sys/kern/subr_sbuf.c head/sys/kern/subr_sleepqueue.c head/sys/kern/subr_witness.c head/sys/sys/sysctl.h head/sys/vm/uma_core.c head/sys/vm/vm_phys.c head/sys/vm/vm_reserv.c Modified: head/sys/dev/cxgb/cxgb_sge.c ============================================================================== --- head/sys/dev/cxgb/cxgb_sge.c Thu Sep 16 16:03:12 2010 (r212749) +++ head/sys/dev/cxgb/cxgb_sge.c Thu Sep 16 16:13:12 2010 (r212750) @@ -3227,7 +3227,6 @@ t3_dump_rspq(SYSCTL_HANDLER_ARGS) struct sge_rspq *rspq; struct sge_qset *qs; int i, err, dump_end, idx; - static int multiplier = 1; struct sbuf *sb; struct rsp_desc *rspd; uint32_t data[4]; @@ -3252,8 +3251,8 @@ t3_dump_rspq(SYSCTL_HANDLER_ARGS) err = t3_sge_read_rspq(qs->port->adapter, rspq->cntxt_id, data); if (err) return (err); -retry_sbufops: - sb = sbuf_new(NULL, NULL, QDUMP_SBUF_SIZE*multiplier, SBUF_FIXEDLEN); + + sb = sbuf_new_for_sysctl(NULL, NULL, QDUMP_SBUF_SIZE, req); sbuf_printf(sb, " \n index=%u size=%u MSI-X/RspQ=%u intr enable=%u intr armed=%u\n", (data[0] & 0xffff), data[0] >> 16, ((data[2] >> 20) & 0x3f), @@ -3276,13 +3275,11 @@ retry_sbufops: rspd->rss_hdr.rss_hash_val, be32toh(rspd->flags), be32toh(rspd->len_cq), rspd->intr_gen); } - if (sbuf_error(sb) != 0) { - sbuf_delete(sb); - multiplier++; - goto retry_sbufops; - } - sbuf_finish(sb); - err = SYSCTL_OUT(req, sbuf_data(sb), sbuf_len(sb) + 1); + + err = sbuf_finish(sb); + /* Output a trailing NUL. */ + if (err == 0) + err = SYSCTL_OUT(req, "", 1); sbuf_delete(sb); return (err); } @@ -3293,7 +3290,6 @@ t3_dump_txq_eth(SYSCTL_HANDLER_ARGS) struct sge_txq *txq; struct sge_qset *qs; int i, j, err, dump_end; - static int multiplier = 1; struct sbuf *sb; struct tx_desc *txd; uint32_t *WR, wr_hi, wr_lo, gen; @@ -3321,9 +3317,7 @@ t3_dump_txq_eth(SYSCTL_HANDLER_ARGS) if (err) return (err); - -retry_sbufops: - sb = sbuf_new(NULL, NULL, QDUMP_SBUF_SIZE*multiplier, SBUF_FIXEDLEN); + sb = sbuf_new_for_sysctl(NULL, NULL, QDUMP_SBUF_SIZE, req); sbuf_printf(sb, " \n credits=%u GTS=%u index=%u size=%u rspq#=%u cmdq#=%u\n", (data[0] & 0x7fff), ((data[0] >> 15) & 1), (data[0] >> 16), @@ -3350,13 +3344,10 @@ retry_sbufops: WR[j], WR[j + 1], WR[j + 2], WR[j + 3]); } - if (sbuf_error(sb) != 0) { - sbuf_delete(sb); - multiplier++; - goto retry_sbufops; - } - sbuf_finish(sb); - err = SYSCTL_OUT(req, sbuf_data(sb), sbuf_len(sb) + 1); + err = sbuf_finish(sb); + /* Output a trailing NUL. */ + if (err == 0) + err = SYSCTL_OUT(req, "", 1); sbuf_delete(sb); return (err); } @@ -3367,7 +3358,6 @@ t3_dump_txq_ctrl(SYSCTL_HANDLER_ARGS) struct sge_txq *txq; struct sge_qset *qs; int i, j, err, dump_end; - static int multiplier = 1; struct sbuf *sb; struct tx_desc *txd; uint32_t *WR, wr_hi, wr_lo, gen; @@ -3391,8 +3381,7 @@ t3_dump_txq_ctrl(SYSCTL_HANDLER_ARGS) return (EINVAL); } -retry_sbufops: - sb = sbuf_new(NULL, NULL, QDUMP_SBUF_SIZE*multiplier, SBUF_FIXEDLEN); + sb = sbuf_new_for_sysctl(NULL, NULL, QDUMP_SBUF_SIZE, req); sbuf_printf(sb, " qid=%d start=%d -> end=%d\n", qs->idx, txq->txq_dump_start, (txq->txq_dump_start + txq->txq_dump_count) & 255); @@ -3412,13 +3401,10 @@ retry_sbufops: WR[j], WR[j + 1], WR[j + 2], WR[j + 3]); } - if (sbuf_error(sb) != 0) { - sbuf_delete(sb); - multiplier++; - goto retry_sbufops; - } - sbuf_finish(sb); - err = SYSCTL_OUT(req, sbuf_data(sb), sbuf_len(sb) + 1); + err = sbuf_finish(sb); + /* Output a trailing NUL. */ + if (err == 0) + err = SYSCTL_OUT(req, "", 1); sbuf_delete(sb); return (err); } Modified: head/sys/kern/kern_malloc.c ============================================================================== --- head/sys/kern/kern_malloc.c Thu Sep 16 16:03:12 2010 (r212749) +++ head/sys/kern/kern_malloc.c Thu Sep 16 16:13:12 2010 (r212750) @@ -828,25 +828,11 @@ sysctl_kern_malloc_stats(SYSCTL_HANDLER_ struct malloc_type_internal *mtip; struct malloc_type_header mth; struct malloc_type *mtp; - int buflen, count, error, i; + int error, i; struct sbuf sbuf; - char *buffer; + sbuf_new_for_sysctl(&sbuf, NULL, 128, req); mtx_lock(&malloc_mtx); -restart: - mtx_assert(&malloc_mtx, MA_OWNED); - count = kmemcount; - mtx_unlock(&malloc_mtx); - buflen = sizeof(mtsh) + count * (sizeof(mth) + - sizeof(struct malloc_type_stats) * MAXCPU) + 1; - buffer = malloc(buflen, M_TEMP, M_WAITOK | M_ZERO); - mtx_lock(&malloc_mtx); - if (count < kmemcount) { - free(buffer, M_TEMP); - goto restart; - } - - sbuf_new(&sbuf, buffer, buflen, SBUF_FIXEDLEN); /* * Insert stream header. @@ -855,11 +841,7 @@ restart: mtsh.mtsh_version = MALLOC_TYPE_STREAM_VERSION; mtsh.mtsh_maxcpus = MAXCPU; mtsh.mtsh_count = kmemcount; - if (sbuf_bcat(&sbuf, &mtsh, sizeof(mtsh)) < 0) { - mtx_unlock(&malloc_mtx); - error = ENOMEM; - goto out; - } + (void)sbuf_bcat(&sbuf, &mtsh, sizeof(mtsh)); /* * Insert alternating sequence of type headers and type statistics. @@ -872,30 +854,19 @@ restart: */ bzero(&mth, sizeof(mth)); strlcpy(mth.mth_name, mtp->ks_shortdesc, MALLOC_MAX_NAME); - if (sbuf_bcat(&sbuf, &mth, sizeof(mth)) < 0) { - mtx_unlock(&malloc_mtx); - error = ENOMEM; - goto out; - } + (void)sbuf_bcat(&sbuf, &mth, sizeof(mth)); /* * Insert type statistics for each CPU. */ for (i = 0; i < MAXCPU; i++) { - if (sbuf_bcat(&sbuf, &mtip->mti_stats[i], - sizeof(mtip->mti_stats[i])) < 0) { - mtx_unlock(&malloc_mtx); - error = ENOMEM; - goto out; - } + (void)sbuf_bcat(&sbuf, &mtip->mti_stats[i], + sizeof(mtip->mti_stats[i])); } } mtx_unlock(&malloc_mtx); - sbuf_finish(&sbuf); - error = SYSCTL_OUT(req, sbuf_data(&sbuf), sbuf_len(&sbuf)); -out: + error = sbuf_finish(&sbuf); sbuf_delete(&sbuf); - free(buffer, M_TEMP); return (error); } @@ -1005,26 +976,19 @@ DB_SHOW_COMMAND(multizone_matches, db_sh static int sysctl_kern_mprof(SYSCTL_HANDLER_ARGS) { - int linesize = 64; struct sbuf sbuf; uint64_t count; uint64_t waste; uint64_t mem; - int bufsize; int error; - char *buf; int rsize; int size; int i; - bufsize = linesize * (KMEM_ZSIZE + 1); - bufsize += 128; /* For the stats line */ - bufsize += 128; /* For the banner line */ waste = 0; mem = 0; - buf = malloc(bufsize, M_TEMP, M_WAITOK|M_ZERO); - sbuf_new(&sbuf, buf, bufsize, SBUF_FIXEDLEN); + sbuf_new_for_sysctl(&sbuf, NULL, 128, req); sbuf_printf(&sbuf, "\n Size Requests Real Size\n"); for (i = 0; i < KMEM_ZSIZE; i++) { @@ -1042,12 +1006,8 @@ sysctl_kern_mprof(SYSCTL_HANDLER_ARGS) sbuf_printf(&sbuf, "\nTotal memory used:\t%30llu\nTotal Memory wasted:\t%30llu\n", (unsigned long long)mem, (unsigned long long)waste); - sbuf_finish(&sbuf); - - error = SYSCTL_OUT(req, sbuf_data(&sbuf), sbuf_len(&sbuf)); - + error = sbuf_finish(&sbuf); sbuf_delete(&sbuf); - free(buf, M_TEMP); return (error); } Modified: head/sys/kern/kern_sysctl.c ============================================================================== --- head/sys/kern/kern_sysctl.c Thu Sep 16 16:03:12 2010 (r212749) +++ head/sys/kern/kern_sysctl.c Thu Sep 16 16:13:12 2010 (r212750) @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -1544,3 +1545,30 @@ userland_sysctl(struct thread *td, int * } return (error); } + +/* + * Drain into a sysctl struct. The user buffer must be wired. + */ +static int +sbuf_sysctl_drain(void *arg, const char *data, int len) +{ + struct sysctl_req *req = arg; + int error; + + error = SYSCTL_OUT(req, data, len); + KASSERT(error >= 0, ("Got unexpected negative value %d", error)); + return (error == 0 ? len : -error); +} + +struct sbuf * +sbuf_new_for_sysctl(struct sbuf *s, char *buf, int length, + struct sysctl_req *req) +{ + + /* Wire the user buffer, so we can write without blocking. */ + sysctl_wire_old_buffer(req, 0); + + s = sbuf_new(s, buf, length, SBUF_FIXEDLEN); + sbuf_set_drain(s, sbuf_sysctl_drain, req); + return (s); +} Modified: head/sys/kern/subr_lock.c ============================================================================== --- head/sys/kern/subr_lock.c Thu Sep 16 16:03:12 2010 (r212749) +++ head/sys/kern/subr_lock.c Thu Sep 16 16:13:12 2010 (r212750) @@ -191,8 +191,7 @@ struct lock_prof_cpu *lp_cpu[MAXCPU]; volatile int lock_prof_enable = 0; static volatile int lock_prof_resetting; -/* SWAG: sbuf size = avg stat. line size * number of locks */ -#define LPROF_SBUF_SIZE 256 * 400 +#define LPROF_SBUF_SIZE 256 static int lock_prof_rejected; static int lock_prof_skipspin; @@ -384,8 +383,6 @@ lock_prof_type_stats(struct lock_prof_ty continue; lock_prof_sum(l, &lp, i, spin, t); lock_prof_output(&lp, sb); - if (sbuf_error(sb) != 0) - return; } } } @@ -393,13 +390,11 @@ lock_prof_type_stats(struct lock_prof_ty static int dump_lock_prof_stats(SYSCTL_HANDLER_ARGS) { - static int multiplier = 1; struct sbuf *sb; int error, cpu, t; int enabled; -retry_sbufops: - sb = sbuf_new(NULL, NULL, LPROF_SBUF_SIZE * multiplier, SBUF_FIXEDLEN); + sb = sbuf_new_for_sysctl(NULL, NULL, LPROF_SBUF_SIZE, req); sbuf_printf(sb, "\n%8s %9s %11s %11s %11s %6s %6s %2s %6s %s\n", "max", "wait_max", "total", "wait_total", "count", "avg", "wait_avg", "cnt_hold", "cnt_lock", "name"); enabled = lock_prof_enable; @@ -411,16 +406,13 @@ retry_sbufops: continue; lock_prof_type_stats(&lp_cpu[cpu]->lpc_types[0], sb, 0, t); lock_prof_type_stats(&lp_cpu[cpu]->lpc_types[1], sb, 1, t); - if (sbuf_error(sb) != 0) { - sbuf_delete(sb); - multiplier++; - goto retry_sbufops; - } } lock_prof_enable = enabled; - sbuf_finish(sb); - error = SYSCTL_OUT(req, sbuf_data(sb), sbuf_len(sb) + 1); + error = sbuf_finish(sb); + /* Output a trailing NUL. */ + if (error == 0) + error = SYSCTL_OUT(req, "", 1); sbuf_delete(sb); return (error); } Modified: head/sys/kern/subr_sbuf.c ============================================================================== --- head/sys/kern/subr_sbuf.c Thu Sep 16 16:03:12 2010 (r212749) +++ head/sys/kern/subr_sbuf.c Thu Sep 16 16:13:12 2010 (r212750) @@ -303,8 +303,8 @@ sbuf_drain(struct sbuf *s) s->s_error = -len; return (s->s_error); } - - KASSERT(len > 0, ("Drain must either error or work!")); + KASSERT(len > 0 && len <= s->s_len, + ("Bad drain amount %d for sbuf %p", len, s)); s->s_len -= len; /* * Fast path for the expected case where all the data was Modified: head/sys/kern/subr_sleepqueue.c ============================================================================== --- head/sys/kern/subr_sleepqueue.c Thu Sep 16 16:03:12 2010 (r212749) +++ head/sys/kern/subr_sleepqueue.c Thu Sep 16 16:13:12 2010 (r212750) @@ -1018,7 +1018,7 @@ sleepq_abort(struct thread *td, int intr #ifdef SLEEPQUEUE_PROFILING #define SLEEPQ_PROF_LOCATIONS 1024 -#define SLEEPQ_SBUFSIZE (40 * 512) +#define SLEEPQ_SBUFSIZE 512 struct sleepq_prof { LIST_ENTRY(sleepq_prof) sp_link; const char *sp_wmesg; @@ -1123,15 +1123,13 @@ reset_sleepq_prof_stats(SYSCTL_HANDLER_A static int dump_sleepq_prof_stats(SYSCTL_HANDLER_ARGS) { - static int multiplier = 1; struct sleepq_prof *sp; struct sbuf *sb; int enabled; int error; int i; -retry_sbufops: - sb = sbuf_new(NULL, NULL, SLEEPQ_SBUFSIZE * multiplier, SBUF_FIXEDLEN); + sb = sbuf_new_for_sysctl(NULL, NULL, SLEEPQ_SBUFSIZE, req); sbuf_printf(sb, "\nwmesg\tcount\n"); enabled = prof_enabled; mtx_lock_spin(&sleepq_prof_lock); @@ -1141,19 +1139,13 @@ retry_sbufops: LIST_FOREACH(sp, &sleepq_hash[i], sp_link) { sbuf_printf(sb, "%s\t%ld\n", sp->sp_wmesg, sp->sp_count); - if (sbuf_error(sb) != 0) { - sbuf_delete(sb); - multiplier++; - goto retry_sbufops; - } } } mtx_lock_spin(&sleepq_prof_lock); prof_enabled = enabled; mtx_unlock_spin(&sleepq_prof_lock); - sbuf_finish(sb); - error = SYSCTL_OUT(req, sbuf_data(sb), sbuf_len(sb) + 1); + error = sbuf_finish(sb); sbuf_delete(sb); return (error); } Modified: head/sys/kern/subr_witness.c ============================================================================== --- head/sys/kern/subr_witness.c Thu Sep 16 16:03:12 2010 (r212749) +++ head/sys/kern/subr_witness.c Thu Sep 16 16:13:12 2010 (r212750) @@ -154,8 +154,7 @@ __FBSDID("$FreeBSD$"); #define MAX_W_NAME 64 #define BADSTACK_SBUF_SIZE (256 * WITNESS_COUNT) -#define CYCLEGRAPH_SBUF_SIZE 8192 -#define FULLGRAPH_SBUF_SIZE 32768 +#define FULLGRAPH_SBUF_SIZE 512 /* * These flags go in the witness relationship matrix and describe the @@ -2545,7 +2544,7 @@ sysctl_debug_witness_fullgraph(SYSCTL_HA return (error); } error = 0; - sb = sbuf_new(NULL, NULL, FULLGRAPH_SBUF_SIZE, SBUF_FIXEDLEN); + sb = sbuf_new_for_sysctl(NULL, NULL, FULLGRAPH_SBUF_SIZE, req); if (sb == NULL) return (ENOMEM); sbuf_printf(sb, "\n"); @@ -2558,19 +2557,9 @@ sysctl_debug_witness_fullgraph(SYSCTL_HA mtx_unlock_spin(&w_mtx); /* - * While using SBUF_FIXEDLEN, check if the sbuf overflowed. - */ - if (sbuf_error(sb) != 0) { - sbuf_delete(sb); - panic("%s: sbuf overflowed, bump FULLGRAPH_SBUF_SIZE value\n", - __func__); - } - - /* * Close the sbuf and return to userland. */ - sbuf_finish(sb); - error = SYSCTL_OUT(req, sbuf_data(sb), sbuf_len(sb) + 1); + error = sbuf_finish(sb); sbuf_delete(sb); return (error); Modified: head/sys/sys/sysctl.h ============================================================================== --- head/sys/sys/sysctl.h Thu Sep 16 16:03:12 2010 (r212749) +++ head/sys/sys/sysctl.h Thu Sep 16 16:13:12 2010 (r212750) @@ -710,6 +710,9 @@ void sysctl_lock(void); void sysctl_unlock(void); int sysctl_wire_old_buffer(struct sysctl_req *req, size_t len); +struct sbuf; +struct sbuf *sbuf_new_for_sysctl(struct sbuf *, char *, int, + struct sysctl_req *); #else /* !_KERNEL */ #include Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Thu Sep 16 16:03:12 2010 (r212749) +++ head/sys/vm/uma_core.c Thu Sep 16 16:13:12 2010 (r212750) @@ -3175,36 +3175,16 @@ sysctl_vm_zone_stats(SYSCTL_HANDLER_ARGS uma_keg_t kz; uma_zone_t z; uma_keg_t k; - char *buffer; - int buflen, count, error, i; + int count, error, i; - mtx_lock(&uma_mtx); -restart: - mtx_assert(&uma_mtx, MA_OWNED); - count = 0; - LIST_FOREACH(kz, &uma_kegs, uk_link) { - LIST_FOREACH(z, &kz->uk_zones, uz_link) - count++; - } - mtx_unlock(&uma_mtx); - - buflen = sizeof(ush) + count * (sizeof(uth) + sizeof(ups) * - (mp_maxid + 1)) + 1; - buffer = malloc(buflen, M_TEMP, M_WAITOK | M_ZERO); + sbuf_new_for_sysctl(&sbuf, NULL, 128, req); + count = 0; mtx_lock(&uma_mtx); - i = 0; LIST_FOREACH(kz, &uma_kegs, uk_link) { LIST_FOREACH(z, &kz->uk_zones, uz_link) - i++; - } - if (i > count) { - free(buffer, M_TEMP); - goto restart; + count++; } - count = i; - - sbuf_new(&sbuf, buffer, buflen, SBUF_FIXEDLEN); /* * Insert stream header. @@ -3213,11 +3193,7 @@ restart: ush.ush_version = UMA_STREAM_VERSION; ush.ush_maxcpus = (mp_maxid + 1); ush.ush_count = count; - if (sbuf_bcat(&sbuf, &ush, sizeof(ush)) < 0) { - mtx_unlock(&uma_mtx); - error = ENOMEM; - goto out; - } + (void)sbuf_bcat(&sbuf, &ush, sizeof(ush)); LIST_FOREACH(kz, &uma_kegs, uk_link) { LIST_FOREACH(z, &kz->uk_zones, uz_link) { @@ -3250,12 +3226,7 @@ restart: uth.uth_frees = z->uz_frees; uth.uth_fails = z->uz_fails; uth.uth_sleeps = z->uz_sleeps; - if (sbuf_bcat(&sbuf, &uth, sizeof(uth)) < 0) { - ZONE_UNLOCK(z); - mtx_unlock(&uma_mtx); - error = ENOMEM; - goto out; - } + (void)sbuf_bcat(&sbuf, &uth, sizeof(uth)); /* * While it is not normally safe to access the cache * bucket pointers while not on the CPU that owns the @@ -3280,21 +3251,14 @@ restart: ups.ups_allocs = cache->uc_allocs; ups.ups_frees = cache->uc_frees; skip: - if (sbuf_bcat(&sbuf, &ups, sizeof(ups)) < 0) { - ZONE_UNLOCK(z); - mtx_unlock(&uma_mtx); - error = ENOMEM; - goto out; - } + (void)sbuf_bcat(&sbuf, &ups, sizeof(ups)); } ZONE_UNLOCK(z); } } mtx_unlock(&uma_mtx); - sbuf_finish(&sbuf); - error = SYSCTL_OUT(req, sbuf_data(&sbuf), sbuf_len(&sbuf)); -out: - free(buffer, M_TEMP); + error = sbuf_finish(&sbuf); + sbuf_delete(&sbuf); return (error); } Modified: head/sys/vm/vm_phys.c ============================================================================== --- head/sys/vm/vm_phys.c Thu Sep 16 16:03:12 2010 (r212749) +++ head/sys/vm/vm_phys.c Thu Sep 16 16:13:12 2010 (r212750) @@ -123,12 +123,9 @@ sysctl_vm_phys_free(SYSCTL_HANDLER_ARGS) { struct sbuf sbuf; struct vm_freelist *fl; - char *cbuf; - const int cbufsize = vm_nfreelists*(VM_NFREEORDER + 1)*81; int error, flind, oind, pind; - cbuf = malloc(cbufsize, M_TEMP, M_WAITOK | M_ZERO); - sbuf_new(&sbuf, cbuf, cbufsize, SBUF_FIXEDLEN); + sbuf_new_for_sysctl(&sbuf, NULL, 128, req); for (flind = 0; flind < vm_nfreelists; flind++) { sbuf_printf(&sbuf, "\nFREE LIST %d:\n" "\n ORDER (SIZE) | NUMBER" @@ -149,10 +146,8 @@ sysctl_vm_phys_free(SYSCTL_HANDLER_ARGS) sbuf_printf(&sbuf, "\n"); } } - sbuf_finish(&sbuf); - error = SYSCTL_OUT(req, sbuf_data(&sbuf), sbuf_len(&sbuf)); + error = sbuf_finish(&sbuf); sbuf_delete(&sbuf); - free(cbuf, M_TEMP); return (error); } @@ -164,12 +159,9 @@ sysctl_vm_phys_segs(SYSCTL_HANDLER_ARGS) { struct sbuf sbuf; struct vm_phys_seg *seg; - char *cbuf; - const int cbufsize = VM_PHYSSEG_MAX*(VM_NFREEORDER + 1)*81; int error, segind; - cbuf = malloc(cbufsize, M_TEMP, M_WAITOK | M_ZERO); - sbuf_new(&sbuf, cbuf, cbufsize, SBUF_FIXEDLEN); + sbuf_new_for_sysctl(&sbuf, NULL, 128, req); for (segind = 0; segind < vm_phys_nsegs; segind++) { sbuf_printf(&sbuf, "\nSEGMENT %d:\n\n", segind); seg = &vm_phys_segs[segind]; @@ -180,10 +172,8 @@ sysctl_vm_phys_segs(SYSCTL_HANDLER_ARGS) sbuf_printf(&sbuf, "domain: %d\n", seg->domain); sbuf_printf(&sbuf, "free list: %p\n", seg->free_queues); } - sbuf_finish(&sbuf); - error = SYSCTL_OUT(req, sbuf_data(&sbuf), sbuf_len(&sbuf)); + error = sbuf_finish(&sbuf); sbuf_delete(&sbuf); - free(cbuf, M_TEMP); return (error); } @@ -195,23 +185,18 @@ static int sysctl_vm_phys_lookup_lists(SYSCTL_HANDLER_ARGS) { struct sbuf sbuf; - char *cbuf; - const int cbufsize = (vm_nfreelists + 1) * VM_NDOMAIN * 81; int domain, error, flind, ndomains; ndomains = vm_nfreelists - VM_NFREELIST + 1; - cbuf = malloc(cbufsize, M_TEMP, M_WAITOK | M_ZERO); - sbuf_new(&sbuf, cbuf, cbufsize, SBUF_FIXEDLEN); + sbuf_new_for_sysctl(&sbuf, NULL, 128, req); for (domain = 0; domain < ndomains; domain++) { sbuf_printf(&sbuf, "\nDOMAIN %d:\n\n", domain); for (flind = 0; flind < vm_nfreelists; flind++) sbuf_printf(&sbuf, " [%d]:\t%p\n", flind, vm_phys_lookup_lists[domain][flind]); } - sbuf_finish(&sbuf); - error = SYSCTL_OUT(req, sbuf_data(&sbuf), sbuf_len(&sbuf)); + error = sbuf_finish(&sbuf); sbuf_delete(&sbuf); - free(cbuf, M_TEMP); return (error); } #endif Modified: head/sys/vm/vm_reserv.c ============================================================================== --- head/sys/vm/vm_reserv.c Thu Sep 16 16:03:12 2010 (r212749) +++ head/sys/vm/vm_reserv.c Thu Sep 16 16:13:12 2010 (r212750) @@ -180,12 +180,9 @@ sysctl_vm_reserv_partpopq(SYSCTL_HANDLER { struct sbuf sbuf; vm_reserv_t rv; - char *cbuf; - const int cbufsize = (VM_NRESERVLEVEL + 1) * 81; int counter, error, level, unused_pages; - cbuf = malloc(cbufsize, M_TEMP, M_WAITOK | M_ZERO); - sbuf_new(&sbuf, cbuf, cbufsize, SBUF_FIXEDLEN); + sbuf_new_for_sysctl(&sbuf, NULL, 128, req); sbuf_printf(&sbuf, "\nLEVEL SIZE NUMBER\n\n"); for (level = -1; level <= VM_NRESERVLEVEL - 2; level++) { counter = 0; @@ -199,10 +196,8 @@ sysctl_vm_reserv_partpopq(SYSCTL_HANDLER sbuf_printf(&sbuf, "%5.5d: %6.6dK, %6.6d\n", level, unused_pages * (PAGE_SIZE / 1024), counter); } - sbuf_finish(&sbuf); - error = SYSCTL_OUT(req, sbuf_data(&sbuf), sbuf_len(&sbuf)); + error = sbuf_finish(&sbuf); sbuf_delete(&sbuf); - free(cbuf, M_TEMP); return (error); } From owner-svn-src-head@FreeBSD.ORG Thu Sep 16 17:24:26 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 384E7106566C; Thu, 16 Sep 2010 17:24:26 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2829D8FC08; Thu, 16 Sep 2010 17:24:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8GHOQTx001269; Thu, 16 Sep 2010 17:24:26 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8GHOQTc001267; Thu, 16 Sep 2010 17:24:26 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201009161724.o8GHOQTc001267@svn.freebsd.org> From: Alexander Motin Date: Thu, 16 Sep 2010 17:24:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212754 - head/sys/geom/concat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Sep 2010 17:24:26 -0000 Author: mav Date: Thu Sep 16 17:24:25 2010 New Revision: 212754 URL: http://svn.freebsd.org/changeset/base/212754 Log: Add support for dumping kernel to gconcat. Dumping goes to the component, where dump partition begins. Modified: head/sys/geom/concat/g_concat.c Modified: head/sys/geom/concat/g_concat.c ============================================================================== --- head/sys/geom/concat/g_concat.c Thu Sep 16 17:08:46 2010 (r212753) +++ head/sys/geom/concat/g_concat.c Thu Sep 16 17:24:25 2010 (r212754) @@ -212,6 +212,39 @@ g_concat_access(struct g_provider *pp, i } static void +g_concat_kernel_dump(struct bio *bp) +{ + struct g_concat_softc *sc; + struct g_concat_disk *disk; + struct bio *cbp; + struct g_kerneldump *gkd; + u_int i; + + sc = bp->bio_to->geom->softc; + gkd = (struct g_kerneldump *)bp->bio_data; + for (i = 0; i < sc->sc_ndisks; i++) { + if (sc->sc_disks[i].d_start <= gkd->offset && + sc->sc_disks[i].d_end > gkd->offset) + break; + } + if (i == sc->sc_ndisks) + g_io_deliver(bp, EOPNOTSUPP); + disk = &sc->sc_disks[i]; + gkd->offset -= disk->d_start; + if (gkd->length > disk->d_end - disk->d_start - gkd->offset) + gkd->length = disk->d_end - disk->d_start - gkd->offset; + cbp = g_clone_bio(bp); + if (cbp == NULL) { + g_io_deliver(bp, ENOMEM); + return; + } + cbp->bio_done = g_std_done; + g_io_request(cbp, disk->d_consumer); + G_CONCAT_DEBUG(1, "Kernel dump will go to %s.", + disk->d_consumer->provider->name); +} + +static void g_concat_flush(struct g_concat_softc *sc, struct bio *bp) { struct bio_queue_head queue; @@ -280,7 +313,12 @@ g_concat_start(struct bio *bp) g_concat_flush(sc, bp); return; case BIO_GETATTR: + if (strcmp("GEOM::kerneldump", bp->bio_attribute) == 0) { + g_concat_kernel_dump(bp); + return; + } /* To which provider it should be delivered? */ + /* FALLTHROUGH */ default: g_io_deliver(bp, EOPNOTSUPP); return; From owner-svn-src-head@FreeBSD.ORG Thu Sep 16 17:32:37 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D64E81065744; Thu, 16 Sep 2010 17:32:37 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C644C8FC0A; Thu, 16 Sep 2010 17:32:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8GHWbGB001496; Thu, 16 Sep 2010 17:32:37 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8GHWbAL001494; Thu, 16 Sep 2010 17:32:37 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201009161732.o8GHWbAL001494@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 16 Sep 2010 17:32:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212755 - head/sys/dev/bge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Sep 2010 17:32:37 -0000 Author: yongari Date: Thu Sep 16 17:32:37 2010 New Revision: 212755 URL: http://svn.freebsd.org/changeset/base/212755 Log: Fix incorrect RX BD producer updates. The producer index was already updated after allocating mbuf so driver had to use the last index instead of using next producer index. This should fix driver hang which may happen under high network load. Reported by: Igor Sysoev rambler-co dot ru>, Vlad Galu dudu dot ro> Tested by: Igor Sysoev rambler-co dot ru>, Vlad Galu dudu dot ro> MFC after: 10 days Modified: head/sys/dev/bge/if_bge.c Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Thu Sep 16 17:24:25 2010 (r212754) +++ head/sys/dev/bge/if_bge.c Thu Sep 16 17:32:37 2010 (r212755) @@ -3386,9 +3386,11 @@ bge_rxeof(struct bge_softc *sc, uint16_t sc->bge_rx_saved_considx = rx_cons; bge_writembx(sc, BGE_MBX_RX_CONS0_LO, sc->bge_rx_saved_considx); if (stdcnt) - bge_writembx(sc, BGE_MBX_RX_STD_PROD_LO, sc->bge_std); + bge_writembx(sc, BGE_MBX_RX_STD_PROD_LO, (sc->bge_std + + BGE_STD_RX_RING_CNT - 1) % BGE_STD_RX_RING_CNT); if (jumbocnt) - bge_writembx(sc, BGE_MBX_RX_JUMBO_PROD_LO, sc->bge_jumbo); + bge_writembx(sc, BGE_MBX_RX_JUMBO_PROD_LO, (sc->bge_jumbo + + BGE_JUMBO_RX_RING_CNT - 1) % BGE_JUMBO_RX_RING_CNT); #ifdef notyet /* * This register wraps very quickly under heavy packet drops. From owner-svn-src-head@FreeBSD.ORG Thu Sep 16 17:49:10 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 79A801065694; Thu, 16 Sep 2010 17:49:10 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4F47D8FC12; Thu, 16 Sep 2010 17:49:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8GHnAG5002029; Thu, 16 Sep 2010 17:49:10 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8GHnA3g002027; Thu, 16 Sep 2010 17:49:10 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201009161749.o8GHnA3g002027@svn.freebsd.org> From: Attilio Rao Date: Thu, 16 Sep 2010 17:49:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212756 - head/sys/dev/aac X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Sep 2010 17:49:10 -0000 Author: attilio Date: Thu Sep 16 17:49:10 2010 New Revision: 212756 URL: http://svn.freebsd.org/changeset/base/212756 Log: Implement device unbusying via a cdevpriv destructor. Suggested by: jhb Tested by: Mark Johnston Reviewed by: emaste, jhb MFC after: 10 days X-MFC: r212661 Modified: head/sys/dev/aac/aac.c Modified: head/sys/dev/aac/aac.c ============================================================================== --- head/sys/dev/aac/aac.c Thu Sep 16 17:32:37 2010 (r212755) +++ head/sys/dev/aac/aac.c Thu Sep 16 17:49:10 2010 (r212756) @@ -189,9 +189,9 @@ static char *aac_describe_code(struct aa /* Management Interface */ static d_open_t aac_open; -static d_close_t aac_close; static d_ioctl_t aac_ioctl; static d_poll_t aac_poll; +static void aac_cdevpriv_dtor(void *arg); static int aac_ioctl_sendfib(struct aac_softc *sc, caddr_t ufib); static int aac_ioctl_send_raw_srb(struct aac_softc *sc, caddr_t arg); static void aac_handle_aif(struct aac_softc *sc, @@ -212,9 +212,8 @@ static struct aac_mntinforesp * static struct cdevsw aac_cdevsw = { .d_version = D_VERSION, - .d_flags = D_NEEDGIANT | D_TRACKCLOSE, + .d_flags = D_NEEDGIANT, .d_open = aac_open, - .d_close = aac_close, .d_ioctl = aac_ioctl, .d_poll = aac_poll, .d_name = "aac", @@ -2802,18 +2801,7 @@ aac_open(struct cdev *dev, int flags, in sc = dev->si_drv1; fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); device_busy(sc->aac_dev); - - return 0; -} - -static int -aac_close(struct cdev *dev, int flags, int fmt, struct thread *td) -{ - struct aac_softc *sc; - - sc = dev->si_drv1; - fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); - device_unbusy(sc->aac_dev); + devfs_set_cdevpriv(sc, aac_cdevpriv_dtor); return 0; } @@ -3201,6 +3189,21 @@ out: } /* + * cdevpriv interface private destructor. + */ +static void +aac_cdevpriv_dtor(void *arg) +{ + struct aac_softc *sc; + + sc = arg; + fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); + mtx_lock(&Giant); + device_unbusy(sc->aac_dev); + mtx_unlock(&Giant); +} + +/* * Handle an AIF sent to us by the controller; queue it for later reference. * If the queue fills up, then drop the older entries. */ From owner-svn-src-head@FreeBSD.ORG Thu Sep 16 18:37:33 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DC6551065670; Thu, 16 Sep 2010 18:37:33 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CCC798FC12; Thu, 16 Sep 2010 18:37:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8GIbX9G003385; Thu, 16 Sep 2010 18:37:33 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8GIbXis003383; Thu, 16 Sep 2010 18:37:33 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201009161837.o8GIbXis003383@svn.freebsd.org> From: Jung-uk Kim Date: Thu, 16 Sep 2010 18:37:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212757 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Sep 2010 18:37:34 -0000 Author: jkim Date: Thu Sep 16 18:37:33 2010 New Revision: 212757 URL: http://svn.freebsd.org/changeset/base/212757 Log: Fix a typo in a comment. Submitted by: afiveg Modified: head/sys/net/bpf.c Modified: head/sys/net/bpf.c ============================================================================== --- head/sys/net/bpf.c Thu Sep 16 17:49:10 2010 (r212756) +++ head/sys/net/bpf.c Thu Sep 16 18:37:33 2010 (r212757) @@ -1392,7 +1392,7 @@ bpfioctl(struct cdev *dev, u_long cmd, c break; /* - * Set packet timestamp format and resolution. + * Get packet timestamp format and resolution. */ case BIOCGTSTAMP: *(u_int *)addr = d->bd_tstamp; From owner-svn-src-head@FreeBSD.ORG Thu Sep 16 19:13:55 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B697A106564A; Thu, 16 Sep 2010 19:13:55 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A531B8FC1B; Thu, 16 Sep 2010 19:13:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8GJDtKt004201; Thu, 16 Sep 2010 19:13:55 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8GJDtOo004197; Thu, 16 Sep 2010 19:13:55 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201009161913.o8GJDtOo004197@svn.freebsd.org> From: "Jayachandran C." Date: Thu, 16 Sep 2010 19:13:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212758 - in head/sys/mips/rmi: . dev/nlge dev/xlr X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Sep 2010 19:13:55 -0000 Author: jchandra Date: Thu Sep 16 19:13:55 2010 New Revision: 212758 URL: http://svn.freebsd.org/changeset/base/212758 Log: Network driver updates. - Move RMI MIPS extension to atomic increment word (LDADDWU) to common header file sys/mips/rmi/rmi_mips_exts.h - Fix xlr_ldaddwu() for 64 bit, it is a 32 bit operation, use unsigned int* instead of unsigned long* argument - Provide dummy xlr_enable_kx/xlr_restore_kx for n32 and n64. - Provide xlr_paddr_ld() instead of xlr_paddr_lw(), so that the descriptor formats are same for 32 and 64 bit - update nlge and rge for the changes These changes are also needed by the security driver which will be added later. Modified: head/sys/mips/rmi/dev/nlge/if_nlge.c head/sys/mips/rmi/dev/xlr/rge.c head/sys/mips/rmi/rmi_mips_exts.h Modified: head/sys/mips/rmi/dev/nlge/if_nlge.c ============================================================================== --- head/sys/mips/rmi/dev/nlge/if_nlge.c Thu Sep 16 18:37:33 2010 (r212757) +++ head/sys/mips/rmi/dev/nlge/if_nlge.c Thu Sep 16 19:13:55 2010 (r212758) @@ -300,31 +300,13 @@ DRIVER_MODULE(miibus, nlge, miibus_drive static uma_zone_t nl_tx_desc_zone; -/* Function to atomically increment an integer with the given value. */ -static __inline__ unsigned int -ldadd_wu(unsigned int value, unsigned long *addr) -{ - __asm__ __volatile__( ".set push\n" - ".set noreorder\n" - "move $8, %2\n" - "move $9, %3\n" - /* "ldaddwu $8, $9\n" */ - ".word 0x71280011\n" - "move %0, $8\n" - ".set pop\n" - : "=&r"(value), "+m"(*addr) - : "0"(value), "r" ((unsigned long)addr) - : "$8", "$9"); - return value; -} - -static __inline__ uint32_t -xlr_enable_kx(void) +static __inline void +atomic_incr_long(unsigned long *addr) { - uint32_t sr = mips_rd_status(); + /* XXX: fix for 64 bit */ + unsigned int *iaddr = (unsigned int *)addr; - mips_wr_status((sr & ~MIPS_SR_INT_IE) | MIPS_SR_KX); - return sr; + xlr_ldaddwu(1, iaddr); } static int @@ -683,7 +665,7 @@ nlge_msgring_handler(int bucket, int siz if (ifp->if_drv_flags & IFF_DRV_OACTIVE){ ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; } - ldadd_wu(1, (tx_error) ? &ifp->if_oerrors: &ifp->if_opackets); + atomic_incr_long((tx_error) ? &ifp->if_oerrors: &ifp->if_opackets); } else if (ctrl == CTRL_SNGL || ctrl == CTRL_START) { /* Rx Packet */ @@ -766,7 +748,7 @@ fail: //ifp->if_drv_flags |= IFF_DRV_OACTIVE; //IF_PREPEND(&ifp->if_snd, m); m_freem(m); - ldadd_wu(1, &ifp->if_iqdrops); + atomic_incr_long(&ifp->if_iqdrops); } return; } @@ -774,14 +756,15 @@ fail: static void nlge_rx(struct nlge_softc *sc, vm_paddr_t paddr, int len) { - struct ifnet *ifp; - struct mbuf *m; - uint32_t tm, mag, sr; + struct ifnet *ifp; + struct mbuf *m; + uint64_t tm, mag; + uint32_t sr; sr = xlr_enable_kx(); - tm = xlr_paddr_lw(paddr - XLR_CACHELINE_SIZE); - mag = xlr_paddr_lw(paddr - XLR_CACHELINE_SIZE + sizeof(uint32_t)); - mips_wr_status(sr); + tm = xlr_paddr_ld(paddr - XLR_CACHELINE_SIZE); + mag = xlr_paddr_ld(paddr - XLR_CACHELINE_SIZE + sizeof(uint64_t)); + xlr_restore_kx(sr); m = (struct mbuf *)(intptr_t)tm; if (mag != 0xf00bad) { @@ -797,7 +780,7 @@ nlge_rx(struct nlge_softc *sc, vm_paddr_ m->m_pkthdr.len = m->m_len = len; m->m_pkthdr.rcvif = ifp; - ldadd_wu(1, &ifp->if_ipackets); + atomic_incr_long(&ifp->if_ipackets); (*ifp->if_input)(ifp, m); } @@ -1895,15 +1878,11 @@ prepare_fmn_message(struct nlge_softc *s return 2; } /* - * As we currently use xlr_paddr_lw on a 32-bit - * OS, both the pointers are laid out in one - * 64-bit location - this makes it easy to - * retrieve the pointers when processing the - * tx free-back descriptor. + * Save the virtual address in the descriptor, + * it makes freeing easy. */ p2p->frag[XLR_MAX_TX_FRAGS] = - (((uint64_t) (vm_offset_t) p2p) << 32) | - ((vm_offset_t) mbuf_chain); + (uint64_t)(vm_offset_t)p2p; cur_p2d = &p2p->frag[0]; is_p2p = 1; } else if (msg_sz == (FMN_SZ - 2 + XLR_MAX_TX_FRAGS)) { @@ -1932,7 +1911,7 @@ prepare_fmn_message(struct nlge_softc *s cur_p2d[-1] |= (1ULL << 63); /* set eop in most-recent p2d */ *cur_p2d = (1ULL << 63) | ((uint64_t)fb_stn_id << 54) | - (vm_offset_t) mbuf_chain; + (vm_offset_t) mbuf_chain; /* XXX: fix 64 bit */ *tx_desc = p2p; if (is_p2p) { @@ -1973,39 +1952,41 @@ release_tx_desc(vm_paddr_t paddr) { struct nlge_tx_desc *tx_desc; uint32_t sr; - uint32_t val1, val2; + uint64_t vaddr; paddr += (XLR_MAX_TX_FRAGS * sizeof(uint64_t)); sr = xlr_enable_kx(); - val1 = xlr_paddr_lw(paddr); - paddr += sizeof(void *); - val2 = xlr_paddr_lw(paddr); - mips_wr_status(sr); + vaddr = xlr_paddr_ld(paddr); + xlr_restore_kx(sr); - tx_desc = (struct nlge_tx_desc*)(intptr_t) val1; + tx_desc = (struct nlge_tx_desc*)(intptr_t)vaddr; uma_zfree(nl_tx_desc_zone, tx_desc); } static void * get_buf(void) { - struct mbuf *m_new; - vm_paddr_t temp1, temp2; - unsigned int *md; + struct mbuf *m_new; + uint64_t *md; +#ifdef INVARIANTS + vm_paddr_t temp1, temp2; +#endif if ((m_new = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR)) == NULL) - return NULL; + return (NULL); m_new->m_len = m_new->m_pkthdr.len = MCLBYTES; m_adj(m_new, XLR_CACHELINE_SIZE - ((unsigned int)m_new->m_data & 0x1f)); - md = (unsigned int *)m_new->m_data; - md[0] = (unsigned int)m_new; /* Back Ptr */ + md = (uint64_t *)m_new->m_data; + md[0] = (intptr_t)m_new; /* Back Ptr */ md[1] = 0xf00bad; m_adj(m_new, XLR_CACHELINE_SIZE); +#ifdef INVARIANTS temp1 = vtophys((vm_offset_t) m_new->m_data); temp2 = vtophys((vm_offset_t) m_new->m_data + 1536); if ((temp1 + 1536) != temp2) panic("ALLOCED BUFFER IS NOT CONTIGUOUS\n"); +#endif return ((void *)m_new->m_data); } Modified: head/sys/mips/rmi/dev/xlr/rge.c ============================================================================== --- head/sys/mips/rmi/dev/xlr/rge.c Thu Sep 16 18:37:33 2010 (r212757) +++ head/sys/mips/rmi/dev/xlr/rge.c Thu Sep 16 19:13:55 2010 (r212758) @@ -184,35 +184,8 @@ int xlr_rge_tx_ok_done[MAXCPU]; int xlr_rge_rx_done[MAXCPU]; int xlr_rge_repl_done[MAXCPU]; -static __inline__ unsigned int -ldadd_wu(unsigned int value, unsigned long *addr) -{ - __asm__ __volatile__(".set push\n" - ".set noreorder\n" - "move $8, %2\n" - "move $9, %3\n" - /* "ldaddwu $8, $9\n" */ - ".word 0x71280011\n" - "move %0, $8\n" - ".set pop\n" - : "=&r"(value), "+m"(*addr) - : "0"(value), "r"((unsigned long)addr) - : "$8", "$9"); - - return value; -} - -static __inline__ uint32_t -xlr_enable_kx(void) -{ - uint32_t sr = mips_rd_status(); - - mips_wr_status((sr & ~MIPS_SR_INT_IE) | MIPS_SR_KX); - return sr; -} - /* #define mac_stats_add(x, val) ({(x) += (val);}) */ -#define mac_stats_add(x, val) ldadd_wu(val, &x) +#define mac_stats_add(x, val) xlr_ldaddwu(val, &x) #define XLR_MAX_CORE 8 #define RGE_LOCK_INIT(_sc, _name) \ @@ -611,25 +584,16 @@ static void free_buf(vm_paddr_t paddr) { struct mbuf *m; - uint32_t mag; -#ifdef __mips_n64 - uint64_t *vaddr; - - vaddr = (uint64_t *)MIPS_PHYS_TO_XKPHYS_CACHED(paddr); - m = (struct mbuf *)vaddr[0]; - mag = (uint32_t)vaddr[1]; -#else + uint64_t mag; uint32_t sr; sr = xlr_enable_kx(); - m = (struct mbuf *)(intptr_t)xlr_paddr_lw(paddr - XLR_CACHELINE_SIZE + sizeof(uint32_t)); - mag = xlr_paddr_lw(paddr - XLR_CACHELINE_SIZE + 3 * sizeof(uint32_t)); - mips_wr_status(sr); -#endif - + m = (struct mbuf *)(intptr_t)xlr_paddr_ld(paddr - XLR_CACHELINE_SIZE); + mag = xlr_paddr_ld(paddr - XLR_CACHELINE_SIZE + sizeof(uint64_t)); + xlr_restore_kx(sr); if (mag != 0xf00bad) { - printf("Something is wrong kseg:%lx found mag:%x not 0xf00bad\n", - (u_long)paddr, mag); + printf("Something is wrong kseg:%lx found mag:%lx not 0xf00bad\n", + (u_long)paddr, (u_long)mag); return; } if (m != NULL) @@ -2022,15 +1986,8 @@ static void rge_rx(struct rge_softc *sc, vm_paddr_t paddr, int len) { struct mbuf *m; - uint32_t mag; struct ifnet *ifp = sc->rge_ifp; -#ifdef __mips_n64 - uint64_t *vaddr; - - vaddr =(uint64_t *)MIPS_PHYS_TO_XKPHYS_CACHED(paddr - XLR_CACHELINE_SIZE); - m = (struct mbuf *)vaddr[0]; - mag = (uint32_t)vaddr[1]; -#else + uint64_t mag; uint32_t sr; /* * On 32 bit machines we use XKPHYS to get the values stores with @@ -2038,10 +1995,9 @@ rge_rx(struct rge_softc *sc, vm_paddr_t * KX is enabled to prevent this setting leaking to other code. */ sr = xlr_enable_kx(); - m = (struct mbuf *)(intptr_t)xlr_paddr_lw(paddr - XLR_CACHELINE_SIZE + sizeof(uint32_t)); - mag = xlr_paddr_lw(paddr - XLR_CACHELINE_SIZE + 3 * sizeof(uint32_t)); - mips_wr_status(sr); -#endif + m = (struct mbuf *)(intptr_t)xlr_paddr_ld(paddr - XLR_CACHELINE_SIZE); + mag = xlr_paddr_ld(paddr - XLR_CACHELINE_SIZE + sizeof(uint64_t)); + xlr_restore_kx(sr); if (mag != 0xf00bad) { /* somebody else packet Error - FIXME in intialization */ printf("cpu %d: *ERROR* Not my packet paddr %p\n", Modified: head/sys/mips/rmi/rmi_mips_exts.h ============================================================================== --- head/sys/mips/rmi/rmi_mips_exts.h Thu Sep 16 18:37:33 2010 (r212757) +++ head/sys/mips/rmi/rmi_mips_exts.h Thu Sep 16 19:13:55 2010 (r212758) @@ -348,7 +348,7 @@ write_c0_eimr64(uint64_t val) write_c0_register64(9, 7, val); } -static __inline__ int +static __inline int xlr_test_and_set(int *lock) { int oldval = 0; @@ -367,10 +367,10 @@ xlr_test_and_set(int *lock) : "$8", "$9" ); - return (oldval == 0 ? 1 /* success */ : 0 /* failure */ ); + return (oldval == 0 ? 1 /* success */ : 0 /* failure */); } -static __inline__ uint32_t +static __inline uint32_t xlr_mfcr(uint32_t reg) { uint32_t val; @@ -385,7 +385,7 @@ xlr_mfcr(uint32_t reg) return val; } -static __inline__ void +static __inline void xlr_mtcr(uint32_t reg, uint32_t val) { __asm__ __volatile__( @@ -396,26 +396,47 @@ xlr_mtcr(uint32_t reg, uint32_t val) : "$8", "$9"); } +/* + * Atomic increment a unsigned int + */ +static __inline unsigned int +xlr_ldaddwu(unsigned int value, unsigned int *addr) +{ + __asm__ __volatile__( + ".set push\n" + ".set noreorder\n" + "move $8, %2\n" + "move $9, %3\n" + ".word 0x71280011\n" /* ldaddwu $8, $9 */ + "move %0, $8\n" + ".set pop\n" + : "=&r"(value), "+m"(*addr) + : "0"(value), "r" ((unsigned long)addr) + : "$8", "$9"); + + return (value); +} + #if defined(__mips_n64) -static __inline__ uint32_t -xlr_paddr_lw(uint64_t paddr) +static __inline uint64_t +xlr_paddr_ld(uint64_t paddr) { paddr |= 0x9800000000000000ULL; - return (*(uint32_t *)(uintptr_t)paddr); + return (*(uint64_t *)(uintptr_t)paddr); } #elif defined(__mips_n32) -static __inline__ uint32_t -xlr_paddr_lw(uint64_t paddr) +static __inline uint64_t +xlr_paddr_ld(uint64_t paddr) { - uint32_t val; + uint64_t val; paddr |= 0x9800000000000000ULL; __asm__ __volatile__( ".set push \n\t" ".set mips64 \n\t" - "lw %0, 0(%1) \n\t" + "ld %0, 0(%1) \n\t" ".set pop \n" : "=r"(val) : "r"(paddr)); @@ -423,27 +444,62 @@ xlr_paddr_lw(uint64_t paddr) return (val); } #else -static __inline__ uint32_t -xlr_paddr_lw(uint64_t paddr) +static __inline uint32_t +xlr_paddr_ld(uint64_t paddr) { - uint32_t high, low, tmp; + uint32_t addrh, addrl; + uint32_t valh, vall; - high = 0x98000000 | (paddr >> 32); - low = paddr & 0xffffffff; + addrh = 0x98000000 | (paddr >> 32); + addrl = paddr & 0xffffffff; __asm__ __volatile__( ".set push \n\t" ".set mips64 \n\t" - "dsll32 %1, %1, 0 \n\t" - "dsll32 %2, %2, 0 \n\t" /* get rid of the */ - "dsrl32 %2, %2, 0 \n\t" /* sign extend */ - "or %1, %1, %2 \n\t" - "lw %0, 0(%1) \n\t" + "dsll32 %2, %2, 0 \n\t" + "dsll32 %3, %3, 0 \n\t" /* get rid of the */ + "dsrl32 %3, %3, 0 \n\t" /* sign extend */ + "or %2, %2, %3 \n\t" + "lw %0, 0(%2) \n\t" + "lw %1, 4(%2) \n\t" ".set pop \n" - : "=r"(tmp) - : "r"(high), "r"(low)); + : "=&r"(valh), "=r"(vall) + : "r"(addrh), "r"(addrl)); + + return (((uint64_t)valh << 32) | vall); +} +#endif + +/* + * XXX: Not really needed in n32 or n64, retain for now + */ +#if defined(__mips_n64) || defined(__mips_n32) +static __inline uint32_t +xlr_enable_kx(void) +{ + + return (0); +} + +static __inline void +xlr_restore_kx(uint32_t sr) +{ +} +#else +static __inline uint32_t +xlr_enable_kx(void) +{ + uint32_t sr = mips_rd_status(); + + mips_wr_status((sr & ~MIPS_SR_INT_IE) | MIPS_SR_KX); + return (sr); +} + +static __inline void +xlr_restore_kx(uint32_t sr) +{ - return tmp; + mips_wr_status(sr); } #endif From owner-svn-src-head@FreeBSD.ORG Thu Sep 16 19:25:25 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 46AC010657C5; Thu, 16 Sep 2010 19:25:25 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 369BB8FC21; Thu, 16 Sep 2010 19:25:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8GJPPm0004537; Thu, 16 Sep 2010 19:25:25 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8GJPPcB004535; Thu, 16 Sep 2010 19:25:25 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201009161925.o8GJPPcB004535@svn.freebsd.org> From: "Jayachandran C." Date: Thu, 16 Sep 2010 19:25:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212759 - head/sys/mips/rmi/dev/xlr X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Sep 2010 19:25:25 -0000 Author: jchandra Date: Thu Sep 16 19:25:24 2010 New Revision: 212759 URL: http://svn.freebsd.org/changeset/base/212759 Log: Update rge.h for r212758 - stats incremented using xlr_ldaddwu should be unsigned int. Modified: head/sys/mips/rmi/dev/xlr/rge.h Modified: head/sys/mips/rmi/dev/xlr/rge.h ============================================================================== --- head/sys/mips/rmi/dev/xlr/rge.h Thu Sep 16 19:13:55 2010 (r212758) +++ head/sys/mips/rmi/dev/xlr/rge.h Thu Sep 16 19:25:24 2010 (r212759) @@ -26,6 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * + * $FreeBSD$ * RMI_BSD */ #ifndef _RMI_RGE_H_ #define _RMI_RGE_H_ @@ -972,12 +973,12 @@ enum { }; struct rge_softc_stats { - unsigned long rx_frames; - unsigned long tx_frames; - unsigned long rx_packets; - unsigned long rx_bytes; - unsigned long tx_packets; - unsigned long tx_bytes; + unsigned int rx_frames; + unsigned int tx_frames; + unsigned int rx_packets; + unsigned int rx_bytes; + unsigned int tx_packets; + unsigned int tx_bytes; }; struct driver_data { From owner-svn-src-head@FreeBSD.ORG Thu Sep 16 20:08:01 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 060D11065674; Thu, 16 Sep 2010 20:08:01 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E60128FC1C; Thu, 16 Sep 2010 20:08:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8GK80I1005575; Thu, 16 Sep 2010 20:08:00 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8GK80Iq005537; Thu, 16 Sep 2010 20:08:00 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201009162008.o8GK80Iq005537@svn.freebsd.org> From: Jung-uk Kim Date: Thu, 16 Sep 2010 20:08:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212761 - in head: sys/conf sys/contrib/dev/acpica sys/contrib/dev/acpica/common sys/contrib/dev/acpica/compiler sys/contrib/dev/acpica/debugger sys/contrib/dev/acpica/events sys/contri... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Sep 2010 20:08:01 -0000 Author: jkim Date: Thu Sep 16 20:08:00 2010 New Revision: 212761 URL: http://svn.freebsd.org/changeset/base/212761 Log: Merge ACPICA 20100915. Added: head/sys/contrib/dev/acpica/hardware/hwpci.c - copied, changed from r212760, vendor-sys/acpica/dist/hardware/hwpci.c head/sys/contrib/dev/acpica/utilities/utxferror.c - copied, changed from r212760, vendor-sys/acpica/dist/utilities/utxferror.c Modified: head/sys/conf/files head/sys/contrib/dev/acpica/changes.txt head/sys/contrib/dev/acpica/common/adfile.c head/sys/contrib/dev/acpica/common/adisasm.c head/sys/contrib/dev/acpica/common/adwalk.c head/sys/contrib/dev/acpica/common/dmrestag.c head/sys/contrib/dev/acpica/common/getopt.c head/sys/contrib/dev/acpica/compiler/aslanalyze.c head/sys/contrib/dev/acpica/compiler/aslcompile.c head/sys/contrib/dev/acpica/compiler/aslcompiler.h head/sys/contrib/dev/acpica/compiler/aslerror.c head/sys/contrib/dev/acpica/compiler/aslfiles.c head/sys/contrib/dev/acpica/compiler/asllisting.c head/sys/contrib/dev/acpica/compiler/asllookup.c head/sys/contrib/dev/acpica/compiler/aslmain.c head/sys/contrib/dev/acpica/compiler/aslopcodes.c head/sys/contrib/dev/acpica/compiler/aslpredef.c head/sys/contrib/dev/acpica/compiler/aslrestype1.c head/sys/contrib/dev/acpica/compiler/aslrestype2d.c head/sys/contrib/dev/acpica/compiler/aslrestype2e.c head/sys/contrib/dev/acpica/compiler/aslrestype2w.c head/sys/contrib/dev/acpica/compiler/aslstartup.c head/sys/contrib/dev/acpica/compiler/dtcompile.c head/sys/contrib/dev/acpica/compiler/dtio.c head/sys/contrib/dev/acpica/debugger/dbexec.c head/sys/contrib/dev/acpica/events/evrgnini.c head/sys/contrib/dev/acpica/executer/exmutex.c head/sys/contrib/dev/acpica/include/acglobal.h head/sys/contrib/dev/acpica/include/achware.h head/sys/contrib/dev/acpica/include/aclocal.h head/sys/contrib/dev/acpica/include/acmacros.h head/sys/contrib/dev/acpica/include/acnamesp.h head/sys/contrib/dev/acpica/include/acpiosxf.h head/sys/contrib/dev/acpica/include/acpixf.h head/sys/contrib/dev/acpica/include/actypes.h head/sys/contrib/dev/acpica/include/acutils.h head/sys/contrib/dev/acpica/include/platform/acenv.h head/sys/contrib/dev/acpica/include/platform/acfreebsd.h head/sys/contrib/dev/acpica/include/platform/acgcc.h head/sys/contrib/dev/acpica/namespace/nsrepair2.c head/sys/contrib/dev/acpica/namespace/nsutils.c head/sys/contrib/dev/acpica/osunixxf.c head/sys/contrib/dev/acpica/tables/tbfadt.c head/sys/contrib/dev/acpica/tools/acpiexec/aecommon.h head/sys/contrib/dev/acpica/utilities/utdebug.c head/sys/contrib/dev/acpica/utilities/utmath.c head/sys/contrib/dev/acpica/utilities/utmisc.c head/sys/contrib/dev/acpica/utilities/utmutex.c head/sys/dev/acpica/Osd/OsdHardware.c head/sys/modules/acpi/acpi/Makefile head/usr.sbin/acpi/acpidb/Makefile head/usr.sbin/acpi/iasl/Makefile Directory Properties: head/sys/contrib/dev/acpica/ (props changed) Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Sep 16 19:43:32 2010 (r212760) +++ head/sys/conf/files Thu Sep 16 20:08:00 2010 (r212761) @@ -221,6 +221,7 @@ contrib/dev/acpica/executer/exsystem.c contrib/dev/acpica/executer/exutils.c optional acpi contrib/dev/acpica/hardware/hwacpi.c optional acpi contrib/dev/acpica/hardware/hwgpe.c optional acpi +contrib/dev/acpica/hardware/hwpci.c optional acpi contrib/dev/acpica/hardware/hwregs.c optional acpi contrib/dev/acpica/hardware/hwsleep.c optional acpi contrib/dev/acpica/hardware/hwtimer.c optional acpi @@ -289,6 +290,7 @@ contrib/dev/acpica/utilities/utosi.c op contrib/dev/acpica/utilities/utresrc.c optional acpi contrib/dev/acpica/utilities/utstate.c optional acpi contrib/dev/acpica/utilities/utxface.c optional acpi +contrib/dev/acpica/utilities/utxferror.c optional acpi contrib/ipfilter/netinet/fil.c optional ipfilter inet \ compile-with "${NORMAL_C} -I$S/contrib/ipfilter" contrib/ipfilter/netinet/ip_auth.c optional ipfilter inet \ Modified: head/sys/contrib/dev/acpica/changes.txt ============================================================================== --- head/sys/contrib/dev/acpica/changes.txt Thu Sep 16 19:43:32 2010 (r212760) +++ head/sys/contrib/dev/acpica/changes.txt Thu Sep 16 20:08:00 2010 (r212761) @@ -1,4 +1,68 @@ ---------------------------------------- +15 September 2010. Summary of changes for version 20100915: + +This release is available at www.acpica.org/downloads + +1) ACPI CA Core Subsystem: + +Removed the AcpiOsDerivePciId OSL interface. The various host implementations +of this function were not OS-dependent and are now obsolete and can be +removed from all host OSLs. This function has been replaced by +AcpiHwDerivePciId, which is now part of the ACPICA core code. +AcpiHwDerivePciId has been implemented without recursion. Adds one new +module, hwpci.c. ACPICA BZ 857. + +Implemented a dynamic repair for _HID and _CID strings. The following +problems are now repaired at runtime: 1) Remove a leading asterisk in the +string, and 2) the entire string is uppercased. Both repairs are in +accordance with the ACPI specification and will simplify host driver code. +ACPICA BZ 871. + +The ACPI_THREAD_ID type is no longer configurable, internally it is now +always UINT64. This simplifies the ACPICA code, especially any printf output. +UINT64 is the only common data type for all thread_id types across all +operating systems. It is now up to the host OSL to cast the native thread_id +type to UINT64 before returning the value to ACPICA (via AcpiOsGetThreadId). +Lin Ming, Bob Moore. + +Added the ACPI_INLINE type to enhance the ACPICA configuration. The "inline" +keyword is not standard across compilers, and this type allows inline to be +configured on a per-compiler basis. Lin Ming. + +Made the system global AcpiGbl_SystemAwakeAndRunning publically available. +Added an extern for this boolean in acpixf.h. Some hosts utilize this value +during suspend/restore operations. ACPICA BZ 869. + +All code that implements error/warning messages with the "ACPI:" prefix has +been moved to a new module, utxferror.c. + +The UINT64_OVERLAY was moved to utmath.c, which is the only module where it +is used. ACPICA BZ 829. Lin Ming, Bob Moore. + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 6.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and has a +much larger code and data size. + + Previous Release: + Non-Debug Version: 89.1K Code, 19.0K Data, 108.1K Total + Debug Version: 165.1K Code, 51.9K Data, 217.0K Total + Current Release: + Non-Debug Version: 89.9K Code, 19.0K Data, 108.9K Total + Debug Version: 166.3K Code, 52.1K Data, 218.4K Total + +2) iASL Compiler/Disassembler and Tools: + +iASL/Disassembler: Write ACPI errors to stderr instead of the output file. +This keeps the output files free of random error messages that may originate +from within the namespace/interpreter code. Used this opportunity to merge +all ACPI:-style messages into a single new module, utxferror.c. ACPICA BZ +866. Lin Ming, Bob Moore. + +Tools: update some printfs for ansi warnings on size_t. Handle width change +of size_t on 32-bit versus 64-bit generations. Lin Ming. + +---------------------------------------- 06 August 2010. Summary of changes for version 20100806: 1) ACPI CA Core Subsystem: Modified: head/sys/contrib/dev/acpica/common/adfile.c ============================================================================== --- head/sys/contrib/dev/acpica/common/adfile.c Thu Sep 16 19:43:32 2010 (r212760) +++ head/sys/contrib/dev/acpica/common/adfile.c Thu Sep 16 20:08:00 2010 (r212761) @@ -126,13 +126,13 @@ /* Local prototypes */ -INT32 +static INT32 AdWriteBuffer ( char *Filename, char *Buffer, UINT32 Length); -char FilenameBuf[20]; +static char FilenameBuf[20]; /****************************************************************************** @@ -190,7 +190,7 @@ AdGenerateFilename ( * ******************************************************************************/ -INT32 +static INT32 AdWriteBuffer ( char *Filename, char *Buffer, Modified: head/sys/contrib/dev/acpica/common/adisasm.c ============================================================================== --- head/sys/contrib/dev/acpica/common/adisasm.c Thu Sep 16 19:43:32 2010 (r212760) +++ head/sys/contrib/dev/acpica/common/adisasm.c Thu Sep 16 20:08:00 2010 (r212761) @@ -147,18 +147,18 @@ LsSetupNsList ( /* Local prototypes */ -void +static void AdCreateTableHeader ( char *Filename, ACPI_TABLE_HEADER *Table); -ACPI_STATUS +static ACPI_STATUS AdDeferredParse ( ACPI_PARSE_OBJECT *Op, UINT8 *Aml, UINT32 AmlLength); -ACPI_STATUS +static ACPI_STATUS AdParseDeferredOps ( ACPI_PARSE_OBJECT *Root); @@ -634,7 +634,7 @@ AdDisassemblerHeader ( * *****************************************************************************/ -void +static void AdCreateTableHeader ( char *Filename, ACPI_TABLE_HEADER *Table) @@ -781,7 +781,7 @@ AdDisplayTables ( * *****************************************************************************/ -ACPI_STATUS +static ACPI_STATUS AdDeferredParse ( ACPI_PARSE_OBJECT *Op, UINT8 *Aml, @@ -904,7 +904,7 @@ AdDeferredParse ( * *****************************************************************************/ -ACPI_STATUS +static ACPI_STATUS AdParseDeferredOps ( ACPI_PARSE_OBJECT *Root) { Modified: head/sys/contrib/dev/acpica/common/adwalk.c ============================================================================== --- head/sys/contrib/dev/acpica/common/adwalk.c Thu Sep 16 19:43:32 2010 (r212760) +++ head/sys/contrib/dev/acpica/common/adwalk.c Thu Sep 16 20:08:00 2010 (r212761) @@ -792,6 +792,7 @@ AcpiDmXrefDescendingOp ( ACPI_PARSE_OBJECT *NextOp; ACPI_NAMESPACE_NODE *Node; ACPI_OPERAND_OBJECT *Object; + UINT32 ParamCount = 0; WalkState = Info->WalkState; @@ -880,18 +881,13 @@ AcpiDmXrefDescendingOp ( if (Object) { ObjectType2 = Object->Common.Type; + if (ObjectType2 == ACPI_TYPE_METHOD) + { + ParamCount = Object->Method.ParamCount; + } } - if (ObjectType2 == ACPI_TYPE_METHOD) - { - AcpiDmAddToExternalList (Op, Path, ACPI_TYPE_METHOD, - Object->Method.ParamCount); - } - else - { - AcpiDmAddToExternalList (Op, Path, (UINT8) ObjectType2, 0); - } - + AcpiDmAddToExternalList (Op, Path, (UINT8) ObjectType2, ParamCount); Op->Common.Node = Node; } else Modified: head/sys/contrib/dev/acpica/common/dmrestag.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmrestag.c Thu Sep 16 19:43:32 2010 (r212760) +++ head/sys/contrib/dev/acpica/common/dmrestag.c Thu Sep 16 20:08:00 2010 (r212761) @@ -704,8 +704,8 @@ AcpiDmUpdateResourceName ( Name[0] = '_'; Name[1] = AcpiGbl_Prefix[AcpiGbl_NextPrefix]; - Name[2] = AcpiUtHexToAsciiChar (AcpiGbl_NextResourceId, 4); - Name[3] = AcpiUtHexToAsciiChar (AcpiGbl_NextResourceId, 0); + Name[2] = AcpiUtHexToAsciiChar ((UINT64) AcpiGbl_NextResourceId, 4); + Name[3] = AcpiUtHexToAsciiChar ((UINT64) AcpiGbl_NextResourceId, 0); /* Update globals for next name */ Modified: head/sys/contrib/dev/acpica/common/getopt.c ============================================================================== --- head/sys/contrib/dev/acpica/common/getopt.c Thu Sep 16 19:43:32 2010 (r212760) +++ head/sys/contrib/dev/acpica/common/getopt.c Thu Sep 16 20:08:00 2010 (r212761) @@ -126,7 +126,6 @@ int AcpiGbl_Opterr = 1; int AcpiGbl_Optind = 1; -int AcpiGbl_Optopt; char *AcpiGbl_Optarg; @@ -171,9 +170,7 @@ AcpiGetopt( /* Get the option */ - CurrentChar = - AcpiGbl_Optopt = - argv[AcpiGbl_Optind][CurrentCharPtr]; + CurrentChar = argv[AcpiGbl_Optind][CurrentCharPtr]; /* Make sure that the option is legal */ Modified: head/sys/contrib/dev/acpica/compiler/aslanalyze.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslanalyze.c Thu Sep 16 19:43:32 2010 (r212760) +++ head/sys/contrib/dev/acpica/compiler/aslanalyze.c Thu Sep 16 20:08:00 2010 (r212761) @@ -166,7 +166,7 @@ static UINT32 AnGetInternalMethodReturnType ( ACPI_PARSE_OBJECT *Op); -BOOLEAN +static BOOLEAN AnIsResultUsed ( ACPI_PARSE_OBJECT *Op); @@ -1754,7 +1754,7 @@ AnOperandTypecheckWalkEnd ( * ******************************************************************************/ -BOOLEAN +static BOOLEAN AnIsResultUsed ( ACPI_PARSE_OBJECT *Op) { @@ -1862,6 +1862,7 @@ AnOtherSemanticAnalysisWalkBegin ( if (Op->Asl.AmlOpcode == AML_DIVIDE_OP) { if ((ArgNode->Asl.ParseOpcode == PARSEOP_ZERO) && + (PrevArgNode) && (PrevArgNode->Asl.ParseOpcode == PARSEOP_ZERO)) { AslError (ASL_WARNING, ASL_MSG_RESULT_NOT_USED, Op, Op->Asl.ExternalName); Modified: head/sys/contrib/dev/acpica/compiler/aslcompile.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslcompile.c Thu Sep 16 19:43:32 2010 (r212760) +++ head/sys/contrib/dev/acpica/compiler/aslcompile.c Thu Sep 16 20:08:00 2010 (r212761) @@ -127,12 +127,12 @@ static void CmFlushSourceCode ( void); -void +static void FlConsumeAnsiComment ( ASL_FILE_INFO *FileInfo, ASL_FILE_STATUS *Status); -void +static void FlConsumeNewComment ( ASL_FILE_INFO *FileInfo, ASL_FILE_STATUS *Status); @@ -345,7 +345,7 @@ CmFlushSourceCode ( * ******************************************************************************/ -void +static void FlConsumeAnsiComment ( ASL_FILE_INFO *FileInfo, ASL_FILE_STATUS *Status) @@ -389,7 +389,7 @@ FlConsumeAnsiComment ( } -void +static void FlConsumeNewComment ( ASL_FILE_INFO *FileInfo, ASL_FILE_STATUS *Status) Modified: head/sys/contrib/dev/acpica/compiler/aslcompiler.h ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslcompiler.h Thu Sep 16 19:43:32 2010 (r212760) +++ head/sys/contrib/dev/acpica/compiler/aslcompiler.h Thu Sep 16 20:08:00 2010 (r212761) @@ -686,6 +686,10 @@ ACPI_STATUS LsDisplayNamespace ( void); +void +LsSetupNsList ( + void *Handle); + /* * aslutils - common compiler utilites Modified: head/sys/contrib/dev/acpica/compiler/aslerror.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslerror.c Thu Sep 16 19:43:32 2010 (r212760) +++ head/sys/contrib/dev/acpica/compiler/aslerror.c Thu Sep 16 20:08:00 2010 (r212761) @@ -304,7 +304,7 @@ AePrintException ( if (Enode->LineNumber) { - fprintf (OutputFile, "%6u: ", Enode->LineNumber); + fprintf (OutputFile, " %6u: ", Enode->LineNumber); /* * Seek to the offset in the combined source file, read the source @@ -358,7 +358,7 @@ AePrintException ( { /* Decode the message ID */ - fprintf (OutputFile, "%s %4.4d -", + fprintf (OutputFile, "%s %4.4d - ", AslErrorLevel[Enode->Level], Enode->MessageId + ((Enode->Level+1) * 1000)); Modified: head/sys/contrib/dev/acpica/compiler/aslfiles.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslfiles.c Thu Sep 16 19:43:32 2010 (r212760) +++ head/sys/contrib/dev/acpica/compiler/aslfiles.c Thu Sep 16 20:08:00 2010 (r212761) @@ -122,7 +122,7 @@ /* Local prototypes */ -FILE * +static FILE * FlOpenIncludeWithPrefix ( char *PrefixDir, char *Filename); @@ -546,7 +546,7 @@ FlAddIncludeDirectory ( * ******************************************************************************/ -FILE * +static FILE * FlOpenIncludeWithPrefix ( char *PrefixDir, char *Filename) Modified: head/sys/contrib/dev/acpica/compiler/asllisting.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/asllisting.c Thu Sep 16 19:43:32 2010 (r212760) +++ head/sys/contrib/dev/acpica/compiler/asllisting.c Thu Sep 16 20:08:00 2010 (r212761) @@ -202,7 +202,7 @@ static void LsDoHexOutputAsl ( void); -ACPI_STATUS +static ACPI_STATUS LsTreeWriteWalk ( ACPI_PARSE_OBJECT *Op, UINT32 Level, @@ -222,7 +222,7 @@ LsTreeWriteWalk ( * ******************************************************************************/ -ACPI_STATUS +static ACPI_STATUS LsTreeWriteWalk ( ACPI_PARSE_OBJECT *Op, UINT32 Level, Modified: head/sys/contrib/dev/acpica/compiler/asllookup.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/asllookup.c Thu Sep 16 19:43:32 2010 (r212760) +++ head/sys/contrib/dev/acpica/compiler/asllookup.c Thu Sep 16 20:08:00 2010 (r212761) @@ -180,11 +180,7 @@ LsDoOnePathname ( void *Context, void **ReturnValue); -void -LsSetupNsList ( - void *Handle); - -ACPI_PARSE_OBJECT * +static ACPI_PARSE_OBJECT * LkGetNameOp ( ACPI_PARSE_OBJECT *Op); @@ -623,7 +619,7 @@ LkObjectExists ( * ******************************************************************************/ -ACPI_PARSE_OBJECT * +static ACPI_PARSE_OBJECT * LkGetNameOp ( ACPI_PARSE_OBJECT *Op) { Modified: head/sys/contrib/dev/acpica/compiler/aslmain.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslmain.c Thu Sep 16 19:43:32 2010 (r212760) +++ head/sys/contrib/dev/acpica/compiler/aslmain.c Thu Sep 16 20:08:00 2010 (r212761) @@ -214,7 +214,7 @@ Options ( printf (" -cr Disable Resource Descriptor error checking\n"); printf (" -r Override table header Revision (1-255)\n"); - printf ("\nListings:\n"); + printf ("\nASL Listing Files:\n"); printf (" -l Create mixed listing file (ASL source and AML) (*.lst)\n"); printf (" -ln Create namespace file (*.nsp)\n"); printf (" -ls Create combined source file (expanded includes) (*.src)\n"); @@ -462,6 +462,7 @@ AslDoOptions ( BOOLEAN IsResponseFile) { int j; + ACPI_STATUS Status; /* Get the command line options */ @@ -554,7 +555,12 @@ AslDoOptions ( case 'e': - AcpiDmAddToExternalFileList (AcpiGbl_Optarg); + Status = AcpiDmAddToExternalFileList (AcpiGbl_Optarg); + if (ACPI_FAILURE (Status)) + { + printf ("Could not add %s to external list\n", AcpiGbl_Optarg); + return (-1); + } break; @@ -601,7 +607,6 @@ AslDoOptions ( printf ("Unknown option: -h%s\n", AcpiGbl_Optarg); return (-1); } - break; case 'I': /* Add an include file search directory */ @@ -891,6 +896,7 @@ AslCommandLine ( char **argv) { int BadCommandLine = 0; + ACPI_STATUS Status; /* Minimum command line contains at least the command and an input file */ @@ -908,7 +914,11 @@ AslCommandLine ( if (Gbl_DoTemplates) { - DtCreateTemplates (Gbl_TemplateSignature); + Status = DtCreateTemplates (Gbl_TemplateSignature); + if (ACPI_FAILURE (Status)) + { + exit (-1); + } exit (1); } Modified: head/sys/contrib/dev/acpica/compiler/aslopcodes.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslopcodes.c Thu Sep 16 19:43:32 2010 (r212760) +++ head/sys/contrib/dev/acpica/compiler/aslopcodes.c Thu Sep 16 20:08:00 2010 (r212761) @@ -592,9 +592,9 @@ OpcDoEisaId ( /* Create ID big-endian first (bits are contiguous) */ BigEndianId = - (UINT32) (InString[0] - 0x40) << 26 | - (UINT32) (InString[1] - 0x40) << 21 | - (UINT32) (InString[2] - 0x40) << 16 | + (UINT32) ((UINT8) (InString[0] - 0x40)) << 26 | + (UINT32) ((UINT8) (InString[1] - 0x40)) << 21 | + (UINT32) ((UINT8) (InString[2] - 0x40)) << 16 | (UtHexCharToValue (InString[3])) << 12 | (UtHexCharToValue (InString[4])) << 8 | Modified: head/sys/contrib/dev/acpica/compiler/aslpredef.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslpredef.c Thu Sep 16 19:43:32 2010 (r212760) +++ head/sys/contrib/dev/acpica/compiler/aslpredef.c Thu Sep 16 20:08:00 2010 (r212761) @@ -117,8 +117,6 @@ #include #include "aslcompiler.y.h" -#include -#include #include Modified: head/sys/contrib/dev/acpica/compiler/aslrestype1.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslrestype1.c Thu Sep 16 19:43:32 2010 (r212760) +++ head/sys/contrib/dev/acpica/compiler/aslrestype1.c Thu Sep 16 20:08:00 2010 (r212761) @@ -224,7 +224,6 @@ RsDoMemory24Descriptor ( ACPI_PARSE_OBJECT *MinOp = NULL; ACPI_PARSE_OBJECT *MaxOp = NULL; ACPI_PARSE_OBJECT *LengthOp = NULL; - ACPI_PARSE_OBJECT *AlignOp = NULL; ASL_RESOURCE_NODE *Rnode; UINT32 i; @@ -270,7 +269,6 @@ RsDoMemory24Descriptor ( Descriptor->Memory24.Alignment = (UINT16) InitializerOp->Asl.Value.Integer; RsCreateByteField (InitializerOp, ACPI_RESTAG_ALIGNMENT, CurrentByteOffset + ASL_RESDESC_OFFSET (Memory24.Alignment)); - AlignOp = InitializerOp; break; case 4: /* Length */ Modified: head/sys/contrib/dev/acpica/compiler/aslrestype2d.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslrestype2d.c Thu Sep 16 19:43:32 2010 (r212760) +++ head/sys/contrib/dev/acpica/compiler/aslrestype2d.c Thu Sep 16 20:08:00 2010 (r212761) @@ -347,10 +347,10 @@ RsDoDwordIoDescriptor ( /* Validate the Min/Max/Len/Gran values */ RsLargeAddressCheck ( - Descriptor->Address32.Minimum, - Descriptor->Address32.Maximum, - Descriptor->Address32.AddressLength, - Descriptor->Address32.Granularity, + (UINT64) Descriptor->Address32.Minimum, + (UINT64) Descriptor->Address32.Maximum, + (UINT64) Descriptor->Address32.AddressLength, + (UINT64) Descriptor->Address32.Granularity, Descriptor->Address32.Flags, MinOp, MaxOp, LengthOp, GranOp); @@ -583,10 +583,10 @@ RsDoDwordMemoryDescriptor ( /* Validate the Min/Max/Len/Gran values */ RsLargeAddressCheck ( - Descriptor->Address32.Minimum, - Descriptor->Address32.Maximum, - Descriptor->Address32.AddressLength, - Descriptor->Address32.Granularity, + (UINT64) Descriptor->Address32.Minimum, + (UINT64) Descriptor->Address32.Maximum, + (UINT64) Descriptor->Address32.AddressLength, + (UINT64) Descriptor->Address32.Granularity, Descriptor->Address32.Flags, MinOp, MaxOp, LengthOp, GranOp); @@ -801,10 +801,10 @@ RsDoDwordSpaceDescriptor ( /* Validate the Min/Max/Len/Gran values */ RsLargeAddressCheck ( - Descriptor->Address32.Minimum, - Descriptor->Address32.Maximum, - Descriptor->Address32.AddressLength, - Descriptor->Address32.Granularity, + (UINT64) Descriptor->Address32.Minimum, + (UINT64) Descriptor->Address32.Maximum, + (UINT64) Descriptor->Address32.AddressLength, + (UINT64) Descriptor->Address32.Granularity, Descriptor->Address32.Flags, MinOp, MaxOp, LengthOp, GranOp); Modified: head/sys/contrib/dev/acpica/compiler/aslrestype2e.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslrestype2e.c Thu Sep 16 19:43:32 2010 (r212760) +++ head/sys/contrib/dev/acpica/compiler/aslrestype2e.c Thu Sep 16 20:08:00 2010 (r212761) @@ -116,7 +116,6 @@ #include -#include "aslcompiler.y.h" #define _COMPONENT ACPI_COMPILER ACPI_MODULE_NAME ("aslrestype2e") Modified: head/sys/contrib/dev/acpica/compiler/aslrestype2w.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslrestype2w.c Thu Sep 16 19:43:32 2010 (r212760) +++ head/sys/contrib/dev/acpica/compiler/aslrestype2w.c Thu Sep 16 20:08:00 2010 (r212761) @@ -338,10 +338,10 @@ RsDoWordIoDescriptor ( /* Validate the Min/Max/Len/Gran values */ RsLargeAddressCheck ( - Descriptor->Address16.Minimum, - Descriptor->Address16.Maximum, - Descriptor->Address16.AddressLength, - Descriptor->Address16.Granularity, + (UINT64) Descriptor->Address16.Minimum, + (UINT64) Descriptor->Address16.Maximum, + (UINT64) Descriptor->Address16.AddressLength, + (UINT64) Descriptor->Address16.Granularity, Descriptor->Address16.Flags, MinOp, MaxOp, LengthOp, GranOp); @@ -544,10 +544,10 @@ RsDoWordBusNumberDescriptor ( /* Validate the Min/Max/Len/Gran values */ RsLargeAddressCheck ( - Descriptor->Address16.Minimum, - Descriptor->Address16.Maximum, - Descriptor->Address16.AddressLength, - Descriptor->Address16.Granularity, + (UINT64) Descriptor->Address16.Minimum, + (UINT64) Descriptor->Address16.Maximum, + (UINT64) Descriptor->Address16.AddressLength, + (UINT64) Descriptor->Address16.Granularity, Descriptor->Address16.Flags, MinOp, MaxOp, LengthOp, GranOp); @@ -761,10 +761,10 @@ RsDoWordSpaceDescriptor ( /* Validate the Min/Max/Len/Gran values */ RsLargeAddressCheck ( - Descriptor->Address16.Minimum, - Descriptor->Address16.Maximum, - Descriptor->Address16.AddressLength, - Descriptor->Address16.Granularity, + (UINT64) Descriptor->Address16.Minimum, + (UINT64) Descriptor->Address16.Maximum, + (UINT64) Descriptor->Address16.AddressLength, + (UINT64) Descriptor->Address16.Granularity, Descriptor->Address16.Flags, MinOp, MaxOp, LengthOp, GranOp); Modified: head/sys/contrib/dev/acpica/compiler/aslstartup.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslstartup.c Thu Sep 16 19:43:32 2010 (r212760) +++ head/sys/contrib/dev/acpica/compiler/aslstartup.c Thu Sep 16 20:08:00 2010 (r212761) @@ -124,9 +124,8 @@ #define ASL_MAX_FILES 256 -char *FileList[ASL_MAX_FILES]; -int FileCount; -BOOLEAN AslToFile = TRUE; +static char *FileList[ASL_MAX_FILES]; +static BOOLEAN AslToFile = TRUE; /* Local prototypes */ @@ -136,7 +135,7 @@ AsDoWildcard ( char *DirectoryPathname, char *FileSpecifier); -UINT8 +static UINT8 AslDetectSourceFileType ( ASL_FILE_INFO *Info); @@ -210,6 +209,7 @@ AsDoWildcard ( #ifdef WIN32 void *DirInfo; char *Filename; + int FileCount; FileCount = 0; @@ -277,7 +277,7 @@ AsDoWildcard ( * ******************************************************************************/ -UINT8 +static UINT8 AslDetectSourceFileType ( ASL_FILE_INFO *Info) { @@ -397,7 +397,7 @@ AslDoOneFile ( /* Shutdown compiler and ACPICA subsystem */ AeClearErrorLog (); - AcpiTerminate (); + (void) AcpiTerminate (); /* * Gbl_Files[ASL_FILE_INPUT].Filename was replaced with the @@ -487,7 +487,7 @@ AslDoOneFile ( } Status = CmDoCompile (); - AcpiTerminate (); + (void) AcpiTerminate (); /* * Return non-zero exit code if there have been errors, unless the @@ -533,7 +533,7 @@ AslDoOnePathname ( ASL_PATHNAME_CALLBACK PathCallback) { ACPI_STATUS Status = AE_OK; - char **FileList; + char **WildcardList; char *Filename; char *FullPathname; @@ -548,16 +548,16 @@ AslDoOnePathname ( /* Expand possible wildcard into a file list (Windows/DOS only) */ - FileList = AsDoWildcard (Gbl_DirectoryPath, Filename); - while (*FileList) + WildcardList = AsDoWildcard (Gbl_DirectoryPath, Filename); + while (*WildcardList) { FullPathname = ACPI_ALLOCATE ( - strlen (Gbl_DirectoryPath) + strlen (*FileList) + 1); + strlen (Gbl_DirectoryPath) + strlen (*WildcardList) + 1); /* Construct a full path to the file */ strcpy (FullPathname, Gbl_DirectoryPath); - strcat (FullPathname, *FileList); + strcat (FullPathname, *WildcardList); /* * If -p not specified, we will use the input filename as the @@ -573,9 +573,9 @@ AslDoOnePathname ( Status |= (*PathCallback) (FullPathname); ACPI_FREE (FullPathname); - ACPI_FREE (*FileList); - *FileList = NULL; - FileList++; + ACPI_FREE (*WildcardList); + *WildcardList = NULL; + WildcardList++; } ACPI_FREE (Gbl_DirectoryPath); Modified: head/sys/contrib/dev/acpica/compiler/dtcompile.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/dtcompile.c Thu Sep 16 19:43:32 2010 (r212760) +++ head/sys/contrib/dev/acpica/compiler/dtcompile.c Thu Sep 16 20:08:00 2010 (r212761) @@ -127,7 +127,7 @@ static char VersionStrin /* Local prototypes */ -static void +static ACPI_STATUS DtInitialize ( void); @@ -166,7 +166,12 @@ DtDoCompile ( /* Initialize globals */ - DtInitialize (); + Status = DtInitialize (); + if (ACPI_FAILURE (Status)) + { + printf ("Error during compiler initialization, 0x%X\n", Status); + return (Status); + } /* * Scan the input file (file is already open) and @@ -236,26 +241,38 @@ CleanupAndExit: * * PARAMETERS: None * - * RETURN: None + * RETURN: Status * * DESCRIPTION: Initialize data table compiler globals. Enables multiple * compiles per invocation. * *****************************************************************************/ -static void +static ACPI_STATUS DtInitialize ( void) { + ACPI_STATUS Status; - AcpiOsInitialize (); - AcpiUtInitGlobals (); + + Status = AcpiOsInitialize (); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + Status = AcpiUtInitGlobals (); + if (ACPI_FAILURE (Status)) + { + return (Status); + } Gbl_FieldList = NULL; Gbl_RootTable = NULL; Gbl_SubtableStack = NULL; sprintf (VersionString, "%X", (UINT32) ACPI_CA_VERSION); + return (AE_OK); } Modified: head/sys/contrib/dev/acpica/compiler/dtio.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/dtio.c Thu Sep 16 19:43:32 2010 (r212760) +++ head/sys/contrib/dev/acpica/compiler/dtio.c Thu Sep 16 20:08:00 2010 (r212761) @@ -158,7 +158,7 @@ DtWriteBinary ( #define DT_SLASH_SLASH_COMMENT 4 #define DT_END_COMMENT 5 -UINT32 Gbl_NextLineOffset; +static UINT32 Gbl_NextLineOffset; /****************************************************************************** Modified: head/sys/contrib/dev/acpica/debugger/dbexec.c ============================================================================== --- head/sys/contrib/dev/acpica/debugger/dbexec.c Thu Sep 16 19:43:32 2010 (r212760) +++ head/sys/contrib/dev/acpica/debugger/dbexec.c Thu Sep 16 20:08:00 2010 (r212761) @@ -567,14 +567,12 @@ AcpiDbMethodThread ( if (Info->InitArgs) { AcpiDbUInt32ToHexString (Info->NumCreated, Info->IndexOfThreadStr); - AcpiDbUInt32ToHexString (ACPI_TO_INTEGER (AcpiOsGetThreadId ()), - Info->IdOfThreadStr); + AcpiDbUInt32ToHexString ((UINT32) AcpiOsGetThreadId (), Info->IdOfThreadStr); } if (Info->Threads && (Info->NumCreated < Info->NumThreads)) { - Info->Threads[Info->NumCreated++] = - ACPI_TO_INTEGER (AcpiOsGetThreadId()); + Info->Threads[Info->NumCreated++] = AcpiOsGetThreadId(); } LocalInfo = *Info; @@ -722,8 +720,8 @@ AcpiDbCreateExecutionThreads ( /* Array to store IDs of threads */ AcpiGbl_DbMethodInfo.NumThreads = NumThreads; - Size = 4 * AcpiGbl_DbMethodInfo.NumThreads; - AcpiGbl_DbMethodInfo.Threads = (UINT32 *) AcpiOsAllocate (Size); + Size = sizeof (ACPI_THREAD_ID) * AcpiGbl_DbMethodInfo.NumThreads; + AcpiGbl_DbMethodInfo.Threads = AcpiOsAllocate (Size); if (AcpiGbl_DbMethodInfo.Threads == NULL) { AcpiOsPrintf ("No memory for thread IDs array\n"); Modified: head/sys/contrib/dev/acpica/events/evrgnini.c ============================================================================== --- head/sys/contrib/dev/acpica/events/evrgnini.c Thu Sep 16 19:43:32 2010 (r212760) +++ head/sys/contrib/dev/acpica/events/evrgnini.c Thu Sep 16 20:08:00 2010 (r212761) @@ -395,8 +395,8 @@ AcpiEvPciConfigRegionSetup ( } /* - * Get the PCI device and function numbers from the _ADR object contained - * in the parent's scope. + * Get the PCI device and function numbers from the _ADR object + * contained in the parent's scope. */ Status = AcpiUtEvaluateNumericObject (METHOD_NAME__ADR, PciDeviceNode, &PciValue); @@ -429,9 +429,14 @@ AcpiEvPciConfigRegionSetup ( PciId->Bus = ACPI_LOWORD (PciValue); } - /* Complete this device's PciId */ + /* Complete/update the PCI ID for this device */ - AcpiOsDerivePciId (PciRootNode, RegionObj->Region.Node, &PciId); + Status = AcpiHwDerivePciId (PciId, PciRootNode, RegionObj->Region.Node); + if (ACPI_FAILURE (Status)) + { + ACPI_FREE (PciId); + return_ACPI_STATUS (Status); + } *RegionContext = PciId; return_ACPI_STATUS (AE_OK); Modified: head/sys/contrib/dev/acpica/executer/exmutex.c ============================================================================== --- head/sys/contrib/dev/acpica/executer/exmutex.c Thu Sep 16 19:43:32 2010 (r212760) +++ head/sys/contrib/dev/acpica/executer/exmutex.c Thu Sep 16 20:08:00 2010 (r212761) @@ -513,10 +513,10 @@ AcpiExReleaseMutex ( (ObjDesc != AcpiGbl_GlobalLockMutex)) { ACPI_ERROR ((AE_INFO, - "Thread %p cannot release Mutex [%4.4s] acquired by thread %p", - ACPI_CAST_PTR (void, WalkState->Thread->ThreadId), + "Thread %u cannot release Mutex [%4.4s] acquired by thread %u", + (UINT32) WalkState->Thread->ThreadId, AcpiUtGetNodeName (ObjDesc->Mutex.Node), - ACPI_CAST_PTR (void, OwnerThread->ThreadId))); + (UINT32) OwnerThread->ThreadId)); return_ACPI_STATUS (AE_AML_NOT_OWNER); } Copied and modified: head/sys/contrib/dev/acpica/hardware/hwpci.c (from r212760, vendor-sys/acpica/dist/hardware/hwpci.c) ============================================================================== --- vendor-sys/acpica/dist/hardware/hwpci.c Thu Sep 16 19:43:32 2010 (r212760, copy source) +++ head/sys/contrib/dev/acpica/hardware/hwpci.c Thu Sep 16 20:08:00 2010 (r212761) @@ -115,8 +115,8 @@ #define __HWPCI_C__ -#include "acpi.h" -#include "accommon.h" +#include +#include #define _COMPONENT ACPI_NAMESPACE Modified: head/sys/contrib/dev/acpica/include/acglobal.h ============================================================================== --- head/sys/contrib/dev/acpica/include/acglobal.h Thu Sep 16 19:43:32 2010 (r212760) +++ head/sys/contrib/dev/acpica/include/acglobal.h Thu Sep 16 20:08:00 2010 (r212761) @@ -214,6 +214,7 @@ ACPI_TABLE_FADT AcpiGbl_FADT UINT32 AcpiCurrentGpeCount; UINT32 AcpiGbl_TraceFlags; ACPI_NAME AcpiGbl_TraceMethodName; +BOOLEAN AcpiGbl_SystemAwakeAndRunning; #endif @@ -334,7 +335,6 @@ ACPI_EXTERN UINT8 ACPI_EXTERN BOOLEAN AcpiGbl_StepToNextCall; ACPI_EXTERN BOOLEAN AcpiGbl_AcpiHardwarePresent; ACPI_EXTERN BOOLEAN AcpiGbl_EventsInitialized; -ACPI_EXTERN BOOLEAN AcpiGbl_SystemAwakeAndRunning; ACPI_EXTERN UINT8 AcpiGbl_OsiData; ACPI_EXTERN ACPI_INTERFACE_INFO *AcpiGbl_SupportedInterfaces; Modified: head/sys/contrib/dev/acpica/include/achware.h ============================================================================== --- head/sys/contrib/dev/acpica/include/achware.h Thu Sep 16 19:43:32 2010 (r212760) +++ head/sys/contrib/dev/acpica/include/achware.h Thu Sep 16 20:08:00 2010 (r212761) @@ -251,6 +251,16 @@ AcpiHwEnableRuntimeGpeBlock ( /* + * hwpci - PCI configuration support + */ +ACPI_STATUS +AcpiHwDerivePciId ( + ACPI_PCI_ID *PciId, + ACPI_HANDLE RootPciDevice, + ACPI_HANDLE PciRegion); + + +/* * hwtimer - ACPI Timer prototypes */ ACPI_STATUS Modified: head/sys/contrib/dev/acpica/include/aclocal.h ============================================================================== --- head/sys/contrib/dev/acpica/include/aclocal.h Thu Sep 16 19:43:32 2010 (r212760) +++ head/sys/contrib/dev/acpica/include/aclocal.h Thu Sep 16 20:08:00 2010 (r212761) @@ -1270,7 +1270,7 @@ typedef struct acpi_db_method_info ACPI_HANDLE MainThreadGate; ACPI_HANDLE ThreadCompleteGate; ACPI_HANDLE InfoGate; - UINT32 *Threads; + ACPI_THREAD_ID *Threads; UINT32 NumThreads; UINT32 NumCreated; UINT32 NumCompleted; Modified: head/sys/contrib/dev/acpica/include/acmacros.h ============================================================================== --- head/sys/contrib/dev/acpica/include/acmacros.h Thu Sep 16 19:43:32 2010 (r212760) +++ head/sys/contrib/dev/acpica/include/acmacros.h Thu Sep 16 20:08:00 2010 (r212761) @@ -400,8 +400,8 @@ * the plist contains a set of parens to allow variable-length lists. * These macros are used for both the debug and non-debug versions of the code. */ -#define ACPI_ERROR_NAMESPACE(s, e) AcpiNsReportError (AE_INFO, s, e); -#define ACPI_ERROR_METHOD(s, n, p, e) AcpiNsReportMethodError (AE_INFO, s, n, p, e); +#define ACPI_ERROR_NAMESPACE(s, e) AcpiUtNamespaceError (AE_INFO, s, e); +#define ACPI_ERROR_METHOD(s, n, p, e) AcpiUtMethodError (AE_INFO, s, n, p, e); #define ACPI_WARN_PREDEFINED(plist) AcpiUtPredefinedWarning plist #define ACPI_INFO_PREDEFINED(plist) AcpiUtPredefinedInfo plist Modified: head/sys/contrib/dev/acpica/include/acnamesp.h ============================================================================== --- head/sys/contrib/dev/acpica/include/acnamesp.h Thu Sep 16 19:43:32 2010 (r212760) +++ head/sys/contrib/dev/acpica/include/acnamesp.h Thu Sep 16 20:08:00 2010 (r212761) @@ -514,22 +514,6 @@ AcpiNsLocal ( ACPI_OBJECT_TYPE Type); void -AcpiNsReportError ( - const char *ModuleName, - UINT32 LineNumber, - const char *InternalName, - ACPI_STATUS LookupStatus); - -void -AcpiNsReportMethodError ( - const char *ModuleName, - UINT32 LineNumber, - const char *Message, - ACPI_NAMESPACE_NODE *Node, - const char *Path, - ACPI_STATUS LookupStatus); - -void AcpiNsPrintNodePathname ( ACPI_NAMESPACE_NODE *Node, const char *Msg); Modified: head/sys/contrib/dev/acpica/include/acpiosxf.h ============================================================================== --- head/sys/contrib/dev/acpica/include/acpiosxf.h Thu Sep 16 19:43:32 2010 (r212760) +++ head/sys/contrib/dev/acpica/include/acpiosxf.h Thu Sep 16 20:08:00 2010 (r212761) @@ -406,16 +406,6 @@ AcpiOsWritePciConfiguration ( /* - * Interim function needed for PCI IRQ routing - */ -void -AcpiOsDerivePciId( - ACPI_HANDLE Device, - ACPI_HANDLE Region, - ACPI_PCI_ID **PciId); - - -/* * Miscellaneous */ BOOLEAN Modified: head/sys/contrib/dev/acpica/include/acpixf.h ============================================================================== --- head/sys/contrib/dev/acpica/include/acpixf.h Thu Sep 16 19:43:32 2010 (r212760) +++ head/sys/contrib/dev/acpica/include/acpixf.h Thu Sep 16 20:08:00 2010 (r212761) @@ -120,7 +120,7 @@ /* Current ACPICA subsystem version in YYYYMMDD format */ -#define ACPI_CA_VERSION 0x20100806 +#define ACPI_CA_VERSION 0x20100915 #include #include @@ -130,6 +130,7 @@ */ extern UINT32 AcpiCurrentGpeCount; extern ACPI_TABLE_FADT AcpiGbl_FADT; +extern BOOLEAN AcpiGbl_SystemAwakeAndRunning; /* Runtime configuration of debug print levels */ Modified: head/sys/contrib/dev/acpica/include/actypes.h ============================================================================== --- head/sys/contrib/dev/acpica/include/actypes.h Thu Sep 16 19:43:32 2010 (r212760) +++ head/sys/contrib/dev/acpica/include/actypes.h Thu Sep 16 20:08:00 2010 (r212761) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Thu Sep 16 20:10:54 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 610201065670; Thu, 16 Sep 2010 20:10:54 +0000 (UTC) (envelope-from juli@clockworksquid.com) Received: from mail-iw0-f182.google.com (mail-iw0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 0A1E38FC0A; Thu, 16 Sep 2010 20:10:53 +0000 (UTC) Received: by iwn34 with SMTP id 34so1532987iwn.13 for ; Thu, 16 Sep 2010 13:10:53 -0700 (PDT) Received: by 10.231.30.68 with SMTP id t4mr3782981ibc.129.1284667853281; Thu, 16 Sep 2010 13:10:53 -0700 (PDT) MIME-Version: 1.0 Sender: juli@clockworksquid.com Received: by 10.231.20.3 with HTTP; Thu, 16 Sep 2010 13:10:33 -0700 (PDT) In-Reply-To: <20100916212043.N724@delplex.bde.org> References: <201009091927.o89JReXm022426@svn.freebsd.org> <20100916084442.GB21622@dragon.NUXI.org> <20100916212043.N724@delplex.bde.org> From: Juli Mallett Date: Thu, 16 Sep 2010 13:10:33 -0700 X-Google-Sender-Auth: UUzjeBZF4ot2haCGvwoLT9XjlMQ Message-ID: To: Bruce Evans Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, David O'Brien Subject: Re: svn commit: r212374 - head/usr.bin/printf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Sep 2010 20:10:54 -0000 On Thu, Sep 16, 2010 at 04:36, Bruce Evans wrote: > WHat about the lesser burder on a character or two for putting -- in the > synopsis where it is more visible: > > =A0 =A0 =A0 =A0printf [--] format [arguments ...] Right, that's what I've been thinking about. For that matter, does printf(1) need to use getopt(3) at all? It seems like simply checking for "--" could be sufficient. Does POSIX require that it exit with an error if it's given any options? At the very least, it seems like it would be more productive to have printf(1) give unusually-helpful error messages (perhaps merely changing its usage output to match that synopsis) if it encounters a string beginning with '-' other than "--". From owner-svn-src-head@FreeBSD.ORG Thu Sep 16 20:11:41 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1863A106564A; Thu, 16 Sep 2010 20:11:41 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 08B5E8FC19; Thu, 16 Sep 2010 20:11:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8GKBe4d005698; Thu, 16 Sep 2010 20:11:40 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8GKBecH005696; Thu, 16 Sep 2010 20:11:40 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201009162011.o8GKBecH005696@svn.freebsd.org> From: Jung-uk Kim Date: Thu, 16 Sep 2010 20:11:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212762 - head/sys/dev/acpi_support X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Sep 2010 20:11:41 -0000 Author: jkim Date: Thu Sep 16 20:11:40 2010 New Revision: 212762 URL: http://svn.freebsd.org/changeset/base/212762 Log: Remove an unnecessary hack from ACPICA 20100915 (r212761). Modified: head/sys/dev/acpi_support/acpi_wmi.c Modified: head/sys/dev/acpi_support/acpi_wmi.c ============================================================================== --- head/sys/dev/acpi_support/acpi_wmi.c Thu Sep 16 20:08:00 2010 (r212761) +++ head/sys/dev/acpi_support/acpi_wmi.c Thu Sep 16 20:11:40 2010 (r212762) @@ -202,7 +202,7 @@ static devclass_t acpi_wmi_devclass; DRIVER_MODULE(acpi_wmi, acpi, acpi_wmi_driver, acpi_wmi_devclass, 0, 0); MODULE_VERSION(acpi_wmi, 1); MODULE_DEPEND(acpi_wmi, acpi, 1, 1, 1); -static char *wmi_ids[] = {"PNP0C14", "PNP0c14", NULL}; +static char *wmi_ids[] = {"PNP0C14", NULL}; /* * Probe for the PNP0C14 ACPI node From owner-svn-src-head@FreeBSD.ORG Thu Sep 16 20:23:23 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5BC5D106566C; Thu, 16 Sep 2010 20:23:23 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 49F088FC13; Thu, 16 Sep 2010 20:23:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8GKNNDv006045; Thu, 16 Sep 2010 20:23:23 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8GKNN3s006039; Thu, 16 Sep 2010 20:23:23 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201009162023.o8GKNN3s006039@svn.freebsd.org> From: "Jayachandran C." Date: Thu, 16 Sep 2010 20:23:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212763 - in head/sys/mips/rmi: . dev/sec X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Sep 2010 20:23:23 -0000 Author: jchandra Date: Thu Sep 16 20:23:22 2010 New Revision: 212763 URL: http://svn.freebsd.org/changeset/base/212763 Log: RMI security accelerator driver update. - Compile fixes for 9.0, the previous version of this driver was for FreeBSD 6. - Add virtual address field in OperationDescriptor_t, we cannot use MIPS_PHYS_TO_KSEG0 on physical address. - Fixes for new message ring API - Remove unused sys/mips/rmi/dev/sec/stats.h - Whitespace fixes Deleted: head/sys/mips/rmi/dev/sec/stats.h Modified: head/sys/mips/rmi/dev/sec/desc.h head/sys/mips/rmi/dev/sec/rmilib.c head/sys/mips/rmi/dev/sec/rmilib.h head/sys/mips/rmi/dev/sec/rmisec.c head/sys/mips/rmi/iodi.c Modified: head/sys/mips/rmi/dev/sec/desc.h ============================================================================== --- head/sys/mips/rmi/dev/sec/desc.h Thu Sep 16 20:11:40 2010 (r212762) +++ head/sys/mips/rmi/dev/sec/desc.h Thu Sep 16 20:23:22 2010 (r212763) @@ -26,6 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * + * $FreeBSD$ * RMI_BSD */ #ifndef _DESC_H_ #define _DESC_H_ @@ -2320,7 +2321,7 @@ typedef struct OperationDescriptor_s { uint32_t flags; uint32_t cpu; uint32_t seq_num; - uint64_t reserved; + uint64_t vaddr; } OperationDescriptor_t, *OperationDescriptor_pt; Modified: head/sys/mips/rmi/dev/sec/rmilib.c ============================================================================== --- head/sys/mips/rmi/dev/sec/rmilib.c Thu Sep 16 20:11:40 2010 (r212762) +++ head/sys/mips/rmi/dev/sec/rmilib.c Thu Sep 16 20:23:22 2010 (r212763) @@ -41,7 +41,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include @@ -49,20 +48,19 @@ __FBSDID("$FreeBSD$"); #include - -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include -// static int msgrng_stnid_pk0 = MSGRNG_STNID_PK0; +/* static int msgrng_stnid_pk0 = MSGRNG_STNID_PK0; */ -/*#define RMI_SEC_DEBUG */ +/* #define RMI_SEC_DEBUG */ #define SMP_CACHE_BYTES XLR_CACHELINE_SIZE #define NUM_CHUNKS(size, bits) ( ((size)>>(bits)) + (((size)&((1<<(bits))-1))?1:0) ) @@ -72,86 +70,44 @@ symkey_desc_pt g_desc; struct xlr_sec_command *g_cmd; #ifdef XLR_SEC_CMD_DEBUG -static void - decode_symkey_desc(symkey_desc_pt desc, uint32_t cfg_vector); - +static void decode_symkey_desc(symkey_desc_pt desc, uint32_t cfg_vector); #endif -void print_buf(char *desc, void *data, int len); - -static int - xlr_sec_cipher_hash_command(xlr_sec_io_pt op, symkey_desc_pt desc, uint8_t); - -static xlr_sec_error_t -xlr_sec_setup_descriptor(xlr_sec_io_pt op, - unsigned int flags, - symkey_desc_pt desc, - uint32_t * cfg_vector); - -static -xlr_sec_error_t -xlr_sec_setup_packet(xlr_sec_io_pt op, - symkey_desc_pt desc, - unsigned int flags, - uint64_t * data, - PacketDescriptor_pt pkt_desc, - ControlDescriptor_pt ctl_desc, - uint32_t vector, - PacketDescriptor_pt next_pkt_desc, +static int xlr_sec_cipher_hash_command(xlr_sec_io_pt op, symkey_desc_pt desc, + uint8_t); +static xlr_sec_error_t xlr_sec_setup_descriptor(xlr_sec_io_pt op, + unsigned int flags, symkey_desc_pt desc, uint32_t * cfg_vector); + +static xlr_sec_error_t xlr_sec_setup_packet(xlr_sec_io_pt op, + symkey_desc_pt desc, unsigned int flags, uint64_t * data, + PacketDescriptor_pt pkt_desc, ControlDescriptor_pt ctl_desc, + uint32_t vector, PacketDescriptor_pt next_pkt_desc, uint8_t multi_frag_flag); - -static int - xlr_sec_submit_message(symkey_desc_pt desc, uint32_t cfg_vector); - -static -xlr_sec_error_t -xlr_sec_setup_cipher(xlr_sec_io_pt op, - ControlDescriptor_pt ctl_desc, - uint32_t * vector); - -static -xlr_sec_error_t -xlr_sec_setup_digest(xlr_sec_io_pt op, - ControlDescriptor_pt ctl_desc, - uint32_t * vector); - -static -xlr_sec_error_t -xlr_sec_setup_cksum(xlr_sec_io_pt op, +static int xlr_sec_submit_message(symkey_desc_pt desc, uint32_t cfg_vector); +static xlr_sec_error_t xlr_sec_setup_cipher(xlr_sec_io_pt op, + ControlDescriptor_pt ctl_desc, uint32_t * vector); +static xlr_sec_error_t xlr_sec_setup_digest(xlr_sec_io_pt op, + ControlDescriptor_pt ctl_desc, uint32_t * vector); +static xlr_sec_error_t xlr_sec_setup_cksum(xlr_sec_io_pt op, ControlDescriptor_pt ctl_desc); +static xlr_sec_error_t xlr_sec_control_setup(xlr_sec_io_pt op, + unsigned int flags, uint64_t * control, ControlDescriptor_pt ctl_desc, + xlr_sec_drv_user_t * user, uint32_t vector); +static void xlr_sec_free_desc(symkey_desc_pt desc); -static -xlr_sec_error_t -xlr_sec_control_setup(xlr_sec_io_pt op, - unsigned int flags, - uint64_t * control, - ControlDescriptor_pt ctl_desc, - xlr_sec_drv_user_t * user, - uint32_t vector); - - -xlr_sec_error_t -xlr_sec_submit_op(symkey_desc_pt desc); - -static void xlr_sec_free_desc(symkey_desc_pt desc); - -void -xlr_sec_msgring_handler(int bucket, int size, int code, int stid, +void print_buf(char *desc, void *data, int len); +xlr_sec_error_t xlr_sec_submit_op(symkey_desc_pt desc); +void xlr_sec_msgring_handler(int bucket, int size, int code, int stid, struct msgrng_msg *msg, void *data); - void xlr_sec_init(struct xlr_sec_softc *sc) { unsigned int i; xlr_reg_t *mmio; - mmio = sc->mmio = xlr_io_mmio(XLR_IO_SECURITY_OFFSET); - xlr_write_reg(mmio, SEC_DMA_CREDIT, SEC_DMA_CREDIT_CONFIG); - - xlr_write_reg(mmio, SEC_CONFIG2, SEC_CFG2_ROUND_ROBIN_ON); for (i = 0; i < 8; i++) @@ -168,7 +124,6 @@ xlr_sec_init(struct xlr_sec_softc *sc) xls_cc_table_sec.counters[i >> 3][i & 0x07] : cc_table_sec.counters[i >> 3][i & 0x07]); - /* * Register a bucket handler with the phoenix messaging subsystem * For now, register handler for bucket 0->5 in msg stn 0 @@ -179,30 +134,23 @@ xlr_sec_init(struct xlr_sec_softc *sc) return; } - - int xlr_sec_setup(struct xlr_sec_session *ses, struct xlr_sec_command *cmd, - symkey_desc_pt desc -) + symkey_desc_pt desc) { xlr_sec_io_pt op; int size, ret_val; int iv_len; - desc->ses = ses; op = &cmd->op; if (op == NULL) return (-ENOMEM); - - desc->ctl_desc.instruction = 0; memset(&desc->ctl_desc.cipherHashInfo, 0, sizeof(CipherHashInfo_t)); desc->control = 0; - desc->pkt_desc[0].srcLengthIVOffUseIVNext = 0; desc->pkt_desc[0].dstDataSettings = 0; desc->pkt_desc[0].authDstNonceLow = 0; @@ -211,12 +159,10 @@ xlr_sec_setup(struct xlr_sec_session *se desc->pkt_desc[1].dstDataSettings = 0; desc->pkt_desc[1].authDstNonceLow = 0; desc->pkt_desc[1].ckSumDstNonceHiCFBMaskLLWMask = 0; - desc->data = 0; desc->ctl_result = 0; desc->data_result = 0; - if (op->flags & XLR_SEC_FLAGS_HIGH_PRIORITY) if (!xlr_is_xls()) desc->op_ctl.stn_id++; @@ -225,7 +171,6 @@ xlr_sec_setup(struct xlr_sec_session *se desc->user.user_dest = (uint8_t *) (unsigned long)op->dest_buf; desc->user.user_auth = (uint8_t *) (unsigned long)op->auth_dest; - if ((op->cipher_type == XLR_SEC_CIPHER_TYPE_ARC4) && (!op->rc4_state && (op->rc4_loadstate || op->rc4_savestate))) { printf(" ** Load/Save State and no State **"); @@ -234,7 +179,6 @@ xlr_sec_setup(struct xlr_sec_session *se } desc->user.user_state = (uint8_t *) (unsigned long)op->rc4_state; - switch (op->cipher_type) { case XLR_SEC_CIPHER_TYPE_NONE: iv_len = 0; @@ -260,10 +204,6 @@ xlr_sec_setup(struct xlr_sec_session *se xlr_sec_free_desc(desc); return (-EINVAL); } - - - - size = op->source_buf_size + iv_len; /* @@ -276,7 +216,8 @@ xlr_sec_setup(struct xlr_sec_session *se if (op->cipher_type == XLR_SEC_CIPHER_TYPE_NONE) { if (op->source_buf_size != 0) { - memcpy(desc->user.aligned_src, (uint8_t *) (unsigned long)op->source_buf, + memcpy(desc->user.aligned_src, + (uint8_t *)(uintptr_t)op->source_buf, op->source_buf_size); } } else { @@ -306,12 +247,9 @@ xlr_sec_setup(struct xlr_sec_session *se } } - - /* Set source to new kernel space */ op->source_buf = (uint64_t) (unsigned long)desc->user.aligned_src; - /* * Build new dest buffer, for Cipher output only */ @@ -324,7 +262,6 @@ xlr_sec_setup(struct xlr_sec_session *se } else { /* DEBUG -dpk */ XLR_SEC_CMD_DIAG("dest_buf_size = %d \n", op->dest_buf_size); - size = op->dest_buf_size + iv_len; /* @@ -335,11 +272,9 @@ xlr_sec_setup(struct xlr_sec_session *se op->cipher_mode == XLR_SEC_CIPHER_MODE_CTR) size += XLR_SEC_AES_BLOCK_SIZE - 1; op->dest_buf = (uint64_t) (unsigned long)desc->user.aligned_dest; - } ret_val = xlr_sec_cipher_hash_command(op, desc, ses->multi_frag_flag); - return (ret_val); } @@ -396,7 +331,6 @@ xlr_sec_cipher_hash_command(xlr_sec_io_p return err; } - static xlr_sec_error_t xlr_sec_setup_descriptor(xlr_sec_io_pt op, unsigned int flags, @@ -407,7 +341,6 @@ xlr_sec_setup_descriptor(xlr_sec_io_pt o XLR_SEC_CMD_DIAG("xlr_sec_setup_descriptor: ENTER\n"); - if ((err = xlr_sec_setup_cipher(op, &desc->ctl_desc, cfg_vector)) != XLR_SEC_ERR_NONE) { XLR_SEC_CMD_DIAG("xlr_sec_setup_descriptor: xlr_sec_setup_cipher done err %d\n", (int)err); @@ -483,7 +416,7 @@ xlr_sec_setup_packet(xlr_sec_io_pt op, len = op->source_buf_size + byte_offset - global_offset; if (multi_frag_flag) { - next_seg_addr = (uint64_t) vtophys((void *)(unsigned long)(desc->next_src_buf)); + next_seg_addr = (uint64_t)vtophys((void *)(uintptr_t)desc->next_src_buf); next_seg_addr = (next_seg_addr & ~(SMP_CACHE_BYTES - 1)); next_len = desc->next_src_len; } @@ -505,14 +438,12 @@ xlr_sec_setup_packet(xlr_sec_io_pt op, */ cipher_offset_dwords = (op->iv_offset + byte_offset) >> 3; - if (op->cipher_mode == XLR_SEC_CIPHER_MODE_F8 || op->cipher_mode == XLR_SEC_CIPHER_MODE_CTR) { if (multi_frag_flag) { int nlhmac = ((op->source_buf_size + global_offset + 7 - op->cipher_offset) >> 3) & 1; pkt_desc->srcLengthIVOffUseIVNext = - FIELD_VALUE(PKT_DSC_HASHBYTES, len & 7) | FIELD_VALUE(PKT_DSC_IVOFF, cipher_offset_dwords) | FIELD_VALUE(PKT_DSC_PKTLEN, nlhmac + ((len + 7) >> 3)) | @@ -539,7 +470,6 @@ xlr_sec_setup_packet(xlr_sec_io_pt op, } else { if (multi_frag_flag) { pkt_desc->srcLengthIVOffUseIVNext = - FIELD_VALUE(PKT_DSC_HASHBYTES, len & 7) | FIELD_VALUE(PKT_DSC_IVOFF, cipher_offset_dwords) | FIELD_VALUE(PKT_DSC_PKTLEN, (len + 7) >> 3) | @@ -890,7 +820,6 @@ xlr_sec_setup_packet(xlr_sec_io_pt op, CLEAR_SET_FIELD(next_pkt_desc->ckSumDstNonceHiCFBMaskLLWMask, PKT_DSC_CKSUM_DST_ADDR, (uint64_t) vtophys((void *)(unsigned long)desc->next_cksum_dest)); - } } /* @@ -902,17 +831,13 @@ xlr_sec_setup_packet(xlr_sec_io_pt op, XLR_SEC_CMD_DIAG(" xlr_sec_setup_packet(): pkt_desc=%p phys_pkt_desc=%llx \n", pkt_desc, (unsigned long long)vtophys(pkt_desc)); - - CLEAR_SET_FIELD(*data, MSG_CMD_DATA_ADDR, ((uint64_t) vtophys(pkt_desc))); CLEAR_SET_FIELD(*data, MSG_CMD_DATA_CTL, SEC_EOP); CLEAR_SET_FIELD(*data, MSG_CMD_DATA_LEN, MSG_CMD_DATA_LEN_LOAD); - XLR_SEC_CMD_DIAG("xlr_sec_setup_packet: DONE\n"); #ifdef RMI_SEC_DEBUG - { printf("data desc\n"); printf("srcLengthIVOffUseIVNext = 0x%llx\n", pkt_desc->srcLengthIVOffUseIVNext); @@ -1036,9 +961,7 @@ xlr_sec_submit_message(symkey_desc_pt de int ret_val = 0; XLR_SEC_CMD_DIAG("xlr_sec_submit_message: ENTER\n"); - err = XLR_SEC_ERR_NONE; - XLR_SEC_CMD_DIAG_SYM_DESC(desc, cfg_vector); do { @@ -1206,7 +1129,6 @@ xlr_sec_setup_cipher(xlr_sec_io_pt op, return XLR_SEC_ERR_NONE; } - static xlr_sec_error_t xlr_sec_setup_digest(xlr_sec_io_pt op, @@ -1304,7 +1226,6 @@ xlr_sec_setup_digest(xlr_sec_io_pt op, *vector |= digest_vector; XLR_SEC_CMD_DIAG("xlr_sec_setup_digest: EXIT vector = %04x\n", *vector); - return XLR_SEC_ERR_NONE; } @@ -1350,7 +1271,6 @@ xlr_sec_control_setup(xlr_sec_io_pt op, XLR_SEC_CMD_DIAG(" ENTER vector = %04x\n", vector); #endif - switch (vector) { case XLR_SEC_VECTOR_MAC: XLR_SEC_CMD_DIAG(" XLR_SEC_VECTOR_MAC \n"); @@ -1970,7 +1890,6 @@ xlr_sec_control_setup(xlr_sec_io_pt op, return XLR_SEC_ERR_NONE; } - xlr_sec_error_t xlr_sec_submit_op(symkey_desc_pt desc) { @@ -2013,31 +1932,18 @@ xlr_sec_submit_op(symkey_desc_pt desc) XLR_SEC_CMD_DIAG("[%s]: IN_IRQ=%d msg0=0x%llx msg1=0x%llx \n", __FUNCTION__, desc->op_ctl.flags, send_msg.msg0, send_msg.msg1); - - retries = 100; - while (retries--) { - msgrng_flags_save(msgrng_flags); - - code = message_send_retry(SEC_MSGRING_WORDSIZE, - MSGRNG_CODE_SEC, - desc->op_ctl.stn_id, - &send_msg); - - - msgrng_flags_restore(msgrng_flags); - + msgrng_flags = msgrng_access_enable(); + code = message_send(SEC_MSGRING_WORDSIZE, MSGRNG_CODE_SEC, + desc->op_ctl.stn_id, &send_msg); + msgrng_restore(msgrng_flags); if (code == 0) break; } - - return (XLR_SEC_ERR_NONE); } - - symkey_desc_pt xlr_sec_allocate_desc(void *session_ptr) { @@ -2090,7 +1996,6 @@ xlr_sec_allocate_desc(void *session_ptr) new->user.kern_auth = new->user.user_auth = NULL; new->user.aligned_auth = new->user.user_auth = NULL; - /* find cacheline alignment */ aligned = new; addr = (uint64_t) vtophys(new); @@ -2101,6 +2006,7 @@ xlr_sec_allocate_desc(void *session_ptr) /* setup common control info */ aligned->op_ctl.phys_self = addr; aligned->op_ctl.stn_id = MSGRNG_STNID_SEC0; + aligned->op_ctl.vaddr = (uintptr_t)aligned; return (aligned); } @@ -2114,8 +2020,6 @@ xlr_sec_free_desc(symkey_desc_pt desc) return; } contigfree(desc, sizeof(symkey_desc_t), M_DEVBUF); - - return; } @@ -2816,7 +2720,7 @@ decode_symkey_desc(symkey_desc_pt desc, break; } DPRINT("PACKET DESCRIPTOR: \n"); - word = desc->pkt_desc.srcLengthIVOffUseIVNext; + word = 0; //desc->pkt_desc.srcLengthIVOffUseIVNext; DPRINT("\tSrcLengthIVOffsetIVNext: %llx\n", word); DPRINT("\t\tLoad HMAC = %lld \n", GET_FIELD(word, PKT_DSC_LOADHMACKEY)); @@ -2841,7 +2745,7 @@ decode_symkey_desc(symkey_desc_pt desc, DPRINT("\t\tGlobal Src Offset = %lld \n", GET_FIELD(word, PKT_DSC_SEGOFFSET)); - word = desc->pkt_desc.dstDataSettings; + word = 0; //desc->pkt_desc.dstDataSettings; DPRINT("\tdstDataSettings: %llx \n", word); DPRINT("\t\tArc4 Byte Count = %lld \n", GET_FIELD(word, PKT_DSC_ARC4BYTECOUNT)); @@ -2859,7 +2763,7 @@ decode_symkey_desc(symkey_desc_pt desc, PKT_DSC_CPHR_DST_DWOFFSET)); DPRINT("\t\tCipher Dest Offset= %lld \n", GET_FIELD(word, PKT_DSC_CPHR_DST_OFFSET)); - word = desc->pkt_desc.authDstNonceLow; + word = 0; //desc->pkt_desc.authDstNonceLow; DPRINT("\tauthDstNonceLow: %llx \n", word); DPRINT("\t\tNonce Low 24 = %lld \n", GET_FIELD(word, PKT_DSC_NONCE_LOW)); @@ -2867,7 +2771,7 @@ decode_symkey_desc(symkey_desc_pt desc, PKT_DSC_AUTH_DST_ADDR)); DPRINT("\t\tCipher Offset High= %lld \n", GET_FIELD(word, PKT_DSC_CIPH_OFF_HI)); - word = desc->pkt_desc.ckSumDstNonceHiCFBMaskLLWMask; + word = 0; //desc->pkt_desc.ckSumDstNonceHiCFBMaskLLWMask; DPRINT("\tckSumDstNonceHiCFBMaskLLWMask: %llx \n", word); DPRINT("\t\tHash Byte off = %lld \n", GET_FIELD(word, PKT_DSC_HASH_BYTE_OFF)); DPRINT("\t\tPacket Len bytes = %lld \n", GET_FIELD(word, PKT_DSC_PKTLEN_BYTES)); @@ -2897,7 +2801,7 @@ xlr_sec_msgring_handler(int bucket, int symkey_desc_pt desc = NULL; struct xlr_sec_session *ses = NULL; struct xlr_sec_command *cmd = NULL; - + uint32_t flags; if (code != MSGRNG_CODE_SEC) { panic("xlr_sec_msgring_handler: bad code = %d," @@ -2916,7 +2820,6 @@ xlr_sec_msgring_handler(int bucket, int sec_eng = GET_FIELD(msg->msg0, MSG_CTL_OP_TYPE); sec_pipe = GET_FIELD(msg->msg1, MSG_CTL_OP_TYPE); - error = msg->msg0 >> 40 & 0x1ff; if (error) printf("ctrl error = 0x%llx\n", error); @@ -2938,12 +2841,11 @@ xlr_sec_msgring_handler(int bucket, int * they are used for the engine and pipe Id. */ addr = GET_FIELD(msg->msg1, MSG_RSLT_DATA_DSC_ADDR); - addr = addr & ~((1 << 5) - 1); if (!addr) { panic("[%s:STNID_SEC]: NULL symkey addr!\n", __FUNCTION__); - } + /* * The adddress points to the data descriptor. The operation * descriptor is defined with the 32-byte cacheline size in @@ -2951,7 +2853,10 @@ xlr_sec_msgring_handler(int bucket, int * reference the symkey descriptor. (ref: xlr_sec_desc.h) */ addr = addr - sizeof(OperationDescriptor_t); - desc = (symkey_desc_pt) MIPS_PHYS_TO_KSEG0(addr); + flags = xlr_enable_kx(); + desc = (symkey_desc_pt)(uintptr_t)xlr_paddr_ld(addr + + offsetof(OperationDescriptor_t, vaddr)); + xlr_restore_kx(flags); if (!desc) { printf("\nerror : not getting desc back correctly \n"); @@ -3099,10 +3004,8 @@ xlr_sec_msgring_handler(int bucket, int } #endif - /* Copy cipher-data to User-space */ if (op->cipher_type != XLR_SEC_CIPHER_TYPE_NONE) { - size = op->dest_buf_size; /* DEBUG -dpk */ @@ -3119,14 +3022,12 @@ xlr_sec_msgring_handler(int bucket, int crypto_copyback(cmd->crp->crp_flags, cmd->crp->crp_buf, 0, cmd->op.dest_buf_size, (caddr_t)(long)desc->user.aligned_dest + op->cipher_offset); crypto_done(cmd->crp); - } - } + /* Copy digest to User-space */ if (op->digest_type != XLR_SEC_DIGEST_TYPE_NONE) { - int offset = 0; switch (op->digest_type) { @@ -3163,7 +3064,6 @@ xlr_sec_msgring_handler(int bucket, int } if (op->cipher_type == XLR_SEC_CIPHER_TYPE_ARC4 && op->rc4_savestate) { - size = XLR_SEC_MAX_RC4_STATE_SIZE; XLR_SEC_CMD_DIAG("state: to_addr=%p from_addr=%p size=%d \n", Modified: head/sys/mips/rmi/dev/sec/rmilib.h ============================================================================== --- head/sys/mips/rmi/dev/sec/rmilib.h Thu Sep 16 20:11:40 2010 (r212762) +++ head/sys/mips/rmi/dev/sec/rmilib.h Thu Sep 16 20:23:22 2010 (r212763) @@ -25,7 +25,8 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * + * + * $FreeBSD$ * RMI_BSD */ @@ -33,12 +34,10 @@ #define _RMILIB_H_ #include -__FBSDID("$FreeBSD$"); - #include -#include +#include -/*#define XLR_SEC_CMD_DEBUG*/ +/* #define XLR_SEC_CMD_DEBUG */ #ifdef XLR_SEC_CMD_DEBUG #define DPRINT printf Modified: head/sys/mips/rmi/dev/sec/rmisec.c ============================================================================== --- head/sys/mips/rmi/dev/sec/rmisec.c Thu Sep 16 20:11:40 2010 (r212762) +++ head/sys/mips/rmi/dev/sec/rmisec.c Thu Sep 16 20:23:22 2010 (r212763) @@ -43,29 +43,27 @@ __FBSDID("$FreeBSD$"); #include #include #include - -#include -#include - -#include -#include #include +#include #include - +#include +#include #include -#include -#include +#include "cryptodev_if.h" -/*#define RMI_SEC_DEBUG */ +#include +#include +#include -void xlr_sec_print_data(struct cryptop *crp); +/* #define RMI_SEC_DEBUG */ -static int xlr_sec_newsession(void *arg, uint32_t * sidp, struct cryptoini *cri); -static int xlr_sec_freesession(void *arg, uint64_t tid); -static int xlr_sec_process(void *arg, struct cryptop *crp, int hint); +void xlr_sec_print_data(struct cryptop *crp); +static int xlr_sec_newsession(device_t dev, uint32_t * sidp, struct cryptoini *cri); +static int xlr_sec_freesession(device_t dev, uint64_t tid); +static int xlr_sec_process(device_t dev, struct cryptop *crp, int hint); static int xlr_sec_probe(device_t); static int xlr_sec_attach(device_t); @@ -82,6 +80,11 @@ static device_method_t xlr_sec_methods[] DEVMETHOD(bus_print_child, bus_generic_print_child), DEVMETHOD(bus_driver_added, bus_generic_driver_added), + /* crypto device methods */ + DEVMETHOD(cryptodev_newsession, xlr_sec_newsession), + DEVMETHOD(cryptodev_freesession,xlr_sec_freesession), + DEVMETHOD(cryptodev_process, xlr_sec_process), + {0, 0} }; @@ -95,81 +98,63 @@ static devclass_t xlr_sec_devclass; DRIVER_MODULE(rmisec, iodi, xlr_sec_driver, xlr_sec_devclass, 0, 0); MODULE_DEPEND(rmisec, crypto, 1, 1, 1); - - static int xlr_sec_probe(device_t dev) { - return (BUS_PROBE_DEFAULT); + device_set_desc(dev, "XLR Security Accelerator"); + return (BUS_PROBE_DEFAULT); } - /* * Attach an interface that successfully probed. */ static int xlr_sec_attach(device_t dev) { - struct xlr_sec_softc *sc = device_get_softc(dev); - bzero(sc, sizeof(*sc)); sc->sc_dev = dev; - - - mtx_init(&sc->sc_mtx, device_get_nameunit(dev), "rmi crypto driver", MTX_DEF); - - sc->sc_cid = crypto_get_driverid(0); + mtx_init(&sc->sc_mtx, device_get_nameunit(dev), "rmi crypto driver", + MTX_DEF); + sc->sc_cid = crypto_get_driverid(dev, CRYPTOCAP_F_HARDWARE); if (sc->sc_cid < 0) { printf("xlr_sec - error : could not get the driver id\n"); goto error_exit; } - if (crypto_register(sc->sc_cid, CRYPTO_DES_CBC, 0, 0, - xlr_sec_newsession, xlr_sec_freesession, xlr_sec_process, sc) != 0) + if (crypto_register(sc->sc_cid, CRYPTO_DES_CBC, 0, 0) != 0) printf("register failed for CRYPTO_DES_CBC\n"); - if (crypto_register(sc->sc_cid, CRYPTO_3DES_CBC, 0, 0, - xlr_sec_newsession, xlr_sec_freesession, xlr_sec_process, sc) != 0) + if (crypto_register(sc->sc_cid, CRYPTO_3DES_CBC, 0, 0) != 0) printf("register failed for CRYPTO_3DES_CBC\n"); - if (crypto_register(sc->sc_cid, CRYPTO_AES_CBC, 0, 0, - xlr_sec_newsession, xlr_sec_freesession, - xlr_sec_process, sc) != 0) + if (crypto_register(sc->sc_cid, CRYPTO_AES_CBC, 0, 0) != 0) printf("register failed for CRYPTO_AES_CBC\n"); - if (crypto_register(sc->sc_cid, CRYPTO_ARC4, 0, 0, - xlr_sec_newsession, xlr_sec_freesession, xlr_sec_process, sc) != 0) + if (crypto_register(sc->sc_cid, CRYPTO_ARC4, 0, 0) != 0) printf("register failed for CRYPTO_ARC4\n"); - - if (crypto_register(sc->sc_cid, CRYPTO_MD5, 0, 0, - xlr_sec_newsession, xlr_sec_freesession, xlr_sec_process, sc) != 0) + if (crypto_register(sc->sc_cid, CRYPTO_MD5, 0, 0) != 0) printf("register failed for CRYPTO_MD5\n"); - if (crypto_register(sc->sc_cid, CRYPTO_SHA1, 0, 0, - xlr_sec_newsession, xlr_sec_freesession, xlr_sec_process, sc) != 0) + if (crypto_register(sc->sc_cid, CRYPTO_SHA1, 0, 0) != 0) printf("register failed for CRYPTO_SHA1\n"); - if (crypto_register(sc->sc_cid, CRYPTO_MD5_HMAC, 0, 0, - xlr_sec_newsession, xlr_sec_freesession, xlr_sec_process, sc) != 0) + if (crypto_register(sc->sc_cid, CRYPTO_MD5_HMAC, 0, 0) != 0) printf("register failed for CRYPTO_MD5_HMAC\n"); - if (crypto_register(sc->sc_cid, CRYPTO_SHA1_HMAC, 0, 0, - xlr_sec_newsession, xlr_sec_freesession, xlr_sec_process, sc) != 0) + if (crypto_register(sc->sc_cid, CRYPTO_SHA1_HMAC, 0, 0) != 0) printf("register failed for CRYPTO_SHA1_HMAC\n"); - xlr_sec_init(sc); + device_printf(dev, "Initialization complete!\n"); return (0); - error_exit: return (ENXIO); } - /* * Detach an interface that successfully probed. */ @@ -194,39 +179,28 @@ xlr_sec_detach(device_t dev) return (0); } - - - /* * Allocate a new 'session' and return an encoded session id. 'sidp' * contains our registration id, and should contain an encoded session * id on successful allocation. */ static int -xlr_sec_newsession(void *arg, u_int32_t * sidp, struct cryptoini *cri) +xlr_sec_newsession(device_t dev, u_int32_t *sidp, struct cryptoini *cri) { struct cryptoini *c; - struct xlr_sec_softc *sc = arg; + struct xlr_sec_softc *sc = device_get_softc(dev); int mac = 0, cry = 0, sesn; struct xlr_sec_session *ses = NULL; - if (sidp == NULL || cri == NULL || sc == NULL) return (EINVAL); - if (sc->sc_sessions == NULL) { ses = sc->sc_sessions = (struct xlr_sec_session *)malloc( sizeof(struct xlr_sec_session), M_DEVBUF, M_NOWAIT); if (ses == NULL) return (ENOMEM); - - ses->desc_ptr = (void *)xlr_sec_allocate_desc((void *)ses); - if (ses->desc_ptr == NULL) - return (ENOMEM); - sesn = 0; - ses->sessionid = sesn; sc->sc_nsessions = 1; } else { for (sesn = 0; sesn < sc->sc_nsessions; sesn++) { @@ -242,23 +216,22 @@ xlr_sec_newsession(void *arg, u_int32_t sizeof(struct xlr_sec_session), M_DEVBUF, M_NOWAIT); if (ses == NULL) return (ENOMEM); - bcopy(sc->sc_sessions, ses, sesn * sizeof(struct xlr_sec_session)); - bzero(sc->sc_sessions, sesn * sizeof(struct xlr_sec_session)); + bcopy(sc->sc_sessions, ses, sesn * sizeof(*ses)); + bzero(sc->sc_sessions, sesn * sizeof(*ses)); free(sc->sc_sessions, M_DEVBUF); sc->sc_sessions = ses; ses = &sc->sc_sessions[sesn]; - ses->sessionid = sesn; - ses->desc_ptr = (void *)xlr_sec_allocate_desc((void *)ses); - if (ses->desc_ptr == NULL) - return (ENOMEM); sc->sc_nsessions++; } } + bzero(ses, sizeof(*ses)); + ses->sessionid = sesn; + ses->desc_ptr = xlr_sec_allocate_desc(ses); + if (ses->desc_ptr == NULL) + return (ENOMEM); ses->hs_used = 1; - for (c = cri; c != NULL; c = c->cri_next) { - switch (c->cri_alg) { case CRYPTO_MD5: case CRYPTO_SHA1: @@ -313,9 +286,9 @@ xlr_sec_newsession(void *arg, u_int32_t * XXX to blow away any keys already stored there. */ static int -xlr_sec_freesession(void *arg, u_int64_t tid) +xlr_sec_freesession(device_t dev, u_int64_t tid) { - struct xlr_sec_softc *sc = arg; + struct xlr_sec_softc *sc = device_get_softc(dev); int session; u_int32_t sid = CRYPTO_SESID2LID(tid); @@ -327,7 +300,6 @@ xlr_sec_freesession(void *arg, u_int64_t return (EINVAL); sc->sc_sessions[session].hs_used = 0; - return (0); } @@ -375,11 +347,10 @@ xlr_sec_print_data(struct cryptop *crp) #endif - static int -xlr_sec_process(void *arg, struct cryptop *crp, int hint) +xlr_sec_process(device_t dev, struct cryptop *crp, int hint) { - struct xlr_sec_softc *sc = arg; + struct xlr_sec_softc *sc = device_get_softc(dev); struct xlr_sec_command *cmd = NULL; int session, err; struct cryptodesc *crd1, *crd2, *maccrd, *enccrd; @@ -466,7 +437,6 @@ xlr_sec_process(void *arg, struct crypto cmd->op.num_packets = 1; cmd->op.num_fragments = 1; - if (cmd->op.source_buf_size > SEC_MAX_FRAG_LEN) { ses->multi_frag_flag = 1; } else { @@ -499,7 +469,6 @@ xlr_sec_process(void *arg, struct crypto cmd->op.pkt_iv = XLR_SEC_PKT_IV_OLD; cmd->op.pkt_lastword = XLR_SEC_LASTWORD_128; - default: printf("currently not handled\n"); } @@ -524,8 +493,10 @@ xlr_sec_process(void *arg, struct crypto memcpy(&cmd->op.crypt_key[0], enccrd->crd_key, XLR_SEC_DES_KEY_LENGTH); } else { cmd->op.cipher_type = XLR_SEC_CIPHER_TYPE_3DES; - //if (enccrd->crd_flags & CRD_F_KEY_EXPLICIT) { - memcpy(&cmd->op.crypt_key[0], enccrd->crd_key, XLR_SEC_3DES_KEY_LENGTH); + //if (enccrd->crd_flags & CRD_F_KEY_EXPLICIT) + { + memcpy(&cmd->op.crypt_key[0], enccrd->crd_key, + XLR_SEC_3DES_KEY_LENGTH); } } @@ -550,16 +521,19 @@ xlr_sec_process(void *arg, struct crypto cmd->op.pkt_lastword = XLR_SEC_LASTWORD_128; //if ((!(enccrd->crd_flags & CRD_F_IV_PRESENT)) && - if ((enccrd->crd_flags & CRD_F_IV_EXPLICIT)) { - memcpy(&cmd->op.initial_vector[0], enccrd->crd_iv, XLR_SEC_DES_IV_LENGTH); - } + if ((enccrd->crd_flags & CRD_F_IV_EXPLICIT)) { + memcpy(&cmd->op.initial_vector[0], enccrd->crd_iv, + XLR_SEC_DES_IV_LENGTH); + } break; case CRYPTO_AES_CBC: if (enccrd->crd_alg == CRYPTO_AES_CBC) { cmd->op.cipher_type = XLR_SEC_CIPHER_TYPE_AES128; - //if (enccrd->crd_flags & CRD_F_KEY_EXPLICIT) { - memcpy(&cmd->op.crypt_key[0], enccrd->crd_key, XLR_SEC_AES128_KEY_LENGTH); + //if (enccrd->crd_flags & CRD_F_KEY_EXPLICIT) + { + memcpy(&cmd->op.crypt_key[0], enccrd->crd_key, + XLR_SEC_AES128_KEY_LENGTH); } } cmd->op.cipher_mode = XLR_SEC_CIPHER_MODE_CBC; @@ -583,11 +557,11 @@ xlr_sec_process(void *arg, struct crypto cmd->op.pkt_lastword = XLR_SEC_LASTWORD_128; //if (!(enccrd->crd_flags & CRD_F_IV_PRESENT)) { - if ((enccrd->crd_flags & CRD_F_IV_EXPLICIT)) { - memcpy(&cmd->op.initial_vector[0], enccrd->crd_iv, XLR_SEC_AES_BLOCK_SIZE); - } - // + if ((enccrd->crd_flags & CRD_F_IV_EXPLICIT)) { + memcpy(&cmd->op.initial_vector[0], enccrd->crd_iv, + XLR_SEC_AES_BLOCK_SIZE); } + //} break; } } Modified: head/sys/mips/rmi/iodi.c ============================================================================== --- head/sys/mips/rmi/iodi.c Thu Sep 16 20:11:40 2010 (r212762) +++ head/sys/mips/rmi/iodi.c Thu Sep 16 20:23:22 2010 (r212763) @@ -213,6 +213,7 @@ iodi_attach(device_t dev) device_add_child(dev, "uart", 0); device_add_child(dev, "xlr_i2c", 0); device_add_child(dev, "pcib", 0); + device_add_child(dev, "rmisec", -1); if (xlr_board_info.usb) device_add_child(dev, "ehci", 0); From owner-svn-src-head@FreeBSD.ORG Thu Sep 16 21:06:24 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 48F1C1065697; Thu, 16 Sep 2010 21:06:24 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 38F328FC21; Thu, 16 Sep 2010 21:06:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8GL6OK1007024; Thu, 16 Sep 2010 21:06:24 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8GL6OXx007022; Thu, 16 Sep 2010 21:06:24 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201009162106.o8GL6OXx007022@svn.freebsd.org> From: Xin LI Date: Thu, 16 Sep 2010 21:06:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212764 - head/sys/dev/alc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Sep 2010 21:06:24 -0000 Author: delphij Date: Thu Sep 16 21:06:23 2010 New Revision: 212764 URL: http://svn.freebsd.org/changeset/base/212764 Log: status bits should be &'ed against status to be really functional. Reported by: Jike Song Reviewed by: yongari MFC after: 1 week Modified: head/sys/dev/alc/if_alc.c Modified: head/sys/dev/alc/if_alc.c ============================================================================== --- head/sys/dev/alc/if_alc.c Thu Sep 16 20:23:22 2010 (r212763) +++ head/sys/dev/alc/if_alc.c Thu Sep 16 21:06:23 2010 (r212764) @@ -2948,8 +2948,8 @@ alc_rxeof(struct alc_softc *sc, struct r * errored frames. */ status |= RRD_TCP_UDPCSUM_NOK | RRD_IPCSUM_NOK; - if ((RRD_ERR_CRC | RRD_ERR_ALIGN | RRD_ERR_TRUNC | - RRD_ERR_RUNT) != 0) + if ((status & (RRD_ERR_CRC | RRD_ERR_ALIGN | + RRD_ERR_TRUNC | RRD_ERR_RUNT)) != 0) return; } From owner-svn-src-head@FreeBSD.ORG Thu Sep 16 21:06:45 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B72911065693; Thu, 16 Sep 2010 21:06:45 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A5EE78FC0C; Thu, 16 Sep 2010 21:06:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8GL6j1T007075; Thu, 16 Sep 2010 21:06:45 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8GL6jl2007066; Thu, 16 Sep 2010 21:06:45 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201009162106.o8GL6jl2007066@svn.freebsd.org> From: Andre Oppermann Date: Thu, 16 Sep 2010 21:06:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212765 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Sep 2010 21:06:45 -0000 Author: andre Date: Thu Sep 16 21:06:45 2010 New Revision: 212765 URL: http://svn.freebsd.org/changeset/base/212765 Log: Remove the TCP inflight bandwidth limiter as announced in r211315 to give way for the pluggable congestion control framework. It is the task of the congestion control algorithm to set the congestion window and amount of inflight data without external interference. In 'struct tcpcb' the variables previously used by the inflight limiter are renamed to spares to keep the ABI intact and to have some more space for future extensions. In 'struct tcp_info' the variable 'tcpi_snd_bwnd' is not removed to preserve the ABI. It is always set to 0. In siftr.c in 'struct pkt_node' the variable 'snd_bwnd' is not removed to preserve the ABI. It is always set to 0. These unused variable in the various structures may be reused in the future or garbage collected before the next release or at some other point when an ABI change happens anyway for other reasons. No MFC is planned. The inflight bandwidth limiter stays disabled by default in the other branches but remains available. Modified: head/sys/netinet/siftr.c head/sys/netinet/tcp.h head/sys/netinet/tcp_input.c head/sys/netinet/tcp_output.c head/sys/netinet/tcp_subr.c head/sys/netinet/tcp_timer.h head/sys/netinet/tcp_usrreq.c head/sys/netinet/tcp_var.h Modified: head/sys/netinet/siftr.c ============================================================================== --- head/sys/netinet/siftr.c Thu Sep 16 21:06:23 2010 (r212764) +++ head/sys/netinet/siftr.c Thu Sep 16 21:06:45 2010 (r212765) @@ -193,7 +193,7 @@ struct pkt_node { u_long snd_wnd; /* Receive Window (bytes). */ u_long rcv_wnd; - /* Bandwidth Controlled Window (bytes). */ + /* Unused (was: Bandwidth Controlled Window (bytes)). */ u_long snd_bwnd; /* Slow Start Threshold (bytes). */ u_long snd_ssthresh; @@ -775,7 +775,7 @@ siftr_siftdata(struct pkt_node *pn, stru pn->snd_cwnd = tp->snd_cwnd; pn->snd_wnd = tp->snd_wnd; pn->rcv_wnd = tp->rcv_wnd; - pn->snd_bwnd = tp->snd_bwnd; + pn->snd_bwnd = 0; /* Unused, kept for compat. */ pn->snd_ssthresh = tp->snd_ssthresh; pn->snd_scale = tp->snd_scale; pn->rcv_scale = tp->rcv_scale; Modified: head/sys/netinet/tcp.h ============================================================================== --- head/sys/netinet/tcp.h Thu Sep 16 21:06:23 2010 (r212764) +++ head/sys/netinet/tcp.h Thu Sep 16 21:06:45 2010 (r212765) @@ -221,7 +221,7 @@ struct tcp_info { /* FreeBSD extensions to tcp_info. */ u_int32_t tcpi_snd_wnd; /* Advertised send window. */ - u_int32_t tcpi_snd_bwnd; /* Bandwidth send window. */ + u_int32_t tcpi_snd_bwnd; /* No longer used. */ u_int32_t tcpi_snd_nxt; /* Next egress seqno */ u_int32_t tcpi_rcv_nxt; /* Next ingress seqno */ u_int32_t tcpi_toe_tid; /* HWTID for TOE endpoints */ Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Thu Sep 16 21:06:23 2010 (r212764) +++ head/sys/netinet/tcp_input.c Thu Sep 16 21:06:45 2010 (r212765) @@ -1321,7 +1321,6 @@ tcp_do_segment(struct mbuf *m, struct tc tcp_xmit_timer(tp, ticks - tp->t_rtttime); } - tcp_xmit_bandwidth_limit(tp, th->th_ack); acked = th->th_ack - tp->snd_una; TCPSTAT_INC(tcps_rcvackpack); TCPSTAT_ADD(tcps_rcvackbyte, acked); @@ -2278,7 +2277,6 @@ process_ACK: tp->t_rttlow = ticks - tp->t_rtttime; tcp_xmit_timer(tp, ticks - tp->t_rtttime); } - tcp_xmit_bandwidth_limit(tp, th->th_ack); /* * If all outstanding data is acked, stop retransmit @@ -3328,8 +3326,6 @@ tcp_mss(struct tcpcb *tp, int offer) tp->snd_ssthresh = max(2 * mss, metrics.rmx_ssthresh); TCPSTAT_INC(tcps_usedssthresh); } - if (metrics.rmx_bandwidth) - tp->snd_bandwidth = metrics.rmx_bandwidth; /* * Set the slow-start flight size depending on whether this Modified: head/sys/netinet/tcp_output.c ============================================================================== --- head/sys/netinet/tcp_output.c Thu Sep 16 21:06:23 2010 (r212764) +++ head/sys/netinet/tcp_output.c Thu Sep 16 21:06:45 2010 (r212765) @@ -225,7 +225,6 @@ again: tso = 0; off = tp->snd_nxt - tp->snd_una; sendwin = min(tp->snd_wnd, tp->snd_cwnd); - sendwin = min(sendwin, tp->snd_bwnd); flags = tcp_outflags[tp->t_state]; /* Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Thu Sep 16 21:06:23 2010 (r212764) +++ head/sys/netinet/tcp_subr.c Thu Sep 16 21:06:45 2010 (r212765) @@ -160,14 +160,6 @@ SYSCTL_VNET_PROC(_net_inet_tcp, TCPCTL_V "Default TCP Maximum Segment Size for IPv6"); #endif -static int -vnet_sysctl_msec_to_ticks(SYSCTL_HANDLER_ARGS) -{ - - VNET_SYSCTL_ARG(req, arg1); - return (sysctl_msec_to_ticks(oidp, arg1, arg2, req)); -} - /* * Minimum MSS we accept and use. This prevents DoS attacks where * we are forced to a ridiculous low MSS like 20 and send hundreds @@ -213,50 +205,6 @@ SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, &VNET_NAME(tcp_isn_reseed_interval), 0, "Seconds between reseeding of ISN secret"); -/* - * TCP bandwidth limiting sysctls. Note that the default lower bound of - * 1024 exists only for debugging. A good production default would be - * something like 6100. - */ -SYSCTL_NODE(_net_inet_tcp, OID_AUTO, inflight, CTLFLAG_RW, 0, - "TCP inflight data limiting"); - -static VNET_DEFINE(int, tcp_inflight_enable) = 0; -#define V_tcp_inflight_enable VNET(tcp_inflight_enable) -SYSCTL_VNET_INT(_net_inet_tcp_inflight, OID_AUTO, enable, CTLFLAG_RW, - &VNET_NAME(tcp_inflight_enable), 0, - "Enable automatic TCP inflight data limiting"); - -static int tcp_inflight_debug = 0; -SYSCTL_INT(_net_inet_tcp_inflight, OID_AUTO, debug, CTLFLAG_RW, - &tcp_inflight_debug, 0, - "Debug TCP inflight calculations"); - -static VNET_DEFINE(int, tcp_inflight_rttthresh); -#define V_tcp_inflight_rttthresh VNET(tcp_inflight_rttthresh) -SYSCTL_VNET_PROC(_net_inet_tcp_inflight, OID_AUTO, rttthresh, - CTLTYPE_INT|CTLFLAG_RW, &VNET_NAME(tcp_inflight_rttthresh), 0, - vnet_sysctl_msec_to_ticks, "I", - "RTT threshold below which inflight will deactivate itself"); - -static VNET_DEFINE(int, tcp_inflight_min) = 6144; -#define V_tcp_inflight_min VNET(tcp_inflight_min) -SYSCTL_VNET_INT(_net_inet_tcp_inflight, OID_AUTO, min, CTLFLAG_RW, - &VNET_NAME(tcp_inflight_min), 0, - "Lower-bound for TCP inflight window"); - -static VNET_DEFINE(int, tcp_inflight_max) = TCP_MAXWIN << TCP_MAX_WINSHIFT; -#define V_tcp_inflight_max VNET(tcp_inflight_max) -SYSCTL_VNET_INT(_net_inet_tcp_inflight, OID_AUTO, max, CTLFLAG_RW, - &VNET_NAME(tcp_inflight_max), 0, - "Upper-bound for TCP inflight window"); - -static VNET_DEFINE(int, tcp_inflight_stab) = 20; -#define V_tcp_inflight_stab VNET(tcp_inflight_stab) -SYSCTL_VNET_INT(_net_inet_tcp_inflight, OID_AUTO, stab, CTLFLAG_RW, - &VNET_NAME(tcp_inflight_stab), 0, - "Inflight Algorithm Stabilization 20 = 2 packets"); - #ifdef TCP_SORECEIVE_STREAM static int tcp_soreceive_stream = 0; SYSCTL_INT(_net_inet_tcp, OID_AUTO, soreceive_stream, CTLFLAG_RDTUN, @@ -338,8 +286,6 @@ tcp_init(void) in_pcbinfo_init(&V_tcbinfo, "tcp", &V_tcb, hashsize, hashsize, "tcp_inpcb", tcp_inpcb_init, NULL, UMA_ZONE_NOFREE); - V_tcp_inflight_rttthresh = TCPTV_INFLIGHT_RTTTHRESH; - /* * These have to be type stable for the benefit of the timers. */ @@ -728,10 +674,8 @@ tcp_newtcpcb(struct inpcb *inp) tp->t_rttmin = tcp_rexmit_min; tp->t_rxtcur = TCPTV_RTOBASE; tp->snd_cwnd = TCP_MAXWIN << TCP_MAX_WINSHIFT; - tp->snd_bwnd = TCP_MAXWIN << TCP_MAX_WINSHIFT; tp->snd_ssthresh = TCP_MAXWIN << TCP_MAX_WINSHIFT; tp->t_rcvtime = ticks; - tp->t_bw_rtttime = ticks; /* * IPv4 TTL initialization is necessary for an IPv6 socket as well, * because the socket may be bound to an IPv6 wildcard address, @@ -849,8 +793,6 @@ tcp_discardcb(struct tcpcb *tp) metrics.rmx_rtt = tp->t_srtt; metrics.rmx_rttvar = tp->t_rttvar; - /* XXX: This wraps if the pipe is more than 4 Gbit per second */ - metrics.rmx_bandwidth = tp->snd_bandwidth; metrics.rmx_cwnd = tp->snd_cwnd; metrics.rmx_sendpipe = 0; metrics.rmx_recvpipe = 0; @@ -1773,154 +1715,6 @@ ipsec_hdrsiz_tcp(struct tcpcb *tp) } #endif /* IPSEC */ -/* - * TCP BANDWIDTH DELAY PRODUCT WINDOW LIMITING - * - * This code attempts to calculate the bandwidth-delay product as a - * means of determining the optimal window size to maximize bandwidth, - * minimize RTT, and avoid the over-allocation of buffers on interfaces and - * routers. This code also does a fairly good job keeping RTTs in check - * across slow links like modems. We implement an algorithm which is very - * similar (but not meant to be) TCP/Vegas. The code operates on the - * transmitter side of a TCP connection and so only effects the transmit - * side of the connection. - * - * BACKGROUND: TCP makes no provision for the management of buffer space - * at the end points or at the intermediate routers and switches. A TCP - * stream, whether using NewReno or not, will eventually buffer as - * many packets as it is able and the only reason this typically works is - * due to the fairly small default buffers made available for a connection - * (typicaly 16K or 32K). As machines use larger windows and/or window - * scaling it is now fairly easy for even a single TCP connection to blow-out - * all available buffer space not only on the local interface, but on - * intermediate routers and switches as well. NewReno makes a misguided - * attempt to 'solve' this problem by waiting for an actual failure to occur, - * then backing off, then steadily increasing the window again until another - * failure occurs, ad-infinitum. This results in terrible oscillation that - * is only made worse as network loads increase and the idea of intentionally - * blowing out network buffers is, frankly, a terrible way to manage network - * resources. - * - * It is far better to limit the transmit window prior to the failure - * condition being achieved. There are two general ways to do this: First - * you can 'scan' through different transmit window sizes and locate the - * point where the RTT stops increasing, indicating that you have filled the - * pipe, then scan backwards until you note that RTT stops decreasing, then - * repeat ad-infinitum. This method works in principle but has severe - * implementation issues due to RTT variances, timer granularity, and - * instability in the algorithm which can lead to many false positives and - * create oscillations as well as interact badly with other TCP streams - * implementing the same algorithm. - * - * The second method is to limit the window to the bandwidth delay product - * of the link. This is the method we implement. RTT variances and our - * own manipulation of the congestion window, bwnd, can potentially - * destabilize the algorithm. For this reason we have to stabilize the - * elements used to calculate the window. We do this by using the minimum - * observed RTT, the long term average of the observed bandwidth, and - * by adding two segments worth of slop. It isn't perfect but it is able - * to react to changing conditions and gives us a very stable basis on - * which to extend the algorithm. - */ -void -tcp_xmit_bandwidth_limit(struct tcpcb *tp, tcp_seq ack_seq) -{ - u_long bw; - u_long bwnd; - int save_ticks; - - INP_WLOCK_ASSERT(tp->t_inpcb); - - /* - * If inflight_enable is disabled in the middle of a tcp connection, - * make sure snd_bwnd is effectively disabled. - */ - if (V_tcp_inflight_enable == 0 || - tp->t_rttlow < V_tcp_inflight_rttthresh) { - tp->snd_bwnd = TCP_MAXWIN << TCP_MAX_WINSHIFT; - tp->snd_bandwidth = 0; - return; - } - - /* - * Figure out the bandwidth. Due to the tick granularity this - * is a very rough number and it MUST be averaged over a fairly - * long period of time. XXX we need to take into account a link - * that is not using all available bandwidth, but for now our - * slop will ramp us up if this case occurs and the bandwidth later - * increases. - * - * Note: if ticks rollover 'bw' may wind up negative. We must - * effectively reset t_bw_rtttime for this case. - */ - save_ticks = ticks; - if ((u_int)(save_ticks - tp->t_bw_rtttime) < 1) - return; - - bw = (int64_t)(ack_seq - tp->t_bw_rtseq) * hz / - (save_ticks - tp->t_bw_rtttime); - tp->t_bw_rtttime = save_ticks; - tp->t_bw_rtseq = ack_seq; - if (tp->t_bw_rtttime == 0 || (int)bw < 0) - return; - bw = ((int64_t)tp->snd_bandwidth * 15 + bw) >> 4; - - tp->snd_bandwidth = bw; - - /* - * Calculate the semi-static bandwidth delay product, plus two maximal - * segments. The additional slop puts us squarely in the sweet - * spot and also handles the bandwidth run-up case and stabilization. - * Without the slop we could be locking ourselves into a lower - * bandwidth. - * - * Situations Handled: - * (1) Prevents over-queueing of packets on LANs, especially on - * high speed LANs, allowing larger TCP buffers to be - * specified, and also does a good job preventing - * over-queueing of packets over choke points like modems - * (at least for the transmit side). - * - * (2) Is able to handle changing network loads (bandwidth - * drops so bwnd drops, bandwidth increases so bwnd - * increases). - * - * (3) Theoretically should stabilize in the face of multiple - * connections implementing the same algorithm (this may need - * a little work). - * - * (4) Stability value (defaults to 20 = 2 maximal packets) can - * be adjusted with a sysctl but typically only needs to be - * on very slow connections. A value no smaller then 5 - * should be used, but only reduce this default if you have - * no other choice. - */ -#define USERTT ((tp->t_srtt + tp->t_rttbest) / 2) - bwnd = (int64_t)bw * USERTT / (hz << TCP_RTT_SHIFT) + V_tcp_inflight_stab * tp->t_maxseg / 10; -#undef USERTT - - if (tcp_inflight_debug > 0) { - static int ltime; - if ((u_int)(ticks - ltime) >= hz / tcp_inflight_debug) { - ltime = ticks; - printf("%p bw %ld rttbest %d srtt %d bwnd %ld\n", - tp, - bw, - tp->t_rttbest, - tp->t_srtt, - bwnd - ); - } - } - if ((long)bwnd < V_tcp_inflight_min) - bwnd = V_tcp_inflight_min; - if (bwnd > V_tcp_inflight_max) - bwnd = V_tcp_inflight_max; - if ((long)bwnd < tp->t_maxseg * 2) - bwnd = tp->t_maxseg * 2; - tp->snd_bwnd = bwnd; -} - #ifdef TCP_SIGNATURE /* * Callback function invoked by m_apply() to digest TCP segment data Modified: head/sys/netinet/tcp_timer.h ============================================================================== --- head/sys/netinet/tcp_timer.h Thu Sep 16 21:06:23 2010 (r212764) +++ head/sys/netinet/tcp_timer.h Thu Sep 16 21:06:45 2010 (r212765) @@ -86,9 +86,6 @@ #define TCPTV_KEEPINTVL ( 75*hz) /* default probe interval */ #define TCPTV_KEEPCNT 8 /* max probes before drop */ -#define TCPTV_INFLIGHT_RTTTHRESH (10*hz/1000) /* below which inflight - disengages, in msec */ - #define TCPTV_FINWAIT2_TIMEOUT (60*hz) /* FIN_WAIT_2 timeout if no receiver */ /* Modified: head/sys/netinet/tcp_usrreq.c ============================================================================== --- head/sys/netinet/tcp_usrreq.c Thu Sep 16 21:06:23 2010 (r212764) +++ head/sys/netinet/tcp_usrreq.c Thu Sep 16 21:06:45 2010 (r212765) @@ -1105,7 +1105,6 @@ tcp_connect(struct tcpcb *tp, struct soc tp->t_state = TCPS_SYN_SENT; tcp_timer_activate(tp, TT_KEEP, tcp_keepinit); tp->iss = tcp_new_isn(tp); - tp->t_bw_rtseq = tp->iss; tcp_sendseqinit(tp); return 0; @@ -1168,7 +1167,6 @@ tcp6_connect(struct tcpcb *tp, struct so tp->t_state = TCPS_SYN_SENT; tcp_timer_activate(tp, TT_KEEP, tcp_keepinit); tp->iss = tcp_new_isn(tp); - tp->t_bw_rtseq = tp->iss; tcp_sendseqinit(tp); return 0; @@ -1214,7 +1212,7 @@ tcp_fill_info(struct tcpcb *tp, struct t ti->tcpi_rcv_space = tp->rcv_wnd; ti->tcpi_rcv_nxt = tp->rcv_nxt; ti->tcpi_snd_wnd = tp->snd_wnd; - ti->tcpi_snd_bwnd = tp->snd_bwnd; + ti->tcpi_snd_bwnd = 0; /* Unused, kept for compat. */ ti->tcpi_snd_nxt = tp->snd_nxt; ti->tcpi_snd_mss = tp->t_maxseg; ti->tcpi_rcv_mss = tp->t_maxseg; @@ -1795,26 +1793,24 @@ db_print_tcpcb(struct tcpcb *tp, const c tp->rcv_adv, tp->rcv_wnd, tp->rcv_up); db_print_indent(indent); - db_printf("snd_wnd: %lu snd_cwnd: %lu snd_bwnd: %lu\n", - tp->snd_wnd, tp->snd_cwnd, tp->snd_bwnd); + db_printf("snd_wnd: %lu snd_cwnd: %lu\n", + tp->snd_wnd, tp->snd_cwnd); db_print_indent(indent); - db_printf("snd_ssthresh: %lu snd_bandwidth: %lu snd_recover: " - "0x%08x\n", tp->snd_ssthresh, tp->snd_bandwidth, - tp->snd_recover); + db_printf("snd_ssthresh: %lu snd_recover: " + "0x%08x\n", tp->snd_ssthresh, tp->snd_recover); db_print_indent(indent); db_printf("t_maxopd: %u t_rcvtime: %u t_startime: %u\n", tp->t_maxopd, tp->t_rcvtime, tp->t_starttime); db_print_indent(indent); - db_printf("t_rttime: %u t_rtsq: 0x%08x t_bw_rtttime: %u\n", - tp->t_rtttime, tp->t_rtseq, tp->t_bw_rtttime); + db_printf("t_rttime: %u t_rtsq: 0x%08x\n", + tp->t_rtttime, tp->t_rtseq); db_print_indent(indent); - db_printf("t_bw_rtseq: 0x%08x t_rxtcur: %d t_maxseg: %u " - "t_srtt: %d\n", tp->t_bw_rtseq, tp->t_rxtcur, tp->t_maxseg, - tp->t_srtt); + db_printf("t_rxtcur: %d t_maxseg: %u t_srtt: %d\n", + tp->t_rxtcur, tp->t_maxseg, tp->t_srtt); db_print_indent(indent); db_printf("t_rttvar: %d t_rxtshift: %d t_rttmin: %u " Modified: head/sys/netinet/tcp_var.h ============================================================================== --- head/sys/netinet/tcp_var.h Thu Sep 16 21:06:23 2010 (r212764) +++ head/sys/netinet/tcp_var.h Thu Sep 16 21:06:45 2010 (r212765) @@ -135,12 +135,12 @@ struct tcpcb { u_long snd_wnd; /* send window */ u_long snd_cwnd; /* congestion-controlled window */ - u_long snd_bwnd; /* bandwidth-controlled window */ + u_long snd_spare1; /* unused */ u_long snd_ssthresh; /* snd_cwnd size threshold for * for slow start exponential to * linear switch */ - u_long snd_bandwidth; /* calculated bandwidth or 0 */ + u_long snd_spare2; /* unused */ tcp_seq snd_recover; /* for use in NewReno Fast Recovery */ u_int t_maxopd; /* mss plus options */ @@ -150,8 +150,8 @@ struct tcpcb { u_int t_rtttime; /* RTT measurement start time */ tcp_seq t_rtseq; /* sequence number being timed */ - u_int t_bw_rtttime; /* used for bandwidth calculation */ - tcp_seq t_bw_rtseq; /* used for bandwidth calculation */ + u_int t_bw_spare1; /* unused */ + tcp_seq t_bw_spare2; /* unused */ int t_rxtcur; /* current retransmit value (ticks) */ u_int t_maxseg; /* maximum segment size */ @@ -654,7 +654,6 @@ void tcpip_fillheaders(struct inpcb *, void tcp_timer_activate(struct tcpcb *, int, u_int); int tcp_timer_active(struct tcpcb *, int); void tcp_trace(short, short, struct tcpcb *, void *, struct tcphdr *, int); -void tcp_xmit_bandwidth_limit(struct tcpcb *tp, tcp_seq ack_seq); /* * All tcp_hc_* functions are IPv4 and IPv6 (via in_conninfo) */ From owner-svn-src-head@FreeBSD.ORG Thu Sep 16 21:42:03 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BDCAC1065672; Thu, 16 Sep 2010 21:42:03 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 7CF878FC08; Thu, 16 Sep 2010 21:42:03 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o8GLSju1008340; Thu, 16 Sep 2010 15:28:45 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Thu, 16 Sep 2010 15:28:54 -0600 (MDT) Message-Id: <20100916.152854.856152966653228621.imp@bsdimp.com> To: jmallett@FreeBSD.org From: "M. Warner Losh" In-Reply-To: References: <20100916084442.GB21622@dragon.NUXI.org> <20100916212043.N724@delplex.bde.org> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, obrien@FreeBSD.org, brde@optusnet.com.au Subject: Re: svn commit: r212374 - head/usr.bin/printf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Sep 2010 21:42:03 -0000 In message: Juli Mallett writes: : On Thu, Sep 16, 2010 at 04:36, Bruce Evans wro= te: : > WHat about the lesser burder on a character or two for putting -- i= n the : > synopsis where it is more visible: : > : > =A0 =A0 =A0 =A0printf [--] format [arguments ...] : = : Right, that's what I've been thinking about. For that matter, does : printf(1) need to use getopt(3) at all? It seems like simply checkin= g : for "--" could be sufficient. Does POSIX require that it exit with a= n : error if it's given any options? At the very least, it seems like it= : would be more productive to have printf(1) give unusually-helpful : error messages (perhaps merely changing its usage output to match tha= t : synopsis) if it encounters a string beginning with '-' other than : "--". if (getenv("POSIX_ME_HARDER") && arg[0] =3D=3D '-' && arg[1] !=3D '-')= errx(1, "Strict posix compliance says you lose."); might be all that's needed. Warner From owner-svn-src-head@FreeBSD.ORG Thu Sep 16 22:11:56 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2DE8B1065670; Thu, 16 Sep 2010 22:11:56 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1D1868FC14; Thu, 16 Sep 2010 22:11:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8GMBuxI008625; Thu, 16 Sep 2010 22:11:56 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8GMBtnI008623; Thu, 16 Sep 2010 22:11:55 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201009162211.o8GMBtnI008623@svn.freebsd.org> From: Andre Oppermann Date: Thu, 16 Sep 2010 22:11:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212769 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Sep 2010 22:11:56 -0000 Author: andre Date: Thu Sep 16 22:11:55 2010 New Revision: 212769 URL: http://svn.freebsd.org/changeset/base/212769 Log: The inflight bandwidth limiter was removed in r212765. Modified: head/share/man/man4/tcp.4 Modified: head/share/man/man4/tcp.4 ============================================================================== --- head/share/man/man4/tcp.4 Thu Sep 16 21:18:25 2010 (r212768) +++ head/share/man/man4/tcp.4 Thu Sep 16 22:11:55 2010 (r212769) @@ -32,7 +32,7 @@ .\" From: @(#)tcp.4 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd August 16, 2008 +.Dd September 16, 2010 .Dt TCP 4 .Os .Sh NAME @@ -383,72 +383,6 @@ code. For this reason, we use 200ms of slop and a near-0 minimum, which gives us an effective minimum of 200ms (similar to .Tn Linux ) . -.It Va inflight.enable -Enable -.Tn TCP -bandwidth-delay product limiting. -An attempt will be made to calculate -the bandwidth-delay product for each individual -.Tn TCP -connection, and limit -the amount of inflight data being transmitted, to avoid building up -unnecessary packets in the network. -This option is recommended if you -are serving a lot of data over connections with high bandwidth-delay -products, such as modems, GigE links, and fast long-haul WANs, and/or -you have configured your machine to accommodate large -.Tn TCP -windows. -In such -situations, without this option, you may experience high interactive -latencies or packet loss due to the overloading of intermediate routers -and switches. -Note that bandwidth-delay product limiting only effects -the transmit side of a -.Tn TCP -connection. -.It Va inflight.debug -Enable debugging for the bandwidth-delay product algorithm. -.It Va inflight.min -This puts a lower bound on the bandwidth-delay product window, in bytes. -A value of 1024 is typically used for debugging. -6000-16000 is more typical in a production installation. -Setting this value too low may result in -slow ramp-up times for bursty connections. -Setting this value too high effectively disables the algorithm. -.It Va inflight.max -This puts an upper bound on the bandwidth-delay product window, in bytes. -This value should not generally be modified, but may be used to set a -global per-connection limit on queued data, potentially allowing you to -intentionally set a less than optimum limit, to smooth data flow over a -network while still being able to specify huge internal -.Tn TCP -buffers. -.It Va inflight.stab -The bandwidth-delay product algorithm requires a slightly larger window -than it otherwise calculates for stability. -This parameter determines the extra window in maximal packets / 10. -The default value of 20 represents 2 maximal packets. -Reducing this value is not recommended, but you may -come across a situation with very slow links where the -.Xr ping 8 -time -reduction of the default inflight code is not sufficient. -If this case occurs, you should first try reducing -.Va inflight.min -and, if that does not -work, reduce both -.Va inflight.min -and -.Va inflight.stab , -trying values of -15, 10, or 5 for the latter. -Never use a value less than 5. -Reducing -.Va inflight.stab -can lead to upwards of a 20% underutilization of the link -as well as reducing the algorithm's ability to adapt to changing -situations and should only be done as a last resort. .It Va rfc3042 Enable the Limited Transmit algorithm as described in RFC 3042. It helps avoid timeouts on lossy links and also when the congestion window From owner-svn-src-head@FreeBSD.ORG Thu Sep 16 22:31:04 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 03EB21065670; Thu, 16 Sep 2010 22:31:04 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E77A18FC18; Thu, 16 Sep 2010 22:31:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8GMV3wO009121; Thu, 16 Sep 2010 22:31:03 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8GMV3Ov009118; Thu, 16 Sep 2010 22:31:03 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201009162231.o8GMV3Ov009118@svn.freebsd.org> From: "David E. O'Brien" Date: Thu, 16 Sep 2010 22:31:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212770 - head/usr.bin/script X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Sep 2010 22:31:04 -0000 Author: obrien Date: Thu Sep 16 22:31:03 2010 New Revision: 212770 URL: http://svn.freebsd.org/changeset/base/212770 Log: + Add the SCRIPT environmental variable to the sub-shell. Its value is the name of the typescript file. + Add the 'command' argument (if supplied on the command line) to the typescript file. This creates a more complete typescript when invoked this way - more equal to invoking script without supplying the 'command' argument. Modified: head/usr.bin/script/script.1 head/usr.bin/script/script.c Modified: head/usr.bin/script/script.1 ============================================================================== --- head/usr.bin/script/script.1 Thu Sep 16 22:11:55 2010 (r212769) +++ head/usr.bin/script/script.1 Thu Sep 16 22:31:03 2010 (r212770) @@ -117,6 +117,19 @@ The results are meant to emulate a hardc The following environment variable is utilized by .Nm : .Bl -tag -width SHELL +.It Ev SCRIPT +The +.Ev SCRIPT +environment variable is added to the sub-shell. +If +.Ev SCRIPT +already existed in the users environment, +its value is overwritten within the sub-shell. +The value of +.Ev SCRIPT +is the name of the +.Ar typescript +file. .It Ev SHELL If the variable .Ev SHELL Modified: head/usr.bin/script/script.c ============================================================================== --- head/usr.bin/script/script.c Thu Sep 16 22:11:55 2010 (r212769) +++ head/usr.bin/script/script.c Thu Sep 16 22:31:03 2010 (r212770) @@ -235,14 +235,21 @@ static void doshell(char **av) { const char *shell; + int k; shell = getenv("SHELL"); if (shell == NULL) shell = _PATH_BSHELL; + if (av[0]) + for (k = 0 ; av[k] ; ++k) + fprintf(fscript, "%s%s", k ? " " : "", av[k]); + fprintf(fscript, "\r\n"); + (void)close(master); (void)fclose(fscript); login_tty(slave); + setenv("SCRIPT", fname, 1); if (av[0]) { execvp(av[0], av); warn("%s", av[0]); From owner-svn-src-head@FreeBSD.ORG Thu Sep 16 22:38:28 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1D774106566C; Thu, 16 Sep 2010 22:38:28 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0CD9B8FC0A; Thu, 16 Sep 2010 22:38:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8GMcROG009307; Thu, 16 Sep 2010 22:38:27 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8GMcRA2009305; Thu, 16 Sep 2010 22:38:27 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201009162238.o8GMcRA2009305@svn.freebsd.org> From: "David E. O'Brien" Date: Thu, 16 Sep 2010 22:38:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212771 - head/usr.bin/ruptime X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Sep 2010 22:38:28 -0000 Author: obrien Date: Thu Sep 16 22:38:27 2010 New Revision: 212771 URL: http://svn.freebsd.org/changeset/base/212771 Log: Increase the hostname display width. Many machines are named with >12 characters. This still allows for 80 column output with load averages of 99.99, 99.99, 99.99. Modified: head/usr.bin/ruptime/ruptime.c Modified: head/usr.bin/ruptime/ruptime.c ============================================================================== --- head/usr.bin/ruptime/ruptime.c Thu Sep 16 22:31:03 2010 (r212770) +++ head/usr.bin/ruptime/ruptime.c Thu Sep 16 22:38:27 2010 (r212771) @@ -244,12 +244,12 @@ ruptime(const char *host, int aflg, int for (i = 0; i < (int)nhosts; i++) { hsp = &hs[i]; if (ISDOWN(hsp)) { - (void)printf("%-12.12s%s\n", hsp->hs_wd->wd_hostname, + (void)printf("%-25.25s%s\n", hsp->hs_wd->wd_hostname, interval(now - hsp->hs_wd->wd_recvtime, "down")); continue; } (void)printf( - "%-12.12s%s, %4d user%s load %*.2f, %*.2f, %*.2f\n", + "%-25.25s%s, %4d user%s load %*.2f, %*.2f, %*.2f\n", hsp->hs_wd->wd_hostname, interval((time_t)hsp->hs_wd->wd_sendtime - (time_t)hsp->hs_wd->wd_boottime, " up"), From owner-svn-src-head@FreeBSD.ORG Thu Sep 16 22:47:50 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F83A1065673; Thu, 16 Sep 2010 22:47:50 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) by mx1.freebsd.org (Postfix) with ESMTP id 302C58FC08; Thu, 16 Sep 2010 22:47:50 +0000 (UTC) Received: from turtle.stack.nl (turtle.stack.nl [IPv6:2001:610:1108:5010::132]) by mx1.stack.nl (Postfix) with ESMTP id C3D5535A825; Fri, 17 Sep 2010 00:47:48 +0200 (CEST) Received: by turtle.stack.nl (Postfix, from userid 1677) id AEA0D172A0; Fri, 17 Sep 2010 00:47:48 +0200 (CEST) Date: Fri, 17 Sep 2010 00:47:48 +0200 From: Jilles Tjoelker To: Juli Mallett Message-ID: <20100916224748.GA60291@stack.nl> References: <201009091927.o89JReXm022426@svn.freebsd.org> <20100916084442.GB21622@dragon.NUXI.org> <20100916212043.N724@delplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, David O'Brien , Bruce Evans Subject: Re: svn commit: r212374 - head/usr.bin/printf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Sep 2010 22:47:50 -0000 On Thu, Sep 16, 2010 at 01:10:33PM -0700, Juli Mallett wrote: > On Thu, Sep 16, 2010 at 04:36, Bruce Evans wrote: > > WHat about the lesser burder on a character or two for putting -- in the > > synopsis where it is more visible: > >        printf [--] format [arguments ...] > Right, that's what I've been thinking about. For that matter, does > printf(1) need to use getopt(3) at all? It seems like simply checking > for "--" could be sufficient. Does POSIX require that it exit with an > error if it's given any options? It does not: implementations may add options as an extension and future versions of POSIX may add options. So while it would be a valid extension to allow format strings starting with "-" without "--" protection (other than "--" itself), I think it would be unwise. Most implementations of printf(1), other than the zsh builtin, require "--" protection for format strings starting with "-". Some of them also accept a few options: ksh93's builtin and GNU coreutils accept common options like --help, bash's builtin has a -v option to write the output directly into a variable (which seems bad to me by the way; I think printf(1) should usually be a builtin but it should be possible to use an external version with only performance and ARG_MAX as downsides). It is preferable if attempts to use such options fail loudly rather than silently writing garbage. I do not like "frivolous" extensions either, extensions that cause scripts written for FreeBSD to break on other systems without a good reason. Also note that the strict treatment of "-" is possible because printf(1) has historically recognized and required "--". Utilities that have not historically recognized "--" such as most of the special builtins may need a weaker approach. For example, in -current I have changed . and exec to treat "--" specially but not any other string starting with "-". The strict approach is cleaner but may cause compatibility problems in those cases. > At the very least, it seems like it would be more productive to have > printf(1) give unusually-helpful error messages (perhaps merely > changing its usage output to match that synopsis) if it encounters a > string beginning with '-' other than "--". That would be acceptable. -- Jilles Tjoelker From owner-svn-src-head@FreeBSD.ORG Thu Sep 16 22:54:57 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 227D81065670; Thu, 16 Sep 2010 22:54:57 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 079CF8FC1C; Thu, 16 Sep 2010 22:54:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8GMsuRN009676; Thu, 16 Sep 2010 22:54:56 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8GMsuBY009674; Thu, 16 Sep 2010 22:54:56 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201009162254.o8GMsuBY009674@svn.freebsd.org> From: "Kenneth D. Merry" Date: Thu, 16 Sep 2010 22:54:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212772 - head/sys/dev/mps X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Sep 2010 22:54:57 -0000 Author: ken Date: Thu Sep 16 22:54:56 2010 New Revision: 212772 URL: http://svn.freebsd.org/changeset/base/212772 Log: MFp4 (//depot/projects/mps/...): According to the MPT2 spec, task management commands are serialized, and so no I/O should start while task management commands are active. So, to comply with that, freeze the SIM queue before we send any task management commands (abort, target reset, etc.) down to the IOC. We unfreeze the queue once the task management command completes. It isn't clear from the spec whether multiple simultaneous task management commands are supported. Right now it is possible to have multiple outstanding task management commands, especially in the abort case. Multiple outstanding aborts do complete successfully, so it may be supported. We also don't yet have any recovery mechanism (e.g. reset the IOC) if the task management command fails. Modified: head/sys/dev/mps/mps_sas.c Modified: head/sys/dev/mps/mps_sas.c ============================================================================== --- head/sys/dev/mps/mps_sas.c Thu Sep 16 22:38:27 2010 (r212771) +++ head/sys/dev/mps/mps_sas.c Thu Sep 16 22:54:56 2010 (r212772) @@ -438,6 +438,7 @@ mpssas_prepare_remove(struct mpssas_soft cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE; cm->cm_complete = mpssas_remove_device; cm->cm_targ = targ; + xpt_freeze_simq(sc->sassc->sim, 1); mps_map_command(sc, cm); } @@ -453,6 +454,7 @@ mpssas_remove_device(struct mps_softc *s reply = (MPI2_SCSI_TASK_MANAGE_REPLY *)cm->cm_reply; handle = cm->cm_targ->handle; + xpt_release_simq(sc->sassc->sim, 1); if (reply->IOCStatus != MPI2_IOCSTATUS_SUCCESS) { mps_printf(sc, "Failure 0x%x reseting device 0x%04x\n", reply->IOCStatus, handle); @@ -983,6 +985,11 @@ mpssas_abort_complete(struct mps_softc * mps_printf(sc, "%s: abort request on handle %#04x SMID %d " "complete\n", __func__, req->DevHandle, req->TaskMID); + /* + * Release the SIM queue, we froze it when we sent the abort. + */ + xpt_release_simq(sc->sassc->sim, 1); + mps_free_command(sc, cm); } @@ -1013,10 +1020,19 @@ mpssas_recovery(struct mps_softc *sc, st cm->cm_data = NULL; cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE; + /* + * Freeze the SIM queue while we issue the abort. According to the + * Fusion-MPT 2.0 spec, task management requests are serialized, + * and so the host should not send any I/O requests while task + * management requests are pending. + */ + xpt_freeze_simq(sc->sassc->sim, 1); + error = mps_map_command(sc, cm); if (error != 0) { mps_printf(sc, "%s: error mapping abort request!\n", __func__); + xpt_release_simq(sc->sassc->sim, 1); } #if 0 error = mpssas_reset(sc, targ, &resetcm); @@ -1361,7 +1377,13 @@ mpssas_resetdev(struct mpssas_softc *sas cm->cm_data = NULL; cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE; + xpt_freeze_simq(sassc->sim, 1); + error = mps_map_command(sassc->sc, cm); + + if (error != 0) + xpt_release_simq(sassc->sim, 1); + return (error); } @@ -1385,6 +1407,9 @@ mpssas_resetdev_complete(struct mps_soft ccb->ccb_h.status = CAM_REQ_CMP_ERR; mps_free_command(sc, cm); + + xpt_release_simq(sc->sassc->sim, 1); + xpt_done(ccb); } From owner-svn-src-head@FreeBSD.ORG Thu Sep 16 23:33:25 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6E4D11065675; Thu, 16 Sep 2010 23:33:25 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 43CC98FC18; Thu, 16 Sep 2010 23:33:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8GNXP1Z010489; Thu, 16 Sep 2010 23:33:25 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8GNXPLh010485; Thu, 16 Sep 2010 23:33:25 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201009162333.o8GNXPLh010485@svn.freebsd.org> From: Ed Maste Date: Thu, 16 Sep 2010 23:33:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212773 - head/sys/dev/aac X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Sep 2010 23:33:25 -0000 Author: emaste Date: Thu Sep 16 23:33:24 2010 New Revision: 212773 URL: http://svn.freebsd.org/changeset/base/212773 Log: Use device_printf where possible, and otherwise at least include the driver name in printf strings. Reported by: Mark Johnston Modified: head/sys/dev/aac/aac.c head/sys/dev/aac/aac_cam.c head/sys/dev/aac/aac_disk.c Modified: head/sys/dev/aac/aac.c ============================================================================== --- head/sys/dev/aac/aac.c Thu Sep 16 22:54:56 2010 (r212772) +++ head/sys/dev/aac/aac.c Thu Sep 16 23:33:24 2010 (r212773) @@ -391,7 +391,7 @@ aac_get_container_info(struct aac_softc if (aac_sync_fib(sc, ContainerCommand, 0, fib, sizeof(struct aac_mntinfo))) { - printf("Error probing container %d\n", cid); + device_printf(sc->aac_dev, "Error probing container %d\n", cid); return (NULL); } Modified: head/sys/dev/aac/aac_cam.c ============================================================================== --- head/sys/dev/aac/aac_cam.c Thu Sep 16 22:54:56 2010 (r212772) +++ head/sys/dev/aac/aac_cam.c Thu Sep 16 23:33:24 2010 (r212773) @@ -569,7 +569,7 @@ aac_cam_reset_bus(struct cam_sim *sim, u sc = camsc->inf->aac_sc; if (sc == NULL) { - printf("Null sc?\n"); + printf("aac: Null sc?\n"); return (CAM_REQ_ABORTED); } Modified: head/sys/dev/aac/aac_disk.c ============================================================================== --- head/sys/dev/aac/aac_disk.c Thu Sep 16 22:54:56 2010 (r212772) +++ head/sys/dev/aac/aac_disk.c Thu Sep 16 23:33:24 2010 (r212773) @@ -106,8 +106,9 @@ aac_disk_open(struct disk *dp) /* check that the controller is up and running */ if (sc->ad_controller->aac_state & AAC_STATE_SUSPEND) { - printf("Controller Suspended controller state = 0x%x\n", - sc->ad_controller->aac_state); + device_printf(sc->ad_controller->aac_dev, + "Controller Suspended controller state = 0x%x\n", + sc->ad_controller->aac_state); return(ENXIO); } @@ -252,7 +253,8 @@ aac_disk_dump(void *arg, void *virtual, if (!first) { first = 1; if (bus_dmamap_create(sc->aac_buffer_dmat, 0, &dump_datamap)) { - printf("bus_dmamap_create failed\n"); + device_printf(sc->aac_dev, + "bus_dmamap_create failed\n"); return (ENOMEM); } } @@ -305,8 +307,9 @@ aac_disk_dump(void *arg, void *virtual, size += fib->Header.Size; if (aac_sync_fib(sc, command, 0, fib, size)) { - printf("Error dumping block 0x%jx\n", - (uintmax_t)physical); + device_printf(sc->aac_dev, + "Error dumping block 0x%jx\n", + (uintmax_t)physical); return (EIO); } From owner-svn-src-head@FreeBSD.ORG Fri Sep 17 00:21:02 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9873B106564A; Fri, 17 Sep 2010 00:21:02 +0000 (UTC) (envelope-from obrien@NUXI.org) Received: from dragon.nuxi.org (trang.nuxi.org [74.95.12.85]) by mx1.freebsd.org (Postfix) with ESMTP id 700328FC08; Fri, 17 Sep 2010 00:21:02 +0000 (UTC) Received: from dragon.nuxi.org (obrien@localhost [127.0.0.1]) by dragon.nuxi.org (8.14.4/8.14.4) with ESMTP id o8H0L1OZ014002; Thu, 16 Sep 2010 17:21:01 -0700 (PDT) (envelope-from obrien@dragon.nuxi.org) Received: (from obrien@localhost) by dragon.nuxi.org (8.14.4/8.14.4/Submit) id o8H0L1M6014001; Thu, 16 Sep 2010 17:21:01 -0700 (PDT) (envelope-from obrien) Date: Thu, 16 Sep 2010 17:21:01 -0700 From: "David O'Brien" To: Jilles Tjoelker Message-ID: <20100917002101.GA13653@dragon.NUXI.org> References: <201009091927.o89JReXm022426@svn.freebsd.org> <20100909195302.GA48144@stack.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100909195302.GA48144@stack.nl> X-Operating-System: FreeBSD 9.0-CURRENT X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? User-Agent: Mutt/1.5.16 (2007-06-09) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r212374 - head/usr.bin/printf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: obrien@freebsd.org List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2010 00:21:02 -0000 On Thu, Sep 09, 2010 at 09:53:02PM +0200, Jilles Tjoelker wrote: > On Thu, Sep 09, 2010 at 07:27:40PM +0000, David E. O'Brien wrote: > > +.Pp > > +Trying to print a dash ("-") as the first character causes > > +.Nm > > +to interpet the dash as a program argument. > > +.Nm -- > > +must be used before > > +.Ar format . > > I do not consider this a bug. [..] > A caveat could be added, OK, if not a bug, then can you suggest other language (and position in the man page) to give a warning or hint against something I think goes against POLA? For something that does not claim to have any command line arguments, I would not have expected getopt() to be used and thus need to escape out of its processing. > POSIX requires printf to recognize -- and > pretty much all current implementations conform to this. Please provide a reference. I am looking at 'The Open Group Base Specifications Issue 6 IEEE Std 1003.1, 2004 Edition' (susv3/utilities/printf.html), and I am not seeing such language. susv3 has the synopsis as: SYNOPSIS printf format [argument...] OPERANDS The following operands shall be supported: format A string describing the format to use to write the remaining operands. See the EXTENDED DESCRIPTION section. argument The strings to be written to standard output, under the control of format. See the EXTENDED DESCRIPTION section. Interestingly, we may not be compliant with susv3 if I am reading this correctly: The printf utility is required to notify the user when conversion errors are detected while producing numeric output; thus, the following results would be expected on an implementation with 32-bit twos-complement integers when %d is specified as the format operand: Argument Standard Output Diagnostic Output 5a 5 printf: "5a" not completely converted 9999999999 2147483647 printf: "9999999999" arithmetic overflow -9999999999 -2147483648 printf: "-9999999999" arithmetic overflow ABC 0 printf: "ABC" expected numeric value $ uname -m i386 $ for A in 5a 9999999999 -9999999999 ABC do /usr/bin/printf "%d\n" $A ; done printf: 5a: not completely converted 5 9999999999 -9999999999 printf: ABC: expected numeric value 0 Though this is in the "informative" section, so maybe this is just one set of compliant output. Though It is my read that printf(1) should behave like printf(3), which the above does not for these long long int values. #include int main(void) { printf("%d\n", 9999999999); printf("%d\n", -9999999999); return 0; } -- -- David (obrien@FreeBSD.org) From owner-svn-src-head@FreeBSD.ORG Fri Sep 17 00:33:29 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 57E651065672; Fri, 17 Sep 2010 00:33:29 +0000 (UTC) (envelope-from obrien@NUXI.org) Received: from dragon.nuxi.org (trang.nuxi.org [74.95.12.85]) by mx1.freebsd.org (Postfix) with ESMTP id D84B28FC08; Fri, 17 Sep 2010 00:33:28 +0000 (UTC) Received: from dragon.nuxi.org (obrien@localhost [127.0.0.1]) by dragon.nuxi.org (8.14.4/8.14.4) with ESMTP id o8H0XSLf014292; Thu, 16 Sep 2010 17:33:28 -0700 (PDT) (envelope-from obrien@dragon.nuxi.org) Received: (from obrien@localhost) by dragon.nuxi.org (8.14.4/8.14.4/Submit) id o8H0XSV1014291; Thu, 16 Sep 2010 17:33:28 -0700 (PDT) (envelope-from obrien) Date: Thu, 16 Sep 2010 17:33:28 -0700 From: "David O'Brien" To: Bruce Evans Message-ID: <20100917003328.GB13653@dragon.NUXI.org> References: <201009091927.o89JReXm022426@svn.freebsd.org> <20100916084442.GB21622@dragon.NUXI.org> <20100916212043.N724@delplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100916212043.N724@delplex.bde.org> X-Operating-System: FreeBSD 9.0-CURRENT X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? User-Agent: Mutt/1.5.16 (2007-06-09) Cc: Juli Mallett , svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r212374 - head/usr.bin/printf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: obrien@FreeBSD.org List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2010 00:33:29 -0000 On Thu, Sep 16, 2010 at 09:36:43PM +1000, Bruce Evans wrote: > On Thu, 16 Sep 2010, David O'Brien wrote: >> Is a sentence or two a burden to the man page vs. saving someone the time >> I spent trying to figure out why printf(1) kept throwing up errors? > > WHat about the lesser burder on a character or two for putting -- in the > synopsis where it is more visible: > > printf [--] format [arguments ...] > > POSIX doesn't do this, and it doesn't seem to say anything about the > problem of a leading - in the format either. Presumably its general > utilities specs require _all_ utilities to support "--". That would be fine for me too, if its prefered that way. Index: printf.1 =================================================================== --- printf.1 (revision 212773) +++ printf.1 (working copy) @@ -43,6 +43,7 @@ .Nd formatted output .Sh SYNOPSIS .Nm +.Op Fl - .Ar format Op Ar arguments ... .Sh DESCRIPTION The @@ -51,6 +52,13 @@ utility formats and prints its arguments of the .Ar format . The +.Fl - +option prevents any interpretation of a leading dash ("-") character in +.Ar format +as a +.Nm +program option. +The .Ar format is a character string which contains three types of objects: plain characters, which are simply copied to standard output, character escape sequences which @@ -355,10 +363,3 @@ Multibyte characters are not recognized a problem if .Ql % can appear inside a multibyte character). -.Pp -Trying to print a dash ("-") as the first character causes -.Nm -to interpet the dash as a program argument. -.Nm -- -must be used before -.Ar format . > I wonder if > there are any utilities that don't use getopt(3) and as a result aren't > POSIX conformant since they don't support "--" and also need to support > a first argument starting with "-" (which won't cause problems because dd(1) is the only thing coming to mind, but it doesn't need to handle argments starting with "-". I believe our find(1) has a problem: $ cd /tmp $ mkdir ./- $ touch ./-/foo $ find -- - -name foo find -- - -name foo usage: find [-H | -L | -P] [-EXdsx] [-f path] path ... [expression] find [-H | -L | -P] [-EXdsx] -f path [path ...] [expression] -- -- David (obrien@FreeBSD.org) From owner-svn-src-head@FreeBSD.ORG Fri Sep 17 01:09:12 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D697C10656C3; Fri, 17 Sep 2010 01:09:12 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ABB8D8FC0C; Fri, 17 Sep 2010 01:09:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8H19CDm013823; Fri, 17 Sep 2010 01:09:12 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8H19CZP013821; Fri, 17 Sep 2010 01:09:12 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201009170109.o8H19CZP013821@svn.freebsd.org> From: Andrew Thompson Date: Fri, 17 Sep 2010 01:09:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212774 - head/sys/mips/atheros X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2010 01:09:12 -0000 Author: thompsa Date: Fri Sep 17 01:09:12 2010 New Revision: 212774 URL: http://svn.freebsd.org/changeset/base/212774 Log: Use getenv to find the mac address since it could be in the bootloader environment or command line and under different names. Modified: head/sys/mips/atheros/ar71xx_machdep.c Modified: head/sys/mips/atheros/ar71xx_machdep.c ============================================================================== --- head/sys/mips/atheros/ar71xx_machdep.c Thu Sep 16 23:33:24 2010 (r212773) +++ head/sys/mips/atheros/ar71xx_machdep.c Fri Sep 17 01:09:12 2010 (r212774) @@ -145,7 +145,7 @@ platform_start(__register_t a0 __unused, { uint64_t platform_counter_freq; int argc, i, count = 0; - char **argv, **envp; + char **argv, **envp, *var; vm_offset_t kernend; /* @@ -167,19 +167,9 @@ platform_start(__register_t a0 __unused, * Protect ourselves from garbage in registers */ if (MIPS_IS_VALID_PTR(envp)) { - for (i = 0; envp[i]; i += 2) - { + for (i = 0; envp[i]; i += 2) { if (strcmp(envp[i], "memsize") == 0) realmem = btoc(strtoul(envp[i+1], NULL, 16)); - else if (strcmp(envp[i], "ethaddr") == 0) { - count = sscanf(envp[i+1], "%x.%x.%x.%x.%x.%x", - &ar711_base_mac[0], &ar711_base_mac[1], - &ar711_base_mac[2], &ar711_base_mac[3], - &ar711_base_mac[4], &ar711_base_mac[5]); - if (count < 6) - memset(ar711_base_mac, 0, - sizeof(ar711_base_mac)); - } } } @@ -245,6 +235,18 @@ platform_start(__register_t a0 __unused, else printf ("envp is invalid\n"); + if ((var = getenv("ethaddr")) != NULL || + (var = getenv("kmac")) != NULL) { + count = sscanf(var, "%x%*c%x%*c%x%*c%x%*c%x%*c%x", + &ar711_base_mac[0], &ar711_base_mac[1], + &ar711_base_mac[2], &ar711_base_mac[3], + &ar711_base_mac[4], &ar711_base_mac[5]); + if (count < 6) + memset(ar711_base_mac, 0, + sizeof(ar711_base_mac)); + freeenv(var); + } + init_param2(physmem); mips_cpu_init(); pmap_bootstrap(); From owner-svn-src-head@FreeBSD.ORG Fri Sep 17 01:13:49 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4B7C31065670; Fri, 17 Sep 2010 01:13:49 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3B2E28FC16; Fri, 17 Sep 2010 01:13:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8H1DnwO013950; Fri, 17 Sep 2010 01:13:49 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8H1Dn92013948; Fri, 17 Sep 2010 01:13:49 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201009170113.o8H1Dn92013948@svn.freebsd.org> From: Andrew Thompson Date: Fri, 17 Sep 2010 01:13:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212775 - head/sys/mips/atheros X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2010 01:13:49 -0000 Author: thompsa Date: Fri Sep 17 01:13:48 2010 New Revision: 212775 URL: http://svn.freebsd.org/changeset/base/212775 Log: Make a note of which platforms the mac strings come from. Suggested by: adrian Modified: head/sys/mips/atheros/ar71xx_machdep.c Modified: head/sys/mips/atheros/ar71xx_machdep.c ============================================================================== --- head/sys/mips/atheros/ar71xx_machdep.c Fri Sep 17 01:09:12 2010 (r212774) +++ head/sys/mips/atheros/ar71xx_machdep.c Fri Sep 17 01:13:48 2010 (r212775) @@ -235,6 +235,10 @@ platform_start(__register_t a0 __unused, else printf ("envp is invalid\n"); + /* + * "ethaddr" is passed via envp on RedBoot platforms + * "kmac" is passed via argv on RouterBOOT platforms + */ if ((var = getenv("ethaddr")) != NULL || (var = getenv("kmac")) != NULL) { count = sscanf(var, "%x%*c%x%*c%x%*c%x%*c%x%*c%x", From owner-svn-src-head@FreeBSD.ORG Fri Sep 17 02:14:22 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 57F3F1065672; Fri, 17 Sep 2010 02:14:22 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2D7CF8FC13; Fri, 17 Sep 2010 02:14:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8H2EMqJ015137; Fri, 17 Sep 2010 02:14:22 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8H2EMNY015135; Fri, 17 Sep 2010 02:14:22 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201009170214.o8H2EMNY015135@svn.freebsd.org> From: Neel Natu Date: Fri, 17 Sep 2010 02:14:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212776 - head/sys/mips/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2010 02:14:22 -0000 Author: neel Date: Fri Sep 17 02:14:21 2010 New Revision: 212776 URL: http://svn.freebsd.org/changeset/base/212776 Log: Get rid of unused macros. Modified: head/sys/mips/include/cpuregs.h Modified: head/sys/mips/include/cpuregs.h ============================================================================== --- head/sys/mips/include/cpuregs.h Fri Sep 17 01:13:48 2010 (r212775) +++ head/sys/mips/include/cpuregs.h Fri Sep 17 02:14:21 2010 (r212776) @@ -58,10 +58,6 @@ #ifndef _MIPS_CPUREGS_H_ #define _MIPS_CPUREGS_H_ -#if defined(_KERNEL_OPT) -#include "opt_cputype.h" -#endif - /* * Address space. * 32-bit mips CPUS partition their 32-bit address space into four segments: @@ -71,8 +67,6 @@ * kseg1 0xa0000000 - 0xbfffffff Physical memory, uncached, unmapped * kseg2 0xc0000000 - 0xffffffff kernel-virtual, mapped * - * mips1 physical memory is limited to 512Mbytes, which is - * doubly mapped in kseg0 (cached) and kseg1 (uncached.) * Caching of mapped addresses is controlled by bits in the TLB entry. */ @@ -343,29 +337,6 @@ #define MIPS_SR_INT_IE 0x00010001 /* XXX */ #endif -/* - * These definitions are for MIPS32 processors. - */ -#define MIPS32_SR_RP 0x08000000 /* reduced power mode */ -#define MIPS32_SR_FR 0x04000000 /* 64-bit capable fpu */ -#define MIPS32_SR_RE 0x02000000 /* reverse user endian */ -#define MIPS32_SR_MX 0x01000000 /* MIPS64 */ -#define MIPS32_SR_PX 0x00800000 /* MIPS64 */ -#define MIPS32_SR_BEV 0x00400000 /* Use boot exception vector */ -#define MIPS32_SR_TS 0x00200000 /* TLB multiple match */ -#define MIPS32_SR_SOFT_RESET 0x00100000 /* soft reset occurred */ -#define MIPS32_SR_NMI 0x00080000 /* NMI occurred */ -#define MIPS32_SR_INT_MASK 0x0000ff00 -#define MIPS32_SR_KX 0x00000080 /* MIPS64 */ -#define MIPS32_SR_SX 0x00000040 /* MIPS64 */ -#define MIPS32_SR_UX 0x00000020 /* MIPS64 */ -#define MIPS32_SR_KSU_MASK 0x00000018 /* privilege mode */ -#define MIPS32_SR_KSU_USER 0x00000010 -#define MIPS32_SR_KSU_SUPER 0x00000008 -#define MIPS32_SR_KSU_KERNEL 0x00000000 -#define MIPS32_SR_ERL 0x00000004 /* error level */ -#define MIPS32_SR_EXL 0x00000002 /* exception level */ - #define MIPS_SR_SOFT_RESET MIPS3_SR_SR #define MIPS_SR_DIAG_CH MIPS3_SR_DIAG_CH #define MIPS_SR_DIAG_CE MIPS3_SR_DIAG_CE From owner-svn-src-head@FreeBSD.ORG Fri Sep 17 02:20:12 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B70A11065670; Fri, 17 Sep 2010 02:20:12 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A6BB28FC08; Fri, 17 Sep 2010 02:20:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8H2KCeA015310; Fri, 17 Sep 2010 02:20:12 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8H2KCC7015307; Fri, 17 Sep 2010 02:20:12 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201009170220.o8H2KCC7015307@svn.freebsd.org> From: Neel Natu Date: Fri, 17 Sep 2010 02:20:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212777 - in head/sys/mips: include mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2010 02:20:12 -0000 Author: neel Date: Fri Sep 17 02:20:12 2010 New Revision: 212777 URL: http://svn.freebsd.org/changeset/base/212777 Log: Get rid of the unnecessary redirection of 'is_cacheable_mem()' to 'is_physical_memory()' through a macro. Implement 'is_cacheable_mem()' directly instead. Modified: head/sys/mips/include/md_var.h head/sys/mips/mips/machdep.c Modified: head/sys/mips/include/md_var.h ============================================================================== --- head/sys/mips/include/md_var.h Fri Sep 17 02:14:21 2010 (r212776) +++ head/sys/mips/include/md_var.h Fri Sep 17 02:20:12 2010 (r212777) @@ -52,11 +52,9 @@ void cpu_swapin(struct proc *); uintptr_t MipsEmulateBranch(struct trapframe *, uintptr_t, int, uintptr_t); void MipsSwitchFPState(struct thread *, struct trapframe *); u_long kvtop(void *addr); -int is_physical_memory(vm_offset_t addr); +int is_cacheable_mem(vm_offset_t addr); void mips_generic_reset(void); -#define is_cacheable_mem(pa) is_physical_memory((pa)) - #define MIPS_DEBUG 0 #if MIPS_DEBUG Modified: head/sys/mips/mips/machdep.c ============================================================================== --- head/sys/mips/mips/machdep.c Fri Sep 17 02:14:21 2010 (r212776) +++ head/sys/mips/mips/machdep.c Fri Sep 17 02:20:12 2010 (r212777) @@ -497,7 +497,7 @@ cpu_idle_wakeup(int cpu) } int -is_physical_memory(vm_offset_t addr) +is_cacheable_mem(vm_offset_t addr) { int i; From owner-svn-src-head@FreeBSD.ORG Fri Sep 17 02:55:07 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C9FD91065670; Fri, 17 Sep 2010 02:55:07 +0000 (UTC) (envelope-from unixmania@gmail.com) Received: from mail-qy0-f175.google.com (mail-qy0-f175.google.com [209.85.216.175]) by mx1.freebsd.org (Postfix) with ESMTP id 3586C8FC08; Fri, 17 Sep 2010 02:55:06 +0000 (UTC) Received: by qyk31 with SMTP id 31so351407qyk.13 for ; Thu, 16 Sep 2010 19:55:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=wB/xaDFrF/u7defmOmYyNymSu9gpBwlzsAkWcg/EFDg=; b=othKVOWQpaTAQyfKTRyeVP3T5Ibtqzbq+YCfjZDwsjeiYomMYaVJ2ji7yYCpGJ5xyg lJLDx6yd605dvDWw1O9cLf2OGj//pDRIoEnXKnwmTnP+ljDavoF0OiBys72tRt95jnKn er7vKfZj3armwe9cA78HNuYMlw5wIDqk8uQ4o= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=t3mHasMx41T+xBHQifmvGW39Ldq+/Dc9j3SFaaaOsGKoZb91LqJ/Iqr/lyDlABmnQi IabwWBLJOVq02DPG6t4+yPc6kahvXb2mOjMob711gWU7XxfQbvf8NdHRPEjrLos2Q0VL 2n+4OTnI5AF0flxMbd2CxgPfq0t+qgE3Eur4k= MIME-Version: 1.0 Received: by 10.224.97.15 with SMTP id j15mr2819239qan.199.1284690578351; Thu, 16 Sep 2010 19:29:38 -0700 (PDT) Received: by 10.229.211.9 with HTTP; Thu, 16 Sep 2010 19:29:38 -0700 (PDT) In-Reply-To: <20100916014404.0409017f@dev.lan.Awfulhak.org> References: <201009141804.o8EI45kp088466@svn.freebsd.org> <20100916014404.0409017f@dev.lan.Awfulhak.org> Date: Thu, 16 Sep 2010 23:29:38 -0300 Message-ID: From: "Carlos A. M. dos Santos" To: Brian Somers Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Kirk McKusick Subject: Re: svn commit: r212617 - head/sys/ufs/ffs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2010 02:55:08 -0000 On Thu, Sep 16, 2010 at 5:44 AM, Brian Somers wrote: > On Tue, 14 Sep 2010 18:04:05 +0000 (UTC) Kirk McKusick wrote: >> Author: mckusick >> Date: Tue Sep 14 18:04:05 2010 >> New Revision: 212617 >> URL: http://svn.freebsd.org/changeset/base/212617 >> >> Log: >> =A0 Update comments in soft updates code to more fully describe >> =A0 the addition of journalling. Only functional change is to >> =A0 tighten a KASSERT. >> >> =A0 Reviewed by: =A0 =A0 =A0 =A0jeff Roberson >> >> Modified: >> =A0 head/sys/ufs/ffs/ffs_softdep.c >> =A0 head/sys/ufs/ffs/fs.h >> =A0 head/sys/ufs/ffs/softdep.h >> >> Modified: head/sys/ufs/ffs/ffs_softdep.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- head/sys/ufs/ffs/ffs_softdep.c =A0 =A0Tue Sep 14 17:22:06 2010 =A0 = =A0 =A0 =A0(r212616) >> +++ head/sys/ufs/ffs/ffs_softdep.c =A0 =A0Tue Sep 14 18:04:05 2010 =A0 = =A0 =A0 =A0(r212617) >> @@ -2378,7 +2378,8 @@ remove_from_journal(wk) >> =A0 =A0 =A0 /* >> =A0 =A0 =A0 =A0* We emulate a TAILQ to save space in most structures whi= ch do not >> =A0 =A0 =A0 =A0* require TAILQ semantics. =A0Here we must update the tai= l position >> - =A0 =A0 =A0* when removing the tail which is not the final entry. >> + =A0 =A0 =A0* when removing the tail which is not the final entry. This= works >> + =A0 =A0 =A0* only if the worklist linkage are at the beginning of the = structure. >> =A0 =A0 =A0 =A0*/ >> =A0 =A0 =A0 if (ump->softdep_journal_tail =3D=3D wk) >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 ump->softdep_journal_tail =3D >> @@ -2605,7 +2606,7 @@ jremref_write(jremref, jseg, data) >> =A0 =A0 =A0 inoref_write(&jremref->jr_ref, jseg, rec); >> =A0} >> >> -static =A0 =A0 =A0 void >> +static void >> =A0jmvref_write(jmvref, jseg, data) >> =A0 =A0 =A0 struct jmvref *jmvref; >> =A0 =A0 =A0 struct jseg *jseg; >> @@ -2906,9 +2907,9 @@ complete_jseg(jseg) >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 waiting =3D wk->wk_state & IOWAITING; >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 wk->wk_state &=3D ~(IOSTARTED | IOWAITING); >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 wk->wk_state |=3D COMPLETE; >> - =A0 =A0 =A0 =A0 =A0 =A0 KASSERT(i < jseg->js_cnt, >> + =A0 =A0 =A0 =A0 =A0 =A0 KASSERT(i++ < jseg->js_cnt, >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ("handle_written_jseg: overflow %d >= =3D %d", > [.....] > > If INVARIANTS is not defined, the above i++ will not happen. Which does not cause any harm, since "i" is a local variable, not used anywhere else in the function. A picky compiler would complain, however, that the variable is never read. From owner-svn-src-head@FreeBSD.ORG Fri Sep 17 03:10:41 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0873D1065670 for ; Fri, 17 Sep 2010 03:10:41 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.freebsd.org (Postfix) with ESMTP id 892938FC0A for ; Fri, 17 Sep 2010 03:10:40 +0000 (UTC) Received: (qmail 23003 invoked by uid 399); 17 Sep 2010 03:10:39 -0000 Received: from localhost (HELO ?192.168.0.142?) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 17 Sep 2010 03:10:39 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4C92DC2E.2020602@FreeBSD.org> Date: Thu, 16 Sep 2010 20:10:38 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.9) Gecko/20100915 Thunderbird/3.1.4 MIME-Version: 1.0 To: "Carlos A. M. dos Santos" References: <201009141804.o8EI45kp088466@svn.freebsd.org> <20100916014404.0409017f@dev.lan.Awfulhak.org> In-Reply-To: X-Enigmail-Version: 1.1.1 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Brian Somers , Kirk McKusick Subject: Re: svn commit: r212617 - head/sys/ufs/ffs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2010 03:10:41 -0000 On 9/16/2010 7:29 PM, Carlos A. M. dos Santos wrote: > On Thu, Sep 16, 2010 at 5:44 AM, Brian Somers wrote: >> If INVARIANTS is not defined, the above i++ will not happen. > > Which does not cause any harm, since "i" is a local variable, not used > anywhere else in the function. A picky compiler would complain, > however, that the variable is never read. If 'i' is only ever used in the INVARIANTS case then it should be appropriately wrapped everywhere it appears. While the _current_ situation may be harmless, in the future lack of an appropriate indication of its use may cause a problem. This isn't just a pedantic concern, we had a case like this that broke the build just recently. Doug -- ... and that's just a little bit of history repeating. -- Propellerheads Improve the effectiveness of your Internet presence with a domain name makeover! http://SupersetSolutions.com/ From owner-svn-src-head@FreeBSD.ORG Fri Sep 17 04:48:51 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1476C106564A; Fri, 17 Sep 2010 04:48:51 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 043E58FC24; Fri, 17 Sep 2010 04:48:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8H4mo0a018438; Fri, 17 Sep 2010 04:48:50 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8H4mo04018436; Fri, 17 Sep 2010 04:48:50 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201009170448.o8H4mo04018436@svn.freebsd.org> From: Alexander Motin Date: Fri, 17 Sep 2010 04:48:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212778 - head/sys/x86/isa X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2010 04:48:51 -0000 Author: mav Date: Fri Sep 17 04:48:50 2010 New Revision: 212778 URL: http://svn.freebsd.org/changeset/base/212778 Log: Add one-shot mode support to attimer (i8254) event timer. Unluckily, using one-shot mode is impossible, when same hardware used for time counting. Introduce new tunable hint.attimer.0.timecounter, setting which to 0 disables i8254 time counter and allows one-shot mode. Note, that on some systems there may be no other reliable enough time counters, so this tunable should be used with understanding. Modified: head/sys/x86/isa/clock.c Modified: head/sys/x86/isa/clock.c ============================================================================== --- head/sys/x86/isa/clock.c Fri Sep 17 02:20:12 2010 (r212777) +++ head/sys/x86/isa/clock.c Fri Sep 17 04:48:50 2010 (r212778) @@ -95,7 +95,7 @@ int clkintr_pending; u_int i8254_freq = TIMER_FREQ; TUNABLE_INT("hw.i8254.freq", &i8254_freq); int i8254_max_count; -static int i8254_real_max_count; +static int i8254_timecounter = 1; struct mtx clock_lock; static struct intsrc *i8254_intsrc; @@ -116,7 +116,11 @@ struct attimer_softc { void *intr_handler; struct timecounter tc; struct eventtimer et; - uint32_t intr_period; + int mode; +#define MODE_STOP 0 +#define MODE_PERIODIC 1 +#define MODE_ONESHOT 2 + uint32_t period; }; static struct attimer_softc *attimer_sc = NULL; @@ -129,14 +133,14 @@ static struct attimer_softc *attimer_sc static u_char timer2_state; static unsigned i8254_get_timecount(struct timecounter *tc); -static void set_i8254_freq(u_int freq, uint32_t intr_period); +static void set_i8254_freq(int mode, uint32_t period); static int clkintr(void *arg) { struct attimer_softc *sc = (struct attimer_softc *)arg; - if (sc->intr_period != 0) { + if (i8254_timecounter && sc->period != 0) { mtx_lock_spin(&clock_lock); if (i8254_ticked) i8254_ticked = 0; @@ -148,7 +152,7 @@ clkintr(void *arg) mtx_unlock_spin(&clock_lock); } - if (sc && sc->et.et_active) + if (sc && sc->et.et_active && sc->mode != MODE_STOP) sc->et.et_event_cb(&sc->et, sc->et.et_arg); #ifdef DEV_MCA @@ -361,27 +365,37 @@ DELAY(int n) } static void -set_i8254_freq(u_int freq, uint32_t intr_period) +set_i8254_freq(int mode, uint32_t period) { - int new_i8254_real_max_count; + int val; mtx_lock_spin(&clock_lock); - i8254_freq = freq; - if (intr_period == 0) - new_i8254_real_max_count = 0x10000; - else { - new_i8254_real_max_count = - min(((uint64_t)i8254_freq * intr_period) >> 32, 0x10000); - } - if (new_i8254_real_max_count != i8254_real_max_count) { - i8254_real_max_count = new_i8254_real_max_count; - if (i8254_real_max_count == 0x10000) - i8254_max_count = 0xffff; - else - i8254_max_count = i8254_real_max_count; + if (period == 0) + val = 0x10000; + else + val = min(((uint64_t)i8254_freq * period) >> 32, 0x10000); + if (val == 0x10000) + i8254_max_count = 0xffff; + else + i8254_max_count = val; + if (mode == MODE_STOP && i8254_timecounter) + mode = MODE_PERIODIC; + switch (mode) { + case MODE_STOP: + outb(TIMER_MODE, TIMER_SEL0 | TIMER_INTTC | TIMER_16BIT); + outb(TIMER_CNTR0, 0xff); + outb(TIMER_CNTR0, 0xff); + break; + case MODE_PERIODIC: outb(TIMER_MODE, TIMER_SEL0 | TIMER_RATEGEN | TIMER_16BIT); - outb(TIMER_CNTR0, i8254_real_max_count & 0xff); - outb(TIMER_CNTR0, i8254_real_max_count >> 8); + outb(TIMER_CNTR0, val & 0xff); + outb(TIMER_CNTR0, val >> 8); + break; + case MODE_ONESHOT: + outb(TIMER_MODE, TIMER_SEL0 | TIMER_INTTC | TIMER_16BIT); + outb(TIMER_CNTR0, val & 0xff); + outb(TIMER_CNTR0, val >> 8); + break; } mtx_unlock_spin(&clock_lock); } @@ -390,11 +404,10 @@ static void i8254_restore(void) { - mtx_lock_spin(&clock_lock); - outb(TIMER_MODE, TIMER_SEL0 | TIMER_RATEGEN | TIMER_16BIT); - outb(TIMER_CNTR0, i8254_real_max_count & 0xff); - outb(TIMER_CNTR0, i8254_real_max_count >> 8); - mtx_unlock_spin(&clock_lock); + if (attimer_sc) + set_i8254_freq(attimer_sc->mode, attimer_sc->period); + else + set_i8254_freq(0, 0); } #ifndef __amd64__ @@ -428,7 +441,7 @@ i8254_init(void) if (pc98_machine_type & M_8M) i8254_freq = 1996800L; /* 1.9968 MHz */ #endif - set_i8254_freq(i8254_freq, 0); + set_i8254_freq(0, 0); } void @@ -459,11 +472,12 @@ sysctl_machdep_i8254_freq(SYSCTL_HANDLER freq = i8254_freq; error = sysctl_handle_int(oidp, &freq, 0, req); if (error == 0 && req->newptr != NULL) { + i8254_freq = freq; if (attimer_sc) { - set_i8254_freq(freq, attimer_sc->intr_period); + set_i8254_freq(attimer_sc->mode, attimer_sc->period); attimer_sc->tc.tc_frequency = freq; } else { - set_i8254_freq(freq, 0); + set_i8254_freq(0, 0); } } return (error); @@ -481,7 +495,7 @@ i8254_get_timecount(struct timecounter * uint16_t count; u_int high, low; - if (sc->intr_period == 0) + if (sc->period == 0) return (i8254_max_count - getit()); #ifdef __amd64__ @@ -517,13 +531,19 @@ attimer_start(struct eventtimer *et, { device_t dev = (device_t)et->et_priv; struct attimer_softc *sc = device_get_softc(dev); - - sc->intr_period = period->frac >> 32; - set_i8254_freq(i8254_freq, sc->intr_period); + + if (period != NULL) { + sc->mode = MODE_PERIODIC; + sc->period = period->frac >> 32; + } else { + sc->mode = MODE_ONESHOT; + sc->period = first->frac >> 32; + } if (!sc->intr_en) { i8254_intsrc->is_pic->pic_enable_source(i8254_intsrc); sc->intr_en = 1; } + set_i8254_freq(sc->mode, sc->period); return (0); } @@ -533,8 +553,9 @@ attimer_stop(struct eventtimer *et) device_t dev = (device_t)et->et_priv; struct attimer_softc *sc = device_get_softc(dev); - sc->intr_period = 0; - set_i8254_freq(i8254_freq, sc->intr_period); + sc->mode = MODE_STOP; + sc->period = 0; + set_i8254_freq(sc->mode, sc->period); return (0); } @@ -630,14 +651,18 @@ attimer_attach(device_t dev) i8254_intsrc = intr_lookup_source(0); if (i8254_intsrc != NULL) i8254_pending = i8254_intsrc->is_pic->pic_source_pending; - set_i8254_freq(i8254_freq, 0); - sc->tc.tc_get_timecount = i8254_get_timecount; - sc->tc.tc_counter_mask = 0xffff; - sc->tc.tc_frequency = i8254_freq; - sc->tc.tc_name = "i8254"; - sc->tc.tc_quality = 0; - sc->tc.tc_priv = dev; - tc_init(&sc->tc); + resource_int_value(device_get_name(dev), device_get_unit(dev), + "timecounter", &i8254_timecounter); + set_i8254_freq(0, 0); + if (i8254_timecounter) { + sc->tc.tc_get_timecount = i8254_get_timecount; + sc->tc.tc_counter_mask = 0xffff; + sc->tc.tc_frequency = i8254_freq; + sc->tc.tc_name = "i8254"; + sc->tc.tc_quality = 0; + sc->tc.tc_priv = dev; + tc_init(&sc->tc); + } if (resource_int_value(device_get_name(dev), device_get_unit(dev), "clock", &i) != 0 || i != 0) { sc->intr_rid = 0; @@ -663,6 +688,8 @@ attimer_attach(device_t dev) i8254_intsrc->is_pic->pic_enable_intr(i8254_intsrc); sc->et.et_name = "i8254"; sc->et.et_flags = ET_FLAGS_PERIODIC; + if (!i8254_timecounter) + sc->et.et_flags |= ET_FLAGS_ONESHOT; sc->et.et_quality = 100; sc->et.et_frequency = i8254_freq; sc->et.et_min_period.sec = 0; From owner-svn-src-head@FreeBSD.ORG Fri Sep 17 04:55:02 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4CBF4106566C; Fri, 17 Sep 2010 04:55:02 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 387928FC08; Fri, 17 Sep 2010 04:55:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8H4t2hF018596; Fri, 17 Sep 2010 04:55:02 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8H4t2M4018591; Fri, 17 Sep 2010 04:55:02 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201009170455.o8H4t2M4018591@svn.freebsd.org> From: Alexander Motin Date: Fri, 17 Sep 2010 04:55:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212779 - in head/share/man: man4 man7 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2010 04:55:02 -0000 Author: mav Date: Fri Sep 17 04:55:01 2010 New Revision: 212779 URL: http://svn.freebsd.org/changeset/base/212779 Log: Add attimer(4) manual page. Added: head/share/man/man4/attimer.4 (contents, props changed) Modified: head/share/man/man4/Makefile head/share/man/man4/hpet.4 head/share/man/man7/eventtimers.7 Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Fri Sep 17 04:48:50 2010 (r212778) +++ head/share/man/man4/Makefile Fri Sep 17 04:55:01 2010 (r212779) @@ -50,6 +50,7 @@ MAN= aac.4 \ atkbd.4 \ atkbdc.4 \ ${_atp.4} \ + ${attimer.4} \ audit.4 \ auditpipe.4 \ aue.4 \ @@ -547,6 +548,7 @@ MLINKS+=hatm.4 if_hatm.4 MLINKS+=hme.4 if_hme.4 MLINKS+=hpet.4 acpi_hpet.4 MLINKS+=${_hptrr.4} ${_rr232x.4} +MLINKS+=${_attimer.4} ${_i8254.4} MLINKS+=idt.4 if_idt.4 MLINKS+=igb.4 if_igb.4 MLINKS+=ip.4 rawip.4 @@ -643,6 +645,7 @@ _acpi_sony.4= acpi_sony.4 _acpi_toshiba.4=acpi_toshiba.4 _acpi_wmi.4= acpi_wmi.4 _aesni.4= aesni.4 +_attimer.4= attimer.4 _aibs.4= aibs.4 _amdsbwd.4= amdsbwd.4 _amdsmb.4= amdsmb.4 @@ -655,6 +658,7 @@ _dpms.4= dpms.4 _hptiop.4= hptiop.4 _hptmv.4= hptmv.4 _hptrr.4= hptrr.4 +_i8254.4= i8254.4 _ichwd.4= ichwd.4 _if_ndis.4= if_ndis.4 _if_nfe.4= if_nfe.4 Added: head/share/man/man4/attimer.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/attimer.4 Fri Sep 17 04:55:01 2010 (r212779) @@ -0,0 +1,69 @@ +.\" Copyright (c) 2010 Alexander Motin +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd September 14, 2010 +.Dt attimer 4 +.Os +.Sh NAME +.Nm attimer +.Nd i8254 Programmable Interval Timer (AT Timer) driver +.Sh SYNOPSIS +This driver is a mandatory part of x86 kernels. +.Pp +The following tunables are settable from the +.Xr loader 8 : +.Bl -ohang +.It Va hint.attimer. Ns Ar X Ns Va .clock +controls event timers functionality support. Setting to 0, disables it. +Default value is 1. +.It Va hint.attimer. Ns Ar X Ns Va .timecounter +controls time counter functionality support. Setting to 0, disables it. +Default value is 1. +.El +.Sh DESCRIPTION +This driver uses i8254 Programmable Interval Timer (AT Timer) hardware +to supply kernel with one time counter and one event timer, and generate +sound tones for system speaker. +This hardware includes three channels. +Each channel includes 16bit counter, counting down with known, +platform-dependent frequency. +Counters can operate in several different modes, including periodic and +one-shot. +Output of each channel has platform-defined wiring: one channel is wired +to the interrupt controller and may be used as event timer, one channel is +wired to speaker and used to generate sound tones, and one timer is reserved +for platform purposes. +.Pp +Driver uses single hardware channel to provide both time counter and event +timer functionality. +To make it possible, respective counter must be running in periodic more. +As result, one-shot event timer mode supported only when time counter +functionality is disabled. +.Pp +Event timer provided by the driver is irrelevant to CPU power states. +.Sh SEE ALSO +.Xr hpet 4 , +.Xr eventtimers 7 Modified: head/share/man/man4/hpet.4 ============================================================================== --- head/share/man/man4/hpet.4 Fri Sep 17 04:48:50 2010 (r212778) +++ head/share/man/man4/hpet.4 Fri Sep 17 04:55:01 2010 (r212779) @@ -94,6 +94,7 @@ group is bound to specific CPU core. Thi of these comparators has own unsharable IRQ. .Sh SEE ALSO .Xr acpi 4 , +.Xr attimer 4 , .Xr eventtimers 7 .Sh HISTORY The Modified: head/share/man/man7/eventtimers.7 ============================================================================== --- head/share/man/man7/eventtimers.7 Fri Sep 17 04:48:50 2010 (r212778) +++ head/share/man/man7/eventtimers.7 Fri Sep 17 04:55:01 2010 (r212779) @@ -128,4 +128,5 @@ and runs in periodic mode, this option h always generating. .El .Sh SEE ALSO +.Xr attimer 4 , .Xr hpet 4 From owner-svn-src-head@FreeBSD.ORG Fri Sep 17 06:28:51 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 154D61065693; Fri, 17 Sep 2010 06:28:51 +0000 (UTC) (envelope-from swell.k@gmail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id E83A38FC1C; Fri, 17 Sep 2010 06:28:49 +0000 (UTC) Received: by bwz15 with SMTP id 15so2986695bwz.13 for ; Thu, 16 Sep 2010 23:28:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:references :date:in-reply-to:message-id:user-agent:mime-version:content-type; bh=Ohb8aQYcqDzRVg5ZwX5/VqhaDeKsE5opbEP9erzwu8E=; b=JolJAS+qErto9Znb8EKvvey9OkTqWgOBZZNyc5BTbu/JpRHPfBioOLfSmdgS4lr5di qVOCnw17HsOwao9FpekEOXgT3niQVtVMnG696oSbGgq1YQQCX5m7bysFx1qfV5062hrv IplXwnp72Hjif994l5rZHmk2+fewwV96xtx6A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; b=SiXkpbhLEZ61zN4KShIhuuX3Yu/JyuY1HJ7XbH/oi91ut+45jPi9HJrY4l/nmEFKNB nXh8jh7RnpT+7nafHh7KFNo4DJK9TRt5vv7xNudsHtQD92zaXN9CC4bFRF6fjwIn+Q4T WIFsc/xZubc8VpgMrlT/xxPwuGKrL78kzR2w0= Received: by 10.204.179.194 with SMTP id br2mr3276586bkb.196.1284704928821; Thu, 16 Sep 2010 23:28:48 -0700 (PDT) Received: from localhost (tor-exit-proxy2-readme.formlessnetworking.net [208.53.142.38]) by mx.google.com with ESMTPS id y19sm3272280bkw.18.2010.09.16.23.28.45 (version=SSLv3 cipher=RC4-MD5); Thu, 16 Sep 2010 23:28:46 -0700 (PDT) From: Anonymous To: Alexander Motin References: <201009170455.o8H4t2M4018591@svn.freebsd.org> Date: Fri, 17 Sep 2010 10:27:19 +0400 In-Reply-To: <201009170455.o8H4t2M4018591@svn.freebsd.org> (Alexander Motin's message of "Fri, 17 Sep 2010 04:55:02 +0000 (UTC)") Message-ID: <86bp7wc2bc.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r212779 - in head/share/man: man4 man7 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2010 06:28:51 -0000 Alexander Motin writes: > Author: mav > Date: Fri Sep 17 04:55:01 2010 > New Revision: 212779 > URL: http://svn.freebsd.org/changeset/base/212779 > > Log: > Add attimer(4) manual page. > [...] > --- head/share/man/man4/Makefile Fri Sep 17 04:48:50 2010 (r212778) > +++ head/share/man/man4/Makefile Fri Sep 17 04:55:01 2010 (r212779) > @@ -50,6 +50,7 @@ MAN= aac.4 \ > atkbd.4 \ > atkbdc.4 \ > ${_atp.4} \ > + ${attimer.4} \ Typo: ${attimer.4} vs. ${_attimer.4} From owner-svn-src-head@FreeBSD.ORG Fri Sep 17 07:14:07 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7FB891065672; Fri, 17 Sep 2010 07:14:07 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6F8D98FC16; Fri, 17 Sep 2010 07:14:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8H7E7Mi021548; Fri, 17 Sep 2010 07:14:07 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8H7E7qL021546; Fri, 17 Sep 2010 07:14:07 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201009170714.o8H7E7qL021546@svn.freebsd.org> From: Andriy Gapon Date: Fri, 17 Sep 2010 07:14:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212780 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2010 07:14:07 -0000 Author: avg Date: Fri Sep 17 07:14:07 2010 New Revision: 212780 URL: http://svn.freebsd.org/changeset/base/212780 Log: zfs arc_reclaim_needed: more reasonable threshold for available pages vm_paging_target() is not a trigger of any kind for pageademon, but rather a "soft" target for it when it's already triggered. Thus, trying to keep 2048 pages above that level at the expense of ARC was simply driving ARC size into the ground even with normal memory loads. Instead, use a threshold at which a pagedaemon scan is triggered, so that ARC reclaiming helps with pagedaemon's task, but the latter still recycles active and inactive pages. PR: kern/146410, kern/138790 MFC after: 3 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Fri Sep 17 04:55:01 2010 (r212779) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Fri Sep 17 07:14:07 2010 (r212780) @@ -2161,10 +2161,10 @@ arc_reclaim_needed(void) return (0); /* - * If pages are needed or we're within 2048 pages - * of needing to page need to reclaim + * Cooperate with pagedaemon when it's time for it to scan + * and reclaim some pages. */ - if (vm_pages_needed || (vm_paging_target() > -2048)) + if (vm_paging_need()) return (1); #if 0 From owner-svn-src-head@FreeBSD.ORG Fri Sep 17 07:17:38 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D95AD1065670; Fri, 17 Sep 2010 07:17:38 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C989B8FC14; Fri, 17 Sep 2010 07:17:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8H7Hcb7021673; Fri, 17 Sep 2010 07:17:38 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8H7HcKJ021671; Fri, 17 Sep 2010 07:17:38 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201009170717.o8H7HcKJ021671@svn.freebsd.org> From: Andriy Gapon Date: Fri, 17 Sep 2010 07:17:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212781 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2010 07:17:38 -0000 Author: avg Date: Fri Sep 17 07:17:38 2010 New Revision: 212781 URL: http://svn.freebsd.org/changeset/base/212781 Log: zfs arc_reclaim_needed: remove redundant checks for arc_c_max and arc_c_max Those checks are not present in upstream code and they are enforced in actual calculations of delta by which ARC size can be grown or should be reduced. MFC after: 3 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Fri Sep 17 07:14:07 2010 (r212780) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Fri Sep 17 07:17:38 2010 (r212781) @@ -2155,10 +2155,6 @@ arc_reclaim_needed(void) #ifdef _KERNEL if (needfree) return (1); - if (arc_size > arc_c_max) - return (1); - if (arc_size <= arc_c_min) - return (0); /* * Cooperate with pagedaemon when it's time for it to scan From owner-svn-src-head@FreeBSD.ORG Fri Sep 17 07:20:20 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 75E31106566C; Fri, 17 Sep 2010 07:20:20 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 660368FC16; Fri, 17 Sep 2010 07:20:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8H7KK0P021763; Fri, 17 Sep 2010 07:20:20 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8H7KKfm021761; Fri, 17 Sep 2010 07:20:20 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201009170720.o8H7KKfm021761@svn.freebsd.org> From: Andriy Gapon Date: Fri, 17 Sep 2010 07:20:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212782 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2010 07:20:20 -0000 Author: avg Date: Fri Sep 17 07:20:20 2010 New Revision: 212782 URL: http://svn.freebsd.org/changeset/base/212782 Log: zfs+sendfile: advance uio_offset upon reading as well Picked from analogous code in tmpfs. MFC after: 1 week Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Fri Sep 17 07:17:38 2010 (r212781) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Fri Sep 17 07:20:20 2010 (r212782) @@ -523,8 +523,10 @@ again: if (error == 0) vm_page_set_valid(m, off, bytes); vm_page_wakeup(m); - if (error == 0) + if (error == 0) { uio->uio_resid -= bytes; + uio->uio_offset += bytes; + } } else { dirbytes += bytes; } From owner-svn-src-head@FreeBSD.ORG Fri Sep 17 07:34:50 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DF8591065672; Fri, 17 Sep 2010 07:34:50 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CF35B8FC12; Fri, 17 Sep 2010 07:34:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8H7Yoca022187; Fri, 17 Sep 2010 07:34:50 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8H7Yogp022185; Fri, 17 Sep 2010 07:34:50 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201009170734.o8H7Yogp022185@svn.freebsd.org> From: Andriy Gapon Date: Fri, 17 Sep 2010 07:34:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212783 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2010 07:34:51 -0000 Author: avg Date: Fri Sep 17 07:34:50 2010 New Revision: 212783 URL: http://svn.freebsd.org/changeset/base/212783 Log: zfs arc_reclaim_needed: fix typo in mismerge in r212780 PR: kern/146410, kern/138790 MFC after: 3 weeks X-MFC with: r212780 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Fri Sep 17 07:20:20 2010 (r212782) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Fri Sep 17 07:34:50 2010 (r212783) @@ -2160,7 +2160,7 @@ arc_reclaim_needed(void) * Cooperate with pagedaemon when it's time for it to scan * and reclaim some pages. */ - if (vm_paging_need()) + if (vm_paging_needed()) return (1); #if 0 From owner-svn-src-head@FreeBSD.ORG Fri Sep 17 07:36:32 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7E8171065672; Fri, 17 Sep 2010 07:36:32 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6EE508FC19; Fri, 17 Sep 2010 07:36:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8H7aWdA022262; Fri, 17 Sep 2010 07:36:32 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8H7aWno022260; Fri, 17 Sep 2010 07:36:32 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201009170736.o8H7aWno022260@svn.freebsd.org> From: Andriy Gapon Date: Fri, 17 Sep 2010 07:36:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212784 - head/sys/amd64/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2010 07:36:32 -0000 Author: avg Date: Fri Sep 17 07:36:32 2010 New Revision: 212784 URL: http://svn.freebsd.org/changeset/base/212784 Log: amd64: reduce VM_KMEM_SIZE_SCALE to 1 allowing kernel to use more memory KVA space is abundant on amd64, so there is no reason to limit kernel map size to a fraction of available physical memory. In fact, it could be larger than physical memory. This should help with memory auto-tuning for ZFS and shouldn't affect other workloads. This should reduce number of circumstances for "kmem_map too small" panics, but probably won't eliminate them entirely due to potential kmem fragmentation. In fact, you might want/need to limit maximum ARC size after this commit if you need to resrve more memory for applications. This change was discussed on arch@ and nobody said "don't do it". MFC after: 6 weeks Modified: head/sys/amd64/include/vmparam.h Modified: head/sys/amd64/include/vmparam.h ============================================================================== --- head/sys/amd64/include/vmparam.h Fri Sep 17 07:34:50 2010 (r212783) +++ head/sys/amd64/include/vmparam.h Fri Sep 17 07:36:32 2010 (r212784) @@ -205,7 +205,7 @@ * is the total KVA space allocated for kmem_map. */ #ifndef VM_KMEM_SIZE_SCALE -#define VM_KMEM_SIZE_SCALE (3) +#define VM_KMEM_SIZE_SCALE (1) #endif /* From owner-svn-src-head@FreeBSD.ORG Fri Sep 17 07:40:02 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 816141065670; Fri, 17 Sep 2010 07:40:02 +0000 (UTC) (envelope-from jhay@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 71E7E8FC1B; Fri, 17 Sep 2010 07:40:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8H7e22M022402; Fri, 17 Sep 2010 07:40:02 GMT (envelope-from jhay@svn.freebsd.org) Received: (from jhay@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8H7e2Z7022400; Fri, 17 Sep 2010 07:40:02 GMT (envelope-from jhay@svn.freebsd.org) Message-Id: <201009170740.o8H7e2Z7022400@svn.freebsd.org> From: John Hay Date: Fri, 17 Sep 2010 07:40:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212785 - head/release X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2010 07:40:02 -0000 Author: jhay Date: Fri Sep 17 07:40:02 2010 New Revision: 212785 URL: http://svn.freebsd.org/changeset/base/212785 Log: Chase the ports list to make snapshots work again with NOPORTS set. Modified: head/release/Makefile.inc.docports Modified: head/release/Makefile.inc.docports ============================================================================== --- head/release/Makefile.inc.docports Fri Sep 17 07:36:32 2010 (r212784) +++ head/release/Makefile.inc.docports Fri Sep 17 07:40:02 2010 (r212785) @@ -26,9 +26,12 @@ MINIMALDOCPORTS= \ MINIMALDOCPORTS+= \ ports/archivers/unzip \ ports/converters/libiconv \ + ports/devel/autoconf267 \ + ports/devel/autoconf-wrapper \ ports/devel/gettext \ ports/devel/gmake \ - ports/devel/libtool15 \ + ports/devel/libtool22 \ + ports/devel/m4 \ ports/devel/pkg-config \ ports/graphics/gd \ ports/graphics/jbigkit \ @@ -37,6 +40,7 @@ MINIMALDOCPORTS+= \ ports/graphics/png \ ports/graphics/scr2png \ ports/graphics/tiff \ + ports/misc/help2man \ ports/print/freetype2 \ ports/print/ghostscript8 \ ports/print/ghostscript8-nox11 \ From owner-svn-src-head@FreeBSD.ORG Fri Sep 17 07:44:01 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8479210656A4; Fri, 17 Sep 2010 07:44:01 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5A4EA8FC14; Fri, 17 Sep 2010 07:44:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8H7i1Xi022533; Fri, 17 Sep 2010 07:44:01 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8H7i1vd022524; Fri, 17 Sep 2010 07:44:01 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201009170744.o8H7i1vd022524@svn.freebsd.org> From: Alexander Motin Date: Fri, 17 Sep 2010 07:44:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212786 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2010 07:44:01 -0000 Author: mav Date: Fri Sep 17 07:44:01 2010 New Revision: 212786 URL: http://svn.freebsd.org/changeset/base/212786 Log: Fix typo ${attimer.4} -> ${_attimer.4}. Modified: head/share/man/man4/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Fri Sep 17 07:40:02 2010 (r212785) +++ head/share/man/man4/Makefile Fri Sep 17 07:44:01 2010 (r212786) @@ -50,7 +50,7 @@ MAN= aac.4 \ atkbd.4 \ atkbdc.4 \ ${_atp.4} \ - ${attimer.4} \ + ${_attimer.4} \ audit.4 \ auditpipe.4 \ aue.4 \ From owner-svn-src-head@FreeBSD.ORG Fri Sep 17 08:44:55 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E18B61065672; Fri, 17 Sep 2010 08:44:54 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CFBFF8FC17; Fri, 17 Sep 2010 08:44:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8H8isjv023956; Fri, 17 Sep 2010 08:44:54 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8H8isW5023950; Fri, 17 Sep 2010 08:44:54 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201009170844.o8H8isW5023950@svn.freebsd.org> From: Alexander Motin Date: Fri, 17 Sep 2010 08:44:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212787 - in head/share/man: man4 man7 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2010 08:44:55 -0000 Author: mav Date: Fri Sep 17 08:44:54 2010 New Revision: 212787 URL: http://svn.freebsd.org/changeset/base/212787 Log: Add atrtc(4) manual page. Added: head/share/man/man4/atrtc.4 (contents, props changed) Modified: head/share/man/man4/Makefile head/share/man/man4/attimer.4 head/share/man/man4/hpet.4 head/share/man/man7/eventtimers.7 Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Fri Sep 17 07:44:01 2010 (r212786) +++ head/share/man/man4/Makefile Fri Sep 17 08:44:54 2010 (r212787) @@ -50,6 +50,7 @@ MAN= aac.4 \ atkbd.4 \ atkbdc.4 \ ${_atp.4} \ + ${_atrtc.4} \ ${_attimer.4} \ audit.4 \ auditpipe.4 \ @@ -645,6 +646,7 @@ _acpi_sony.4= acpi_sony.4 _acpi_toshiba.4=acpi_toshiba.4 _acpi_wmi.4= acpi_wmi.4 _aesni.4= aesni.4 +_atrtc.4= atrtc.4 _attimer.4= attimer.4 _aibs.4= aibs.4 _amdsbwd.4= amdsbwd.4 Added: head/share/man/man4/atrtc.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/atrtc.4 Fri Sep 17 08:44:54 2010 (r212787) @@ -0,0 +1,56 @@ +.\" Copyright (c) 2010 Alexander Motin +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd September 17, 2010 +.Dt atrtc 4 +.Os +.Sh NAME +.Nm atrtc +.Nd AT Real-Time Clock (RTC) driver +.Sh SYNOPSIS +This driver is a mandatory part of i386/amd64 kernels. +.Pp +The following tunable is settable from the +.Xr loader 8 : +.Bl -ohang +.It Va hint.atrtc. Ns Ar X Ns Va .clock +controls event timers functionality support. Setting to 0, disables it. +Default value is 1. +.El +.Sh DESCRIPTION +This driver uses RTC hardware to supply kernel with time-of-day clock +with 1 second resolution and one event timer. +This hardware uses base frequency of 32768Hz for advancing time-of-day clock +and generating periodic interrupts. +Interrupts could be generated with fixed number of frequencies, from 2Hz to +8192Hz, obtained by dividing base frequency by one of supported power-of-2 +divisors. +.Pp +Event timer provided by the driver is irrelevant to CPU power states. +.Sh SEE ALSO +.Xr attimer 4 , +.Xr hpet 4 , +.Xr eventtimers 7 Modified: head/share/man/man4/attimer.4 ============================================================================== --- head/share/man/man4/attimer.4 Fri Sep 17 07:44:01 2010 (r212786) +++ head/share/man/man4/attimer.4 Fri Sep 17 08:44:54 2010 (r212787) @@ -65,5 +65,6 @@ functionality is disabled. .Pp Event timer provided by the driver is irrelevant to CPU power states. .Sh SEE ALSO +.Xr atrtc 4 , .Xr hpet 4 , .Xr eventtimers 7 Modified: head/share/man/man4/hpet.4 ============================================================================== --- head/share/man/man4/hpet.4 Fri Sep 17 07:44:01 2010 (r212786) +++ head/share/man/man4/hpet.4 Fri Sep 17 08:44:54 2010 (r212787) @@ -94,6 +94,7 @@ group is bound to specific CPU core. Thi of these comparators has own unsharable IRQ. .Sh SEE ALSO .Xr acpi 4 , +.Xr atrtc 4 , .Xr attimer 4 , .Xr eventtimers 7 .Sh HISTORY Modified: head/share/man/man7/eventtimers.7 ============================================================================== --- head/share/man/man7/eventtimers.7 Fri Sep 17 07:44:01 2010 (r212786) +++ head/share/man/man7/eventtimers.7 Fri Sep 17 08:44:54 2010 (r212787) @@ -129,4 +129,5 @@ always generating. .El .Sh SEE ALSO .Xr attimer 4 , +.Xr atrtc 4 , .Xr hpet 4 From owner-svn-src-head@FreeBSD.ORG Fri Sep 17 09:14:40 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 81BF410656C2; Fri, 17 Sep 2010 09:14:40 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6FEA38FC12; Fri, 17 Sep 2010 09:14:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8H9EeoN024636; Fri, 17 Sep 2010 09:14:40 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8H9EeXr024634; Fri, 17 Sep 2010 09:14:40 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201009170914.o8H9EeXr024634@svn.freebsd.org> From: "David E. O'Brien" Date: Fri, 17 Sep 2010 09:14:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212788 - head/sys/ufs/ffs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2010 09:14:40 -0000 Author: obrien Date: Fri Sep 17 09:14:40 2010 New Revision: 212788 URL: http://svn.freebsd.org/changeset/base/212788 Log: Correct some non-code typos. Modified: head/sys/ufs/ffs/ffs_vfsops.c Modified: head/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vfsops.c Fri Sep 17 08:44:54 2010 (r212787) +++ head/sys/ufs/ffs/ffs_vfsops.c Fri Sep 17 09:14:40 2010 (r212788) @@ -318,7 +318,7 @@ ffs_mount(struct mount *mp) fs->fs_fsmnt); if (fs->fs_flags & FS_SUJ) printf( -"WARNING: Forced mount will invalidated journal contents\n"); +"WARNING: Forced mount will invalidate journal contents\n"); return (EPERM); } } @@ -362,7 +362,7 @@ ffs_mount(struct mount *mp) * Soft updates is incompatible with "async", * so if we are doing softupdates stop the user * from setting the async flag in an update. - * Softdep_mount() clears it in an initial mount + * Softdep_mount() clears it in an initial mount * or ro->rw remount. */ if (mp->mnt_flag & MNT_SOFTDEP) { @@ -387,7 +387,7 @@ ffs_mount(struct mount *mp) mp->mnt_flag |= MNT_NFS4ACLS; MNT_IUNLOCK(mp); } - + /* * If this is a snapshot request, take the snapshot. */ @@ -720,8 +720,7 @@ ffs_mountfs(devvp, mp, td) if (ronly || (mp->mnt_flag & MNT_FORCE) || ((fs->fs_flags & (FS_SUJ | FS_NEEDSFSCK)) == 0 && (fs->fs_flags & FS_DOSOFTDEP))) { - printf( -"WARNING: %s was not properly dismounted\n", + printf("WARNING: %s was not properly dismounted\n", fs->fs_fsmnt); } else { printf( @@ -729,7 +728,7 @@ ffs_mountfs(devvp, mp, td) fs->fs_fsmnt); if (fs->fs_flags & FS_SUJ) printf( -"WARNING: Forced mount will invalidated journal contents\n"); +"WARNING: Forced mount will invalidate journal contents\n"); error = EPERM; goto out; } @@ -840,7 +839,7 @@ ffs_mountfs(devvp, mp, td) mp->mnt_stat.f_fsid.val[0] = fs->fs_id[0]; mp->mnt_stat.f_fsid.val[1] = fs->fs_id[1]; nmp = NULL; - if (fs->fs_id[0] == 0 || fs->fs_id[1] == 0 || + if (fs->fs_id[0] == 0 || fs->fs_id[1] == 0 || (nmp = vfs_getvfs(&mp->mnt_stat.f_fsid))) { if (nmp) vfs_rel(nmp); @@ -873,8 +872,7 @@ ffs_mountfs(devvp, mp, td) MNT_IUNLOCK(mp); #else - printf( -"WARNING: %s: ACLs flag on fs but no ACLs support\n", + printf("WARNING: %s: ACLs flag on fs but no ACLs support\n", mp->mnt_stat.f_mntonname); #endif } @@ -1682,7 +1680,7 @@ ffs_sbupdate(mp, waitfor, suspended) int i, size, error, allerror = 0; if (fs->fs_ronly == 1 && - (mp->um_mountp->mnt_flag & (MNT_RDONLY | MNT_UPDATE)) != + (mp->um_mountp->mnt_flag & (MNT_RDONLY | MNT_UPDATE)) != (MNT_RDONLY | MNT_UPDATE)) panic("ffs_sbupdate: write read-only filesystem"); /* @@ -1836,7 +1834,7 @@ ffs_backgroundwritedone(struct buf *bp) * * Note that we set B_CACHE here, indicating that buffer is * fully valid and thus cacheable. This is true even of NFS - * now so we set it generally. This could be set either here + * now so we set it generally. This could be set either here * or in biodone() since the I/O is synchronous. We put it * here. */ @@ -1885,7 +1883,7 @@ ffs_bufwrite(struct buf *bp) * This optimization eats a lot of memory. If we have a page * or buffer shortfall we can't do it. */ - if (dobkgrdwrite && (bp->b_xflags & BX_BKGRDWRITE) && + if (dobkgrdwrite && (bp->b_xflags & BX_BKGRDWRITE) && (bp->b_flags & B_ASYNC) && !vm_page_count_severe() && !buf_dirty_count_severe()) { @@ -1927,7 +1925,7 @@ ffs_bufwrite(struct buf *bp) bundirty(bp); #else bundirty(bp); -#endif +#endif /* * Initiate write on the copy, release the original to From owner-svn-src-head@FreeBSD.ORG Fri Sep 17 09:50:36 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9EFC8106564A; Fri, 17 Sep 2010 09:50:36 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8D8E68FC08; Fri, 17 Sep 2010 09:50:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8H9oa6h025412; Fri, 17 Sep 2010 09:50:36 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8H9oaoB025410; Fri, 17 Sep 2010 09:50:36 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201009170950.o8H9oaoB025410@svn.freebsd.org> From: Andriy Gapon Date: Fri, 17 Sep 2010 09:50:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212789 - head/sbin/reboot X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2010 09:50:36 -0000 Author: avg Date: Fri Sep 17 09:50:36 2010 New Revision: 212789 URL: http://svn.freebsd.org/changeset/base/212789 Log: nextboot: warn about limitations of /boot/nextboot.conf on ZFS MFC after: 1 week Modified: head/sbin/reboot/nextboot.sh Modified: head/sbin/reboot/nextboot.sh ============================================================================== --- head/sbin/reboot/nextboot.sh Fri Sep 17 09:14:40 2010 (r212788) +++ head/sbin/reboot/nextboot.sh Fri Sep 17 09:50:36 2010 (r212789) @@ -50,6 +50,14 @@ if [ ${force} = "NO" -a ! -d /boot/${ker exit 1 fi +df -Tn "/boot/" 2>/dev/null | while read _fs _type _other ; do + [ "zfs" = "${_type}" ] || continue + cat 1>&2 <<-EOF + WARNING: loader(8) has only R/O support for ZFS + nextboot.conf will NOT be reset in case of kernel boot failure + EOF +done + cat > ${nextboot_file} << EOF nextboot_enable="YES" kernel="${kernel}" From owner-svn-src-head@FreeBSD.ORG Fri Sep 17 10:28:10 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7FDC01065670; Fri, 17 Sep 2010 10:28:10 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6C4F78FC0A; Fri, 17 Sep 2010 10:28:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8HASAt2028052; Fri, 17 Sep 2010 10:28:10 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8HASANI028047; Fri, 17 Sep 2010 10:28:10 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201009171028.o8HASANI028047@svn.freebsd.org> From: "Jayachandran C." Date: Fri, 17 Sep 2010 10:28:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212790 - in head/sys/mips/rmi: . dev/nlge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2010 10:28:10 -0000 Author: jchandra Date: Fri Sep 17 10:28:10 2010 New Revision: 212790 URL: http://svn.freebsd.org/changeset/base/212790 Log: Fixes for XLR network accelerator driver (nlge). - Process some tx done messages in the transmit path, to ensure that the XLR NA tx done FIFO does not overflow. - Add a message ring handler API to process atmost a given number of messages from a specified bucket mask. This will be used to process the tx done messages - Add a callout to restart transmit in the case transmit gets blocked. - Update enable_msgring_int() and disable_msgring_int(), remove unused args and make static. Obtained from: Sriram Gorti (srgorti at netlogicmicro dot com) Modified: head/sys/mips/rmi/dev/nlge/if_nlge.c head/sys/mips/rmi/dev/nlge/if_nlge.h head/sys/mips/rmi/fmn.c head/sys/mips/rmi/msgring.h Modified: head/sys/mips/rmi/dev/nlge/if_nlge.c ============================================================================== --- head/sys/mips/rmi/dev/nlge/if_nlge.c Fri Sep 17 09:50:36 2010 (r212789) +++ head/sys/mips/rmi/dev/nlge/if_nlge.c Fri Sep 17 10:28:10 2010 (r212790) @@ -207,6 +207,9 @@ static void release_tx_desc(vm_paddr_t static int send_fmn_msg_tx(struct nlge_softc *, struct msgrng_msg *, uint32_t n_entries); +static void +nl_tx_q_wakeup(void *addr); + //#define DEBUG #ifdef DEBUG static int mac_debug = 1; @@ -424,6 +427,10 @@ nlna_attach(device_t dev) XLR_CACHELINE_SIZE, 0); } + /* Other per NA s/w initialization */ + callout_init(&sc->tx_thr, CALLOUT_MPSAFE); + callout_reset(&sc->tx_thr, hz, nl_tx_q_wakeup, sc); + /* Enable NA interrupts */ nlna_setup_intr(sc); @@ -655,15 +662,23 @@ nlge_msgring_handler(int bucket, int siz } if (ctrl == CTRL_REG_FREE || ctrl == CTRL_JUMBO_FREE) { - if (is_p2p) { - release_tx_desc(phys_addr); - } else { - m_freem((struct mbuf *)(uintptr_t)phys_addr); - } - ifp = sc->nlge_if; - if (ifp->if_drv_flags & IFF_DRV_OACTIVE){ - ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + if (!tx_error) { + if (is_p2p) { + release_tx_desc(phys_addr); + } else { + m_freem((struct mbuf *)(uintptr_t)phys_addr); + } + NLGE_LOCK(sc); + if (ifp->if_drv_flags & IFF_DRV_OACTIVE){ + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + callout_reset(&na_sc->tx_thr, hz, + nl_tx_q_wakeup, na_sc); + } + NLGE_UNLOCK(sc); + } else { + printf("ERROR: Tx fb error (%d) on port %d\n", tx_error, + port); } atomic_incr_long((tx_error) ? &ifp->if_oerrors: &ifp->if_opackets); } else if (ctrl == CTRL_SNGL || ctrl == CTRL_START) { @@ -687,7 +702,24 @@ nlge_start(struct ifnet *ifp) nlge_start_locked(ifp, sc); //NLGE_UNLOCK(sc); } - + +static void +nl_tx_q_wakeup(void *addr) +{ + struct nlna_softc *na_sc; + struct nlge_softc *sc; + int i; + + na_sc = (struct nlna_softc *) addr; + for (i = 0; i < XLR_MAX_MACS; i++) { + sc = na_sc->child_sc[i]; + if (sc == NULL) + continue; + nlge_start_locked(sc->nlge_if, sc); + } + callout_reset(&na_sc->tx_thr, 5 * hz, nl_tx_q_wakeup, na_sc); +} + static void nlge_start_locked(struct ifnet *ifp, struct nlge_softc *sc) { @@ -696,20 +728,30 @@ nlge_start_locked(struct ifnet *ifp, str struct nlge_tx_desc *tx_desc; uint64_t fr_stid; uint32_t cpu; - uint32_t n_entries; + uint32_t n_entries; uint32_t tid; int ret; - int sent; cpu = xlr_core_id(); tid = xlr_thr_id(); - fr_stid = cpu * 8 + tid + 4; + /* H/w threads [0, 2] --> bucket 6 and [1, 3] --> bucket 7 */ + fr_stid = cpu * 8 + 6 + (tid % 2); if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) { return; } do { + /* + * First, remove some freeback messages before transmitting + * any new packets. However, cap the number of messages + * drained to permit this thread to continue with its + * transmission. + * + * Mask for buckets {6, 7} is 0xc0 + */ + xlr_msgring_handler(0xc0, 4); + /* Grab a packet off the queue. */ IF_DEQUEUE(&ifp->if_snd, m); if (m == NULL) { @@ -721,8 +763,8 @@ nlge_start_locked(struct ifnet *ifp, str if (ret) { goto fail; } - sent = send_fmn_msg_tx(sc, &msg, n_entries); - if (sent != 0) { + ret = send_fmn_msg_tx(sc, &msg, n_entries); + if (ret != 0) { goto fail; } } while(1); @@ -734,20 +776,10 @@ fail: uma_zfree(nl_tx_desc_zone, tx_desc); } if (m != NULL) { - /* - * TBD: It is observed that only when both of the statements - * below are not enabled, traffic continues till the end. - * Otherwise, the port locks up in the middle and never - * recovers from it. The current theory for this behavior - * is that the queue is full and the upper layer is neither - * able to add to it not invoke nlge_start to drian the - * queue. The driver may have to do something in addition - * to reset'ing the OACTIVE bit when a trasnmit free-back - * is received. - */ - //ifp->if_drv_flags |= IFF_DRV_OACTIVE; - //IF_PREPEND(&ifp->if_snd, m); - m_freem(m); + NLGE_LOCK(sc); + ifp->if_drv_flags |= IFF_DRV_OACTIVE; + NLGE_UNLOCK(sc); + IF_PREPEND(&ifp->if_snd, m); atomic_incr_long(&ifp->if_iqdrops); } return; @@ -1020,7 +1052,7 @@ nlna_submit_rx_free_desc(struct nlna_sof msgrng_flags = msgrng_access_enable(); ret = message_send(1, code, stid, &msg); msgrng_restore(msgrng_flags); - KASSERT(n++ < 100000, ("Too many credit fails\n")); + KASSERT(n++ < 100000, ("Too many credit fails in rx path\n")); } while (ret != 0); } } @@ -1942,9 +1974,14 @@ send_fmn_msg_tx(struct nlge_softc *sc, s ret = message_send(n_entries, MSGRNG_CODE_MAC, sc->tx_bucket_id, msg); msgrng_restore(msgrng_flags); - KASSERT(i++ < 100000, ("Too many credit fails\n")); - } while (ret != 0); - return (0); + if (ret == 0) + return (0); + i++; + } while (i < 100000); + + KASSERT(i < 100000, ("Too many credit fails in tx path\n")); + + return (1); } static void Modified: head/sys/mips/rmi/dev/nlge/if_nlge.h ============================================================================== --- head/sys/mips/rmi/dev/nlge/if_nlge.h Fri Sep 17 09:50:36 2010 (r212789) +++ head/sys/mips/rmi/dev/nlge/if_nlge.h Fri Sep 17 10:28:10 2010 (r212790) @@ -1110,6 +1110,7 @@ struct nlna_softc { int mac_type; xlr_reg_t *base; + struct callout tx_thr; struct fr_desc *frin_spill; struct fr_desc *frout_spill; union rx_tx_desc *class_0_spill; Modified: head/sys/mips/rmi/fmn.c ============================================================================== --- head/sys/mips/rmi/fmn.c Fri Sep 17 09:50:36 2010 (r212789) +++ head/sys/mips/rmi/fmn.c Fri Sep 17 10:28:10 2010 (r212790) @@ -60,11 +60,6 @@ __FBSDID("$FreeBSD$"); #include #include -void -disable_msgring_int(void *arg); -void -enable_msgring_int(void *arg); - /* definitions */ struct tx_stn_handler { void (*action) (int, int, int, int, struct msgrng_msg *, void *); @@ -101,14 +96,12 @@ do { \ static struct mtx msgrng_lock; static int msgring_int_enabled; static int msgring_pop_num_buckets; -static uint32_t msgring_pop_bucket_mask; +static uint8_t msgring_pop_bucket_mask; static int msgring_int_type; static int msgring_watermark_count; static uint32_t msgring_thread_mask; uint32_t msgrng_msg_cycles = 0; -void xlr_msgring_handler(struct trapframe *); - void xlr_msgring_cpu_init(void) { @@ -174,28 +167,34 @@ xlr_msgring_config(void) msgring_thread_mask = 0x01; } -void -xlr_msgring_handler(struct trapframe *tf) +/* + * Drain out max_messages for the buckets set in the bucket mask. + * Use max_messages = 0 to drain out all messages. + */ +uint32_t +xlr_msgring_handler(uint8_t bucket_mask, uint32_t max_messages) { - unsigned long mflags; int bucket = 0; int size = 0, code = 0, rx_stid = 0, tx_stid = 0; struct msgrng_msg msg; - unsigned int bucket_empty_bm = 0; + uint8_t bucket_empty_bm = 0; unsigned int status = 0; + unsigned long mflags; + uint32_t n_msgs; + n_msgs = 0; mflags = msgrng_access_enable(); - /* First Drain all the high priority messages */ for (;;) { - bucket_empty_bm = (msgrng_read_status() >> 24) & msgring_pop_bucket_mask; + bucket_empty_bm = (msgrng_read_status() >> 24) & bucket_mask; /* all buckets empty, break */ - if (bucket_empty_bm == msgring_pop_bucket_mask) + if (bucket_empty_bm == bucket_mask) break; for (bucket = 0; bucket < msgring_pop_num_buckets; bucket++) { - if ((bucket_empty_bm & (1 << bucket)) /* empty */ ) + if (!((1 << bucket) & bucket_mask) /* bucket not in mask */ + || (bucket_empty_bm & (1 << bucket))) /* empty */ continue; status = message_receive(bucket, &size, &code, &rx_stid, &msg); @@ -203,6 +202,7 @@ xlr_msgring_handler(struct trapframe *tf continue; tx_stid = xlr_board_info.msgmap[rx_stid]; + n_msgs++; if (!tx_stn_handlers[tx_stid].action) { printf("[%s]: No Handler for message from stn_id=%d, bucket=%d, " @@ -215,13 +215,19 @@ xlr_msgring_handler(struct trapframe *tf &msg, tx_stn_handlers[tx_stid].dev_id); mflags = msgrng_access_enable(); } + if (max_messages > 0 && n_msgs >= max_messages) + goto done; } } + +done: msgrng_restore(mflags); + + return (n_msgs); } -void -enable_msgring_int(void *arg) +static void +enable_msgring_int(void) { uint32_t config, mflags; @@ -232,8 +238,8 @@ enable_msgring_int(void *arg) msgrng_restore(mflags); } -void -disable_msgring_int(void *arg) +static void +disable_msgring_int(void) { uint32_t config, mflags; @@ -259,7 +265,7 @@ msgring_process_fast_intr(void *arg) * Interrupt thread will enable the interrupts after processing all * messages */ - disable_msgring_int(NULL); + disable_msgring_int(); atomic_store_rel_int(&it->i_pending, 1); thread_lock(td); if (TD_AWAITING_INTR(td)) { @@ -291,7 +297,7 @@ msgring_process(void *arg) atomic_store_rel_ptr((volatile uintptr_t *)&msgring_ithreads[ithd->i_core], (uintptr_t)arg); - enable_msgring_int(NULL); + enable_msgring_int(); while (1) { while (ithd->i_pending) { @@ -300,9 +306,9 @@ msgring_process(void *arg) * make sure that this write posts before any of the * memory or device accesses in the handlers. */ - xlr_msgring_handler(NULL); + xlr_msgring_handler(msgring_pop_bucket_mask, 0); atomic_store_rel_int(&ithd->i_pending, 0); - enable_msgring_int(NULL); + enable_msgring_int(); } if (!ithd->i_pending) { thread_lock(td); Modified: head/sys/mips/rmi/msgring.h ============================================================================== --- head/sys/mips/rmi/msgring.h Fri Sep 17 09:50:36 2010 (r212789) +++ head/sys/mips/rmi/msgring.h Fri Sep 17 10:28:10 2010 (r212790) @@ -386,10 +386,11 @@ enum { MAX_TX_STNS }; -extern int register_msgring_handler(int major, +int register_msgring_handler(int major, void (*action) (int, int, int, int, struct msgrng_msg *, void *), void *dev_id); -extern void xlr_msgring_cpu_init(void); -extern void xlr_msgring_config(void); +uint32_t xlr_msgring_handler(uint8_t bucket_mask, uint32_t max_messages); +void xlr_msgring_cpu_init(void); +void xlr_msgring_config(void); #endif From owner-svn-src-head@FreeBSD.ORG Fri Sep 17 11:43:39 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0230C106566C; Fri, 17 Sep 2010 11:43:39 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail01.syd.optusnet.com.au (mail01.syd.optusnet.com.au [211.29.132.182]) by mx1.freebsd.org (Postfix) with ESMTP id 8C1928FC1A; Fri, 17 Sep 2010 11:43:38 +0000 (UTC) Received: from c122-107-116-249.carlnfd1.nsw.optusnet.com.au (c122-107-116-249.carlnfd1.nsw.optusnet.com.au [122.107.116.249]) by mail01.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o8HBhYlE018483 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 17 Sep 2010 21:43:35 +1000 Date: Fri, 17 Sep 2010 21:43:34 +1000 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: "David O'Brien" In-Reply-To: <20100917002101.GA13653@dragon.NUXI.org> Message-ID: <20100917212708.Y771@delplex.bde.org> References: <201009091927.o89JReXm022426@svn.freebsd.org> <20100909195302.GA48144@stack.nl> <20100917002101.GA13653@dragon.NUXI.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Jilles Tjoelker Subject: Re: svn commit: r212374 - head/usr.bin/printf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2010 11:43:39 -0000 On Thu, 16 Sep 2010, David O'Brien wrote: > ... > Interestingly, we may not be compliant with susv3 if I am reading this > correctly: > > The printf utility is required to notify the user when conversion > errors are detected while producing numeric output; thus, the > following results would be expected on an implementation with 32-bit > twos-complement integers when %d is specified as the format operand: > > Argument Standard Output Diagnostic Output > 5a 5 printf: "5a" not completely converted > 9999999999 2147483647 printf: "9999999999" arithmetic overflow > -9999999999 -2147483648 printf: "-9999999999" arithmetic overflow > ABC 0 printf: "ABC" expected numeric value > > > $ uname -m > i386 > $ for A in 5a 9999999999 -9999999999 ABC do /usr/bin/printf "%d\n" $A ; done > printf: 5a: not completely converted > 5 > 9999999999 > -9999999999 > printf: ABC: expected numeric value > 0 > > Though this is in the "informative" section, so maybe this is just one > set of compliant output. Though It is my read that printf(1) should > behave like printf(3), which the above does not for these long long int > values. The implementation actually uses [u]quad_t integers (blech -- it should use [u]intmax_t integers). This may be conformant. POSIX has the general bug of making low-quality implementations, that only support plain integers for command-line options, conformant, and may even require not supporting larger integers in some cases, but hopefully it doesn't require this bug for printf(1). > #include > int > main(void) > { > printf("%d\n", 9999999999); > printf("%d\n", -9999999999); > return 0; > } Restricting to plain int for printf(1) would be less than useful, since unlike printf(3), it has no way of controlling the integer size -- even "%ld" format is "illegal" (should be "invalid") for printf(1). Users wanting to handle large integers would have to use floating point with "%.0f" format, which has some advantages anyway, but printf(1)'s FP format is only double precision, so it doesn't work right for integers >= 2**53 even on arches that have working long double precision. Rounding errors are also not reported for integers >= 2**53 when represented as doubles: $ printf %.0f\\n 9999999999999999 10000000000000000 and its documentation is slightly wrong in saying (re-quoting the above): > The printf utility is required to notify the user when conversion > errors are detected while producing numeric output; thus ... since in the floating point case, it is very unusual for there not to be a rounding error (e.g., 0.1 is not exactly representable in base 2 FP), so reporting _all_ rounding errors would be wrong. In fact, it doesn't seem to be done at all for rounding errors. Bruce From owner-svn-src-head@FreeBSD.ORG Fri Sep 17 14:15:03 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6840E106564A; Fri, 17 Sep 2010 14:15:03 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 55C138FC0A; Fri, 17 Sep 2010 14:15:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8HEF36W032475; Fri, 17 Sep 2010 14:15:03 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8HEF3Fb032473; Fri, 17 Sep 2010 14:15:03 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201009171415.o8HEF3Fb032473@svn.freebsd.org> From: Martin Matuska Date: Fri, 17 Sep 2010 14:15:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212791 - head/cddl/contrib/opensolaris/lib/libzfs/common X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2010 14:15:03 -0000 Author: mm Date: Fri Sep 17 14:15:03 2010 New Revision: 212791 URL: http://svn.freebsd.org/changeset/base/212791 Log: Remove duplicate include of Approved by: delphij (mentor) MFC after: 3 days Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Fri Sep 17 10:28:10 2010 (r212790) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Fri Sep 17 14:15:03 2010 (r212791) @@ -40,7 +40,6 @@ #include #include #include -#include #include #include "zfs_namecheck.h" From owner-svn-src-head@FreeBSD.ORG Fri Sep 17 16:05:26 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1F5661065672; Fri, 17 Sep 2010 16:05:26 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0E50F8FC24; Fri, 17 Sep 2010 16:05:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8HG5PcY035173; Fri, 17 Sep 2010 16:05:25 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8HG5PSh035171; Fri, 17 Sep 2010 16:05:25 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201009171605.o8HG5PSh035171@svn.freebsd.org> From: Warner Losh Date: Fri, 17 Sep 2010 16:05:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212798 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2010 16:05:26 -0000 Author: imp Date: Fri Sep 17 16:05:25 2010 New Revision: 212798 URL: http://svn.freebsd.org/changeset/base/212798 Log: By popular demand, kill all the non GIANT related interrupt messages. They are confusing and add little value. Reviewed by: jhb@ Modified: head/sys/kern/subr_bus.c Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Fri Sep 17 15:58:05 2010 (r212797) +++ head/sys/kern/subr_bus.c Fri Sep 17 16:05:25 2010 (r212798) @@ -3998,15 +3998,6 @@ bus_setup_intr(device_t dev, struct reso return (error); if (handler != NULL && !(flags & INTR_MPSAFE)) device_printf(dev, "[GIANT-LOCKED]\n"); - if (bootverbose && (flags & INTR_MPSAFE)) - device_printf(dev, "[MPSAFE]\n"); - if (filter != NULL) { - if (handler == NULL) - device_printf(dev, "[FILTER]\n"); - else - device_printf(dev, "[FILTER+ITHREAD]\n"); - } else - device_printf(dev, "[ITHREAD]\n"); return (0); } From owner-svn-src-head@FreeBSD.ORG Fri Sep 17 16:20:29 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D96E51065693; Fri, 17 Sep 2010 16:20:29 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BC6408FC17; Fri, 17 Sep 2010 16:20:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8HGKTEG035588; Fri, 17 Sep 2010 16:20:29 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8HGKTla035583; Fri, 17 Sep 2010 16:20:29 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201009171620.o8HGKTla035583@svn.freebsd.org> From: Michael Tuexen Date: Fri, 17 Sep 2010 16:20:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212799 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2010 16:20:30 -0000 Author: tuexen Date: Fri Sep 17 16:20:29 2010 New Revision: 212799 URL: http://svn.freebsd.org/changeset/base/212799 Log: * Implement initial version of send buffer splitting. * Make send/recv buffer splitting switchable via sysctl. * While there: Fix some comments. Modified: head/sys/netinet/sctp_constants.h head/sys/netinet/sctp_output.c head/sys/netinet/sctp_sysctl.c head/sys/netinet/sctp_sysctl.h Modified: head/sys/netinet/sctp_constants.h ============================================================================== --- head/sys/netinet/sctp_constants.h Fri Sep 17 16:05:25 2010 (r212798) +++ head/sys/netinet/sctp_constants.h Fri Sep 17 16:20:29 2010 (r212799) @@ -948,6 +948,9 @@ __FBSDID("$FreeBSD$"); */ #define SCTP_TIME_WAIT 60 +#define SCTP_SEND_BUFFER_SPLITTING 0x00000001 +#define SCTP_RECV_BUFFER_SPLITTING 0x00000002 + /* The system retains a cache of free chunks such to * cut down on calls the memory allocation system. There * is a per association limit of free items and a overall Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Fri Sep 17 16:05:25 2010 (r212798) +++ head/sys/netinet/sctp_output.c Fri Sep 17 16:20:29 2010 (r212799) @@ -7407,7 +7407,7 @@ sctp_med_chunk_output(struct sctp_inpcb /* temp arrays for unlinking */ struct sctp_tmit_chunk *data_list[SCTP_MAX_DATA_BUNDLING]; int no_fragmentflg, error; - unsigned int max_rwnd_per_dest; + unsigned int max_rwnd_per_dest, max_send_per_dest; int one_chunk, hbflag, skip_data_for_this_net; int asconf, cookie, no_out_cnt; int bundle_at, ctl_cnt, no_data_chunks, eeor_mode; @@ -7469,6 +7469,10 @@ sctp_med_chunk_output(struct sctp_inpcb } } max_rwnd_per_dest = ((asoc->peers_rwnd + asoc->total_flight) / asoc->numnets); + if (stcb->sctp_socket) + max_send_per_dest = SCTP_SB_LIMIT_SND(stcb->sctp_socket) / asoc->numnets; + else + max_send_per_dest = 0; if ((no_data_chunks == 0) && (!TAILQ_EMPTY(&asoc->out_wheel))) { TAILQ_FOREACH(net, &asoc->nets, sctp_next) { /* @@ -8039,9 +8043,22 @@ again_one_more_time: goto no_data_fill; } if ((asoc->sctp_cmt_on_off == 1) && + (SCTP_BASE_SYSCTL(sctp_buffer_splitting) & SCTP_RECV_BUFFER_SPLITTING) && (net->flight_size > max_rwnd_per_dest)) { goto no_data_fill; } + /* + * We need a specific accounting for the usage of the send + * buffer. We also need to check the number of messages per + * net. For now, this is better than nothing and it disabled + * by default... + */ + if ((asoc->sctp_cmt_on_off == 1) && + (SCTP_BASE_SYSCTL(sctp_buffer_splitting) & SCTP_SEND_BUFFER_SPLITTING) && + (max_send_per_dest > 0) && + (net->flight_size > max_send_per_dest)) { + goto no_data_fill; + } /*********************/ /* Data transmission */ /*********************/ Modified: head/sys/netinet/sctp_sysctl.c ============================================================================== --- head/sys/netinet/sctp_sysctl.c Fri Sep 17 16:05:25 2010 (r212798) +++ head/sys/netinet/sctp_sysctl.c Fri Sep 17 16:20:29 2010 (r212799) @@ -109,6 +109,7 @@ sctp_init_sysctls() SCTP_BASE_SYSCTL(sctp_mobility_base) = SCTPCTL_MOBILITY_BASE_DEFAULT; SCTP_BASE_SYSCTL(sctp_mobility_fasthandoff) = SCTPCTL_MOBILITY_FASTHANDOFF_DEFAULT; SCTP_BASE_SYSCTL(sctp_vtag_time_wait) = SCTPCTL_TIME_WAIT_DEFAULT; + SCTP_BASE_SYSCTL(sctp_buffer_splitting) = SCTPCTL_BUFFER_SPLITTING_DEFAULT; #if defined(SCTP_LOCAL_TRACE_BUF) memset(&SCTP_BASE_SYSCTL(sctp_log), 0, sizeof(struct sctp_log)); #endif @@ -620,7 +621,7 @@ sysctl_sctp_check(SYSCTL_HANDLER_ARGS) RANGECHK(SCTP_BASE_SYSCTL(sctp_default_cc_module), SCTPCTL_DEFAULT_CC_MODULE_MIN, SCTPCTL_DEFAULT_CC_MODULE_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_default_frag_interleave), SCTPCTL_DEFAULT_FRAG_INTERLEAVE_MIN, SCTPCTL_DEFAULT_FRAG_INTERLEAVE_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_vtag_time_wait), SCTPCTL_TIME_WAIT_MIN, SCTPCTL_TIME_WAIT_MAX); - + RANGECHK(SCTP_BASE_SYSCTL(sctp_buffer_splitting), SCTPCTL_BUFFER_SPLITTING_MIN, SCTPCTL_BUFFER_SPLITTING_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_mobility_base), SCTPCTL_MOBILITY_BASE_MIN, SCTPCTL_MOBILITY_BASE_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_mobility_fasthandoff), SCTPCTL_MOBILITY_FASTHANDOFF_MIN, SCTPCTL_MOBILITY_FASTHANDOFF_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_udp_tunneling_for_client_enable), SCTPCTL_UDP_TUNNELING_FOR_CLIENT_ENABLE_MIN, SCTPCTL_UDP_TUNNELING_FOR_CLIENT_ENABLE_MAX); @@ -1067,6 +1068,10 @@ SYSCTL_PROC(_net_inet_sctp, OID_AUTO, vt &SCTP_BASE_SYSCTL(sctp_vtag_time_wait), 0, sysctl_sctp_check, "IU", SCTPCTL_TIME_WAIT_DESC); +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, buffer_splitting, CTLTYPE_INT | CTLFLAG_RW, + &SCTP_BASE_SYSCTL(sctp_buffer_splitting), 0, sysctl_sctp_check, "IU", + SCTPCTL_BUFFER_SPLITTING_DESC); + #ifdef SCTP_DEBUG SYSCTL_PROC(_net_inet_sctp, OID_AUTO, debug, CTLTYPE_INT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_debug_on), 0, sysctl_sctp_check, "IU", Modified: head/sys/netinet/sctp_sysctl.h ============================================================================== --- head/sys/netinet/sctp_sysctl.h Fri Sep 17 16:05:25 2010 (r212798) +++ head/sys/netinet/sctp_sysctl.h Fri Sep 17 16:20:29 2010 (r212799) @@ -107,6 +107,7 @@ struct sctp_sysctl { uint32_t sctp_udp_tunneling_port; uint32_t sctp_enable_sack_immediately; uint32_t sctp_vtag_time_wait; + uint32_t sctp_buffer_splitting; #if defined(SCTP_DEBUG) uint32_t sctp_debug_on; #endif @@ -478,19 +479,23 @@ struct sctp_sysctl { #define SCTPCTL_SACK_IMMEDIATELY_ENABLE_MAX 1 #define SCTPCTL_SACK_IMMEDIATELY_ENABLE_DEFAULT SCTPCTL_SACK_IMMEDIATELY_ENABLE_MIN -/* Enable sending of the SACK-IMMEDIATELY bit */ +/* Enable sending of the NAT-FRIENDLY message */ #define SCTPCTL_NAT_FRIENDLY_INITS_DESC "Enable sending of the nat-friendly SCTP option on INITs." #define SCTPCTL_NAT_FRIENDLY_INITS_MIN 0 #define SCTPCTL_NAT_FRIENDLY_INITS_MAX 1 #define SCTPCTL_NAT_FRIENDLY_INITS_DEFAULT SCTPCTL_NAT_FRIENDLY_INITS_MIN - -/* Vtag tiem wait bits */ -#define SCTPCTL_TIME_WAIT_DESC "Vtag time wait time 0 disables." +/* Vtag time wait in seconds */ +#define SCTPCTL_TIME_WAIT_DESC "Vtag time wait time in seconds, 0 disables it." #define SCTPCTL_TIME_WAIT_MIN 0 #define SCTPCTL_TIME_WAIT_MAX 0xffffffff #define SCTPCTL_TIME_WAIT_DEFAULT SCTP_TIME_WAIT +/* Enable Send/Receive buffer splitting */ +#define SCTPCTL_BUFFER_SPLITTING_DESC "Enable send/receive buffer splitting." +#define SCTPCTL_BUFFER_SPLITTING_MIN 0 +#define SCTPCTL_BUFFER_SPLITTING_MAX 0x3 +#define SCTPCTL_BUFFER_SPLITTING_DEFAULT SCTPCTL_BUFFER_SPLITTING_MIN #if defined(SCTP_DEBUG) /* debug: Configure debug output */ From owner-svn-src-head@FreeBSD.ORG Fri Sep 17 18:53:08 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0AE46106564A; Fri, 17 Sep 2010 18:53:08 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ED5F48FC16; Fri, 17 Sep 2010 18:53:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8HIr7fb038696; Fri, 17 Sep 2010 18:53:07 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8HIr7a2038692; Fri, 17 Sep 2010 18:53:07 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201009171853.o8HIr7a2038692@svn.freebsd.org> From: Michael Tuexen Date: Fri, 17 Sep 2010 18:53:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212800 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2010 18:53:08 -0000 Author: tuexen Date: Fri Sep 17 18:53:07 2010 New Revision: 212800 URL: http://svn.freebsd.org/changeset/base/212800 Log: Make the initial congestion window configurable via sysctl. MFC after: 2 weeks. Modified: head/sys/netinet/sctp_cc_functions.c head/sys/netinet/sctp_sysctl.c head/sys/netinet/sctp_sysctl.h Modified: head/sys/netinet/sctp_cc_functions.c ============================================================================== --- head/sys/netinet/sctp_cc_functions.c Fri Sep 17 16:20:29 2010 (r212799) +++ head/sys/netinet/sctp_cc_functions.c Fri Sep 17 18:53:07 2010 (r212800) @@ -44,18 +44,27 @@ #include #include __FBSDID("$FreeBSD$"); + void sctp_set_initial_cc_param(struct sctp_tcb *stcb, struct sctp_nets *net) { + struct sctp_association *assoc; + uint32_t cwnd_in_mtu; + + assoc = &stcb->asoc; /* - * We take the max of the burst limit times a MTU or the - * INITIAL_CWND. We then limit this to 4 MTU's of sending. cwnd must - * be at least 2 MTU. + * We take the minimum of the burst limit and the initial congestion + * window. The initial congestion window is at least two times the + * MTU. */ - net->cwnd = min((net->mtu * 4), max((2 * net->mtu), SCTP_INITIAL_CWND)); - net->ssthresh = stcb->asoc.peers_rwnd; + cwnd_in_mtu = SCTP_BASE_SYSCTL(sctp_initial_cwnd); + if ((assoc->max_burst > 0) && (cwnd_in_mtu > assoc->max_burst)) + cwnd_in_mtu = assoc->max_burst; + net->cwnd = (net->mtu - sizeof(struct sctphdr)) * cwnd_in_mtu; + net->ssthresh = assoc->peers_rwnd; - if (SCTP_BASE_SYSCTL(sctp_logging_level) & (SCTP_CWND_MONITOR_ENABLE | SCTP_CWND_LOGGING_ENABLE)) { + if (SCTP_BASE_SYSCTL(sctp_logging_level) & + (SCTP_CWND_MONITOR_ENABLE | SCTP_CWND_LOGGING_ENABLE)) { sctp_log_cwnd(stcb, net, 0, SCTP_CWND_INITIALIZATION); } } Modified: head/sys/netinet/sctp_sysctl.c ============================================================================== --- head/sys/netinet/sctp_sysctl.c Fri Sep 17 16:20:29 2010 (r212799) +++ head/sys/netinet/sctp_sysctl.c Fri Sep 17 18:53:07 2010 (r212800) @@ -110,6 +110,7 @@ sctp_init_sysctls() SCTP_BASE_SYSCTL(sctp_mobility_fasthandoff) = SCTPCTL_MOBILITY_FASTHANDOFF_DEFAULT; SCTP_BASE_SYSCTL(sctp_vtag_time_wait) = SCTPCTL_TIME_WAIT_DEFAULT; SCTP_BASE_SYSCTL(sctp_buffer_splitting) = SCTPCTL_BUFFER_SPLITTING_DEFAULT; + SCTP_BASE_SYSCTL(sctp_initial_cwnd) = SCTPCTL_INITIAL_CWND_DEFAULT; #if defined(SCTP_LOCAL_TRACE_BUF) memset(&SCTP_BASE_SYSCTL(sctp_log), 0, sizeof(struct sctp_log)); #endif @@ -622,6 +623,7 @@ sysctl_sctp_check(SYSCTL_HANDLER_ARGS) RANGECHK(SCTP_BASE_SYSCTL(sctp_default_frag_interleave), SCTPCTL_DEFAULT_FRAG_INTERLEAVE_MIN, SCTPCTL_DEFAULT_FRAG_INTERLEAVE_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_vtag_time_wait), SCTPCTL_TIME_WAIT_MIN, SCTPCTL_TIME_WAIT_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_buffer_splitting), SCTPCTL_BUFFER_SPLITTING_MIN, SCTPCTL_BUFFER_SPLITTING_MAX); + RANGECHK(SCTP_BASE_SYSCTL(sctp_initial_cwnd), SCTPCTL_INITIAL_CWND_MIN, SCTPCTL_INITIAL_CWND_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_mobility_base), SCTPCTL_MOBILITY_BASE_MIN, SCTPCTL_MOBILITY_BASE_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_mobility_fasthandoff), SCTPCTL_MOBILITY_FASTHANDOFF_MIN, SCTPCTL_MOBILITY_FASTHANDOFF_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_udp_tunneling_for_client_enable), SCTPCTL_UDP_TUNNELING_FOR_CLIENT_ENABLE_MIN, SCTPCTL_UDP_TUNNELING_FOR_CLIENT_ENABLE_MAX); @@ -1072,6 +1074,10 @@ SYSCTL_PROC(_net_inet_sctp, OID_AUTO, bu &SCTP_BASE_SYSCTL(sctp_buffer_splitting), 0, sysctl_sctp_check, "IU", SCTPCTL_BUFFER_SPLITTING_DESC); +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, initial_cwnd, CTLTYPE_INT | CTLFLAG_RW, + &SCTP_BASE_SYSCTL(sctp_initial_cwnd), 0, sysctl_sctp_check, "IU", + SCTPCTL_INITIAL_CWND_DESC); + #ifdef SCTP_DEBUG SYSCTL_PROC(_net_inet_sctp, OID_AUTO, debug, CTLTYPE_INT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_debug_on), 0, sysctl_sctp_check, "IU", Modified: head/sys/netinet/sctp_sysctl.h ============================================================================== --- head/sys/netinet/sctp_sysctl.h Fri Sep 17 16:20:29 2010 (r212799) +++ head/sys/netinet/sctp_sysctl.h Fri Sep 17 18:53:07 2010 (r212800) @@ -108,6 +108,7 @@ struct sctp_sysctl { uint32_t sctp_enable_sack_immediately; uint32_t sctp_vtag_time_wait; uint32_t sctp_buffer_splitting; + uint32_t sctp_initial_cwnd; #if defined(SCTP_DEBUG) uint32_t sctp_debug_on; #endif @@ -497,6 +498,12 @@ struct sctp_sysctl { #define SCTPCTL_BUFFER_SPLITTING_MAX 0x3 #define SCTPCTL_BUFFER_SPLITTING_DEFAULT SCTPCTL_BUFFER_SPLITTING_MIN +/* Initial congestion window in MTU */ +#define SCTPCTL_INITIAL_CWND_DESC "Initial congestion window in MTU" +#define SCTPCTL_INITIAL_CWND_MIN 2 +#define SCTPCTL_INITIAL_CWND_MAX 0xffffffff +#define SCTPCTL_INITIAL_CWND_DEFAULT 3 + #if defined(SCTP_DEBUG) /* debug: Configure debug output */ #define SCTPCTL_DEBUG_DESC "Configure debug output" From owner-svn-src-head@FreeBSD.ORG Fri Sep 17 19:20:40 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 24A891065672; Fri, 17 Sep 2010 19:20:40 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ECE758FC17; Fri, 17 Sep 2010 19:20:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8HJKdeA039353; Fri, 17 Sep 2010 19:20:39 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8HJKdbJ039349; Fri, 17 Sep 2010 19:20:39 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201009171920.o8HJKdbJ039349@svn.freebsd.org> From: Michael Tuexen Date: Fri, 17 Sep 2010 19:20:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212801 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2010 19:20:40 -0000 Author: tuexen Date: Fri Sep 17 19:20:39 2010 New Revision: 212801 URL: http://svn.freebsd.org/changeset/base/212801 Log: Fix a bug where the wrong PR-SCTP policy was considered. While there, use always the same code for the check of TTL expiration. MFC after: 2 weeks. Modified: head/sys/netinet/sctp_indata.c head/sys/netinet/sctp_output.c head/sys/netinet/sctp_timer.c Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Fri Sep 17 18:53:07 2010 (r212800) +++ head/sys/netinet/sctp_indata.c Fri Sep 17 19:20:39 2010 (r212801) @@ -3300,13 +3300,7 @@ sctp_strike_gap_ack_chunks(struct sctp_t if (stcb->asoc.peer_supports_prsctp) { if ((PR_SCTP_TTL_ENABLED(tp1->flags)) && tp1->sent < SCTP_DATAGRAM_ACKED) { /* Is it expired? */ - if ( - /* - * TODO sctp_constants.h needs alternative - * time macros when _KERNEL is undefined. - */ - (timevalcmp(&now, &tp1->rec.data.timetodrop, >)) - ) { + if (timevalcmp(&now, &tp1->rec.data.timetodrop, >)) { /* Yes so drop it */ if (tp1->data != NULL) { (void)sctp_release_pr_sctp_chunk(stcb, tp1, Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Fri Sep 17 18:53:07 2010 (r212800) +++ head/sys/netinet/sctp_output.c Fri Sep 17 19:20:39 2010 (r212801) @@ -5728,7 +5728,7 @@ sctp_prune_prsctp(struct sctp_tcb *stcb, while (chk) { nchk = TAILQ_NEXT(chk, sctp_next); /* Here we must move to the sent queue and mark */ - if (PR_SCTP_TTL_ENABLED(chk->flags)) { + if (PR_SCTP_BUF_ENABLED(chk->flags)) { if (chk->rec.data.timetodrop.tv_sec >= (long)srcv->sinfo_timetolive) { if (chk->data) { /* Modified: head/sys/netinet/sctp_timer.c ============================================================================== --- head/sys/netinet/sctp_timer.c Fri Sep 17 18:53:07 2010 (r212800) +++ head/sys/netinet/sctp_timer.c Fri Sep 17 19:20:39 2010 (r212801) @@ -772,9 +772,7 @@ start_again: } if (stcb->asoc.peer_supports_prsctp && PR_SCTP_TTL_ENABLED(chk->flags)) { /* Is it expired? */ - if ((now.tv_sec > chk->rec.data.timetodrop.tv_sec) || - ((chk->rec.data.timetodrop.tv_sec == now.tv_sec) && - (now.tv_usec > chk->rec.data.timetodrop.tv_usec))) { + if (timevalcmp(&now, &chk->rec.data.timetodrop, >)) { /* Yes so drop it */ if (chk->data) { (void)sctp_release_pr_sctp_chunk(stcb, From owner-svn-src-head@FreeBSD.ORG Fri Sep 17 21:53:56 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D0FFE1065670; Fri, 17 Sep 2010 21:53:56 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BFC668FC18; Fri, 17 Sep 2010 21:53:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8HLruDu042949; Fri, 17 Sep 2010 21:53:56 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8HLruj7042946; Fri, 17 Sep 2010 21:53:56 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201009172153.o8HLruj7042946@svn.freebsd.org> From: "Kenneth D. Merry" Date: Fri, 17 Sep 2010 21:53:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212802 - head/sys/dev/mps X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2010 21:53:56 -0000 Author: ken Date: Fri Sep 17 21:53:56 2010 New Revision: 212802 URL: http://svn.freebsd.org/changeset/base/212802 Log: Fix a couple of mps problems. When the driver is completely saturated with commands (1024 in the case of the SAS2008 in my test system), I/O stops. If we tell CAM that we have one less command slot than we have actually allocated, everything works fine. We also need a few extra command slots to allow for aborts and other task management commands to be sent down. This needs more investigation to determine the root cause, but for now this fixes things in my testing. mps.c: Change a printf() to mps_printf(). mps_sas.c: Subtract 5 command slots when we tell CAM how many commands we can handle. Add some commented-out logic to print the contents the CDBs for timed-out commands. This can help in debugging devices that are timing out. This will be uncommented once I bring some CAM changes in. Reported by: Andrew Boyer Modified: head/sys/dev/mps/mps.c head/sys/dev/mps/mps_sas.c Modified: head/sys/dev/mps/mps.c ============================================================================== --- head/sys/dev/mps/mps.c Fri Sep 17 19:20:39 2010 (r212801) +++ head/sys/dev/mps/mps.c Fri Sep 17 21:53:56 2010 (r212802) @@ -1416,7 +1416,7 @@ mps_data_cb(void *arg, bus_dma_segment_t chain = mps_alloc_chain(sc); if (chain == NULL) { /* Resource shortage, roll back! */ - printf("out of chain frames\n"); + mps_printf(sc, "out of chain frames\n"); return; } Modified: head/sys/dev/mps/mps_sas.c ============================================================================== --- head/sys/dev/mps/mps_sas.c Fri Sep 17 19:20:39 2010 (r212801) +++ head/sys/dev/mps/mps_sas.c Fri Sep 17 21:53:56 2010 (r212802) @@ -596,6 +596,7 @@ mps_attach_sas(struct mps_softc *sc) { struct mpssas_softc *sassc; int error = 0; + int num_sim_reqs; mps_dprint(sc, MPS_TRACE, "%s\n", __func__); @@ -605,15 +606,30 @@ mps_attach_sas(struct mps_softc *sc) sc->sassc = sassc; sassc->sc = sc; - if ((sassc->devq = cam_simq_alloc(sc->num_reqs)) == NULL) { + /* + * Tell CAM that we can handle 5 fewer requests than we have + * allocated. If we allow the full number of requests, all I/O + * will halt when we run out of resources. Things work fine with + * just 1 less request slot given to CAM than we have allocated. + * We also need a couple of extra commands so that we can send down + * abort, reset, etc. requests when commands time out. Otherwise + * we could wind up in a situation with sc->num_reqs requests down + * on the card and no way to send an abort. + * + * XXX KDM need to figure out why I/O locks up if all commands are + * used. + */ + num_sim_reqs = sc->num_reqs - 5; + + if ((sassc->devq = cam_simq_alloc(num_sim_reqs)) == NULL) { mps_dprint(sc, MPS_FAULT, "Cannot allocate SIMQ\n"); error = ENOMEM; goto out; } sassc->sim = cam_sim_alloc(mpssas_action, mpssas_poll, "mps", sassc, - device_get_unit(sc->mps_dev), &sc->mps_mtx, sc->num_reqs, sc->num_reqs, - sassc->devq); + device_get_unit(sc->mps_dev), &sc->mps_mtx, num_sim_reqs, + num_sim_reqs, sassc->devq); if (sassc->sim == NULL) { mps_dprint(sc, MPS_FAULT, "Cannot allocate SIM\n"); error = EINVAL; @@ -930,6 +946,9 @@ mpssas_scsiio_timeout(void *data) struct mps_softc *sc; struct mps_command *cm; struct mpssas_target *targ; +#if 0 + char cdb_str[(SCSI_MAX_CDBLEN * 3) + 1]; +#endif cm = (struct mps_command *)data; sc = cm->cm_sc; @@ -954,6 +973,22 @@ mpssas_scsiio_timeout(void *data) xpt_print(ccb->ccb_h.path, "SCSI command timeout on device handle " "0x%04x SMID %d\n", targ->handle, cm->cm_desc.Default.SMID); + /* + * XXX KDM this is useful for debugging purposes, but the existing + * scsi_op_desc() implementation can't handle a NULL value for + * inq_data. So this will remain commented out until I bring in + * those changes as well. + */ +#if 0 + xpt_print(ccb->ccb_h.path, "Timed out command: %s. CDB %s\n", + scsi_op_desc((ccb->ccb_h.flags & CAM_CDB_POINTER) ? + ccb->csio.cdb_io.cdb_ptr[0] : + ccb->csio.cdb_io.cdb_bytes[0], NULL), + scsi_cdb_string((ccb->ccb_h.flags & CAM_CDB_POINTER) ? + ccb->csio.cdb_io.cdb_ptr : + ccb->csio.cdb_io.cdb_bytes, cdb_str, + sizeof(cdb_str))); +#endif /* Inform CAM about the timeout and that recovery is starting. */ #if 0 From owner-svn-src-head@FreeBSD.ORG Fri Sep 17 22:05:27 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 92B6F106566C; Fri, 17 Sep 2010 22:05:27 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 81D3E8FC16; Fri, 17 Sep 2010 22:05:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8HM5Re1043267; Fri, 17 Sep 2010 22:05:27 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8HM5RPG043265; Fri, 17 Sep 2010 22:05:27 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201009172205.o8HM5RPG043265@svn.freebsd.org> From: Andre Oppermann Date: Fri, 17 Sep 2010 22:05:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212803 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2010 22:05:27 -0000 Author: andre Date: Fri Sep 17 22:05:27 2010 New Revision: 212803 URL: http://svn.freebsd.org/changeset/base/212803 Log: Rearrange the TSO code to make it more readable and to clearly separate the decision logic, of whether we can do TSO, and the calculation of the burst length into two distinct parts. Change the way the TSO burst length calculation is done. While TSO could do bursts of 65535 bytes that can't be represented in ip_len together with the IP and TCP header. Account for that and use IP_MAXPACKET instead of TCP_MAXWIN as base constant (both have the same value of 64K). When more data is available prevent less than MSS sized segments from being sent during the current TSO burst. Add two more KASSERTs to ensure the integrity of the packets. Tested by: Ben Wilber MFC after: 10 days Modified: head/sys/netinet/tcp_output.c Modified: head/sys/netinet/tcp_output.c ============================================================================== --- head/sys/netinet/tcp_output.c Fri Sep 17 21:53:56 2010 (r212802) +++ head/sys/netinet/tcp_output.c Fri Sep 17 22:05:27 2010 (r212803) @@ -465,9 +465,8 @@ after_sack_rexmit: } /* - * Truncate to the maximum segment length or enable TCP Segmentation - * Offloading (if supported by hardware) and ensure that FIN is removed - * if the length no longer contains the last data byte. + * Decide if we can use TCP Segmentation Offloading (if supported by + * hardware). * * TSO may only be used if we are in a pure bulk sending state. The * presence of TCP-MD5, SACK retransmits, SACK advertizements and @@ -475,10 +474,6 @@ after_sack_rexmit: * (except for the sequence number) for all generated packets. This * makes it impossible to transmit any options which vary per generated * segment or packet. - * - * The length of TSO bursts is limited to TCP_MAXWIN. That limit and - * removal of FIN (if not already catched here) are handled later after - * the exact length of the TCP options are known. */ #ifdef IPSEC /* @@ -487,22 +482,15 @@ after_sack_rexmit: */ ipsec_optlen = ipsec_hdrsiz_tcp(tp); #endif - if (len > tp->t_maxseg) { - if ((tp->t_flags & TF_TSO) && V_tcp_do_tso && - ((tp->t_flags & TF_SIGNATURE) == 0) && - tp->rcv_numsacks == 0 && sack_rxmit == 0 && - tp->t_inpcb->inp_options == NULL && - tp->t_inpcb->in6p_options == NULL + if ((tp->t_flags & TF_TSO) && V_tcp_do_tso && len > tp->t_maxseg && + ((tp->t_flags & TF_SIGNATURE) == 0) && + tp->rcv_numsacks == 0 && sack_rxmit == 0 && #ifdef IPSEC - && ipsec_optlen == 0 + ipsec_optlen == 0 && #endif - ) { - tso = 1; - } else { - len = tp->t_maxseg; - sendalot = 1; - } - } + tp->t_inpcb->inp_options == NULL && + tp->t_inpcb->in6p_options == NULL) + tso = 1; if (sack_rxmit) { if (SEQ_LT(p->rxmit + len, tp->snd_una + so->so_snd.sb_cc)) @@ -732,28 +720,53 @@ send: * bump the packet length beyond the t_maxopd length. * Clear the FIN bit because we cut off the tail of * the segment. - * - * When doing TSO limit a burst to TCP_MAXWIN minus the - * IP, TCP and Options length to keep ip->ip_len from - * overflowing. Prevent the last segment from being - * fractional thus making them all equal sized and set - * the flag to continue sending. TSO is disabled when - * IP options or IPSEC are present. */ if (len + optlen + ipoptlen > tp->t_maxopd) { flags &= ~TH_FIN; + if (tso) { - if (len > TCP_MAXWIN - hdrlen - optlen) { - len = TCP_MAXWIN - hdrlen - optlen; - len = len - (len % (tp->t_maxopd - optlen)); + KASSERT(ipoptlen == 0, + ("%s: TSO can't do IP options", __func__)); + + /* + * Limit a burst to IP_MAXPACKET minus IP, + * TCP and options length to keep ip->ip_len + * from overflowing. + */ + if (len > IP_MAXPACKET - hdrlen) { + len = IP_MAXPACKET - hdrlen; + sendalot = 1; + } + + /* + * Prevent the last segment from being + * fractional unless the send sockbuf can + * be emptied. + */ + if (sendalot && off + len < so->so_snd.sb_cc) { + len -= len % (tp->t_maxopd - optlen); sendalot = 1; - } else if (tp->t_flags & TF_NEEDFIN) + } + + /* + * Send the FIN in a separate segment + * after the bulk sending is done. + * We don't trust the TSO implementations + * to clear the FIN flag on all but the + * last segment. + */ + if (tp->t_flags & TF_NEEDFIN) sendalot = 1; + } else { len = tp->t_maxopd - optlen - ipoptlen; sendalot = 1; } - } + } else + tso = 0; + + KASSERT(len + hdrlen + ipoptlen <= IP_MAXPACKET, + ("%s: len > IP_MAXPACKET", __func__)); /*#ifdef DIAGNOSTIC*/ #ifdef INET6 @@ -1068,6 +1081,9 @@ send: m->m_pkthdr.tso_segsz = tp->t_maxopd - optlen; } + KASSERT(len + hdrlen + ipoptlen == m_length(m, NULL), + ("%s: mbuf chain shorter than expected", __func__)); + /* * In transmit state, time the transmission and arrange for * the retransmit. In persist state, just set snd_max. From owner-svn-src-head@FreeBSD.ORG Fri Sep 17 22:51:46 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 22526106566C; Fri, 17 Sep 2010 22:51:46 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 11B348FC17; Fri, 17 Sep 2010 22:51:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8HMpjWT044309; Fri, 17 Sep 2010 22:51:45 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8HMpjZJ044307; Fri, 17 Sep 2010 22:51:45 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201009172251.o8HMpjZJ044307@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Fri, 17 Sep 2010 22:51:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212804 - head/sys/boot/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2010 22:51:46 -0000 Author: pjd Date: Fri Sep 17 22:51:45 2010 New Revision: 212804 URL: http://svn.freebsd.org/changeset/base/212804 Log: Remove magic value. Modified: head/sys/boot/zfs/zfs.c Modified: head/sys/boot/zfs/zfs.c ============================================================================== --- head/sys/boot/zfs/zfs.c Fri Sep 17 22:05:27 2010 (r212803) +++ head/sys/boot/zfs/zfs.c Fri Sep 17 22:51:45 2010 (r212804) @@ -45,6 +45,8 @@ __FBSDID("$FreeBSD$"); #include "zfsimpl.c" +#define MAXBDDEV 31 + static int zfs_open(const char *path, struct open_file *f); static int zfs_write(struct open_file *f, void *buf, size_t size, size_t *resid); static int zfs_close(struct open_file *f); @@ -402,7 +404,7 @@ zfs_dev_init(void) * diskN, diskNpM or diskNsM. */ zfs_init(); - for (unit = 0; unit < 32 /* XXX */; unit++) { + for (unit = 0; unit < MAXBDDEV; unit++) { sprintf(devname, "disk%d:", unit); fd = open(devname, O_RDONLY); if (fd == -1) From owner-svn-src-head@FreeBSD.ORG Fri Sep 17 22:59:16 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0D0901065672; Fri, 17 Sep 2010 22:59:16 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D5F368FC0C; Fri, 17 Sep 2010 22:59:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8HMxFs6044496; Fri, 17 Sep 2010 22:59:15 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8HMxFW1044493; Fri, 17 Sep 2010 22:59:15 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201009172259.o8HMxFW1044493@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Fri, 17 Sep 2010 22:59:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212805 - in head/sys/boot/i386: libi386 zfsboot X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2010 22:59:16 -0000 Author: pjd Date: Fri Sep 17 22:59:15 2010 New Revision: 212805 URL: http://svn.freebsd.org/changeset/base/212805 Log: Before VirtualBox is fixed, mark with #ifdef what has to be done to make it possible to boot from ZFS RAIDZ for example from within VirtualBox. The problem with VirtualBox is that its BIOS reports only one disk present. If we choose to ignore this report, we can find all the disks available. We can't have this work-around to be turned on by default, because some broken BIOSes report true when it comes to number of disks, but present the same disk multiple times. Modified: head/sys/boot/i386/libi386/biosdisk.c head/sys/boot/i386/zfsboot/zfsboot.c Modified: head/sys/boot/i386/libi386/biosdisk.c ============================================================================== --- head/sys/boot/i386/libi386/biosdisk.c Fri Sep 17 22:51:45 2010 (r212804) +++ head/sys/boot/i386/libi386/biosdisk.c Fri Sep 17 22:59:15 2010 (r212805) @@ -214,10 +214,12 @@ bd_init(void) /* sequence 0, 0x80 */ for (base = 0; base <= 0x80; base += 0x80) { for (unit = base; (nbdinfo < MAXBDDEV); unit++) { +#ifndef VIRTUALBOX /* check the BIOS equipment list for number of fixed disks */ if((base == 0x80) && (nfd >= *(unsigned char *)PTOV(BIOS_NUMDRIVES))) - break; + break; +#endif bdinfo[nbdinfo].bd_unit = unit; bdinfo[nbdinfo].bd_flags = (unit < 0x80) ? BD_FLOPPY : 0; Modified: head/sys/boot/i386/zfsboot/zfsboot.c ============================================================================== --- head/sys/boot/i386/zfsboot/zfsboot.c Fri Sep 17 22:51:45 2010 (r212804) +++ head/sys/boot/i386/zfsboot/zfsboot.c Fri Sep 17 22:59:15 2010 (r212805) @@ -94,7 +94,7 @@ __FBSDID("$FreeBSD$"); #define V86_CY(x) ((x) & 1) #define V86_ZR(x) ((x) & 0x40) -#define BIOS_NUMDRIVES 0x475 +#define BIOS_NUMDRIVES 0x475 #define DRV_HARD 0x80 #define DRV_MASK 0x7f @@ -667,7 +667,12 @@ main(void) * will find any other available pools and it may fill in missing * vdevs for the boot pool. */ - for (i = 0; i < *(unsigned char *)PTOV(BIOS_NUMDRIVES); i++) { +#ifndef VIRTUALBOX + for (i = 0; i < *(unsigned char *)PTOV(BIOS_NUMDRIVES); i++) +#else + for (i = 0; i < MAXBDDEV; i++) +#endif + { if ((i | DRV_HARD) == *(uint8_t *)PTOV(ARGS)) continue; From owner-svn-src-head@FreeBSD.ORG Fri Sep 17 23:09:31 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A3CCF1065672; Fri, 17 Sep 2010 23:09:31 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 930158FC17; Fri, 17 Sep 2010 23:09:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8HN9V4a044747; Fri, 17 Sep 2010 23:09:31 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8HN9VLC044745; Fri, 17 Sep 2010 23:09:31 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201009172309.o8HN9VLC044745@svn.freebsd.org> From: Jung-uk Kim Date: Fri, 17 Sep 2010 23:09:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212806 - head/sys/dev/syscons X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2010 23:09:31 -0000 Author: jkim Date: Fri Sep 17 23:09:31 2010 New Revision: 212806 URL: http://svn.freebsd.org/changeset/base/212806 Log: Rework r210248. Although it fixed most of problems, it did not fix one particular edge case where X-axis resolution is not multiple of font width. Now we just advance enough scan lines, then deduct a partial scan line. It is more intuitive than the previous code. Apply the same wisdom to EGA and VGA planar renderers for consistency. Reported by: David DEMELIER (demelier dot david at gmail dot com) Modified: head/sys/dev/syscons/scvgarndr.c Modified: head/sys/dev/syscons/scvgarndr.c ============================================================================== --- head/sys/dev/syscons/scvgarndr.c Fri Sep 17 22:59:15 2010 (r212805) +++ head/sys/dev/syscons/scvgarndr.c Fri Sep 17 23:09:31 2010 (r212806) @@ -716,8 +716,7 @@ vga_egadraw(scr_stat *scp, int from, int } ++d; if ((i % scp->xsize) == scp->xsize - 1) - d += scp->xoff*2 - + (scp->font_size - 1)*line_width; + d += scp->font_size * line_width - scp->xsize; } outw(GDCIDX, 0x0000); /* set/reset */ outw(GDCIDX, 0x0001); /* set/reset enable */ @@ -769,9 +768,8 @@ vga_vgadraw_direct(scr_stat *scp, int fr d += 8 * pixel_size; if ((i % scp->xsize) == scp->xsize - 1) - d += scp->xoff * scp->font_size * pixel_size + - scp->font_size * line_width - - scp->xpixel * pixel_size; + d += scp->font_size * line_width - + scp->xsize * 8 * pixel_size; } } @@ -827,8 +825,7 @@ vga_vgadraw_planar(scr_stat *scp, int fr } ++d; if ((i % scp->xsize) == scp->xsize - 1) - d += scp->xoff*2 - + (scp->font_size - 1)*line_width; + d += scp->font_size * line_width - scp->xsize; } outw(GDCIDX, 0x0005); /* read mode 0, write mode 0 */ outw(GDCIDX, 0x0000); /* set/reset */ From owner-svn-src-head@FreeBSD.ORG Sat Sep 18 00:58:44 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C1DE106566C; Sat, 18 Sep 2010 00:58:44 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7B4B08FC17; Sat, 18 Sep 2010 00:58:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8I0wiXh047327; Sat, 18 Sep 2010 00:58:44 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8I0wiNE047325; Sat, 18 Sep 2010 00:58:44 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201009180058.o8I0wiNE047325@svn.freebsd.org> From: Juli Mallett Date: Sat, 18 Sep 2010 00:58:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212809 - head/sys/mips/cavium/usb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Sep 2010 00:58:44 -0000 Author: jmallett Date: Sat Sep 18 00:58:44 2010 New Revision: 212809 URL: http://svn.freebsd.org/changeset/base/212809 Log: Fix octusb build. Modified: head/sys/mips/cavium/usb/octusb.c Modified: head/sys/mips/cavium/usb/octusb.c ============================================================================== --- head/sys/mips/cavium/usb/octusb.c Sat Sep 18 00:46:05 2010 (r212808) +++ head/sys/mips/cavium/usb/octusb.c Sat Sep 18 00:58:44 2010 (r212809) @@ -1885,7 +1885,7 @@ octusb_xfer_unsetup(struct usb_xfer *xfe } static void -octusb_get_dma_delay(struct usb_bus *bus, uint32_t *pus) +octusb_get_dma_delay(struct usb_device *udev, uint32_t *pus) { /* DMA delay - wait until any use of memory is finished */ *pus = (2125); /* microseconds */ From owner-svn-src-head@FreeBSD.ORG Sat Sep 18 07:18:31 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 055231065672; Sat, 18 Sep 2010 07:18:31 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E91F88FC08; Sat, 18 Sep 2010 07:18:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8I7IUSZ055574; Sat, 18 Sep 2010 07:18:30 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8I7IUlt055572; Sat, 18 Sep 2010 07:18:30 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201009180718.o8I7IUlt055572@svn.freebsd.org> From: Alexander Motin Date: Sat, 18 Sep 2010 07:18:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212811 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Sep 2010 07:18:31 -0000 Author: mav Date: Sat Sep 18 07:18:30 2010 New Revision: 212811 URL: http://svn.freebsd.org/changeset/base/212811 Log: When global timer used at SMP system, update nextevent field on BSP before sending IPI to other CPUs. Otherwise, other CPUs will try to honor stale value, programming timer for zero interval. If timer is fast enough, it caused extra interrupt before timer correctly reprogrammed by BSP. Modified: head/sys/kern/kern_clocksource.c Modified: head/sys/kern/kern_clocksource.c ============================================================================== --- head/sys/kern/kern_clocksource.c Sat Sep 18 07:16:38 2010 (r212810) +++ head/sys/kern/kern_clocksource.c Sat Sep 18 07:18:30 2010 (r212811) @@ -335,15 +335,15 @@ timercb(struct eventtimer *et, void *arg bcast = 0; if ((et->et_flags & ET_FLAGS_PERCPU) == 0 && smp_started) { CPU_FOREACH(cpu) { - if (curcpu == cpu) - continue; state = DPCPU_ID_PTR(cpu, timerstate); ET_HW_LOCK(state); state->now = now; if (bintime_cmp(&now, &state->nextevent, >=)) { state->nextevent.sec++; - state->ipi = 1; - bcast = 1; + if (curcpu != cpu) { + state->ipi = 1; + bcast = 1; + } } ET_HW_UNLOCK(state); } From owner-svn-src-head@FreeBSD.ORG Sat Sep 18 07:36:43 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CB9061065673; Sat, 18 Sep 2010 07:36:43 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A0AFD8FC18; Sat, 18 Sep 2010 07:36:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8I7ahMN056057; Sat, 18 Sep 2010 07:36:43 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8I7ahMB056054; Sat, 18 Sep 2010 07:36:43 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201009180736.o8I7ahMB056054@svn.freebsd.org> From: Alexander Motin Date: Sat, 18 Sep 2010 07:36:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212812 - head/sys/x86/isa X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Sep 2010 07:36:43 -0000 Author: mav Date: Sat Sep 18 07:36:43 2010 New Revision: 212812 URL: http://svn.freebsd.org/changeset/base/212812 Log: Restore pre-r212778 optimization, skipping timer reprogramming when it is not neccessary. It allows to avoid time counter jump of up to 1/18s, when base frequency slightly tuned via machdep.i8254_freq sysctl. Fix few style things. Suggested by: bde Modified: head/sys/x86/isa/clock.c Modified: head/sys/x86/isa/clock.c ============================================================================== --- head/sys/x86/isa/clock.c Sat Sep 18 07:18:30 2010 (r212811) +++ head/sys/x86/isa/clock.c Sat Sep 18 07:36:43 2010 (r212812) @@ -124,6 +124,8 @@ struct attimer_softc { }; static struct attimer_softc *attimer_sc = NULL; +static int timer0_period = -2; + /* Values for timerX_state: */ #define RELEASED 0 #define RELEASE_PENDING 1 @@ -367,36 +369,41 @@ DELAY(int n) static void set_i8254_freq(int mode, uint32_t period) { - int val; + int new_count; mtx_lock_spin(&clock_lock); - if (period == 0) - val = 0x10000; - else - val = min(((uint64_t)i8254_freq * period) >> 32, 0x10000); - if (val == 0x10000) - i8254_max_count = 0xffff; - else - i8254_max_count = val; - if (mode == MODE_STOP && i8254_timecounter) - mode = MODE_PERIODIC; + if (mode == MODE_STOP) { + if (i8254_timecounter) { + mode = MODE_PERIODIC; + new_count = 0x10000; + } else + new_count = -1; + } else { + new_count = min(((uint64_t)i8254_freq * period + + 0x80000000LLU) >> 32, 0x10000); + } + if (new_count == timer0_period) + goto out; + i8254_max_count = ((new_count & ~0xffff) != 0) ? 0xffff : new_count; + timer0_period = (mode == MODE_PERIODIC) ? new_count : -1; switch (mode) { case MODE_STOP: outb(TIMER_MODE, TIMER_SEL0 | TIMER_INTTC | TIMER_16BIT); - outb(TIMER_CNTR0, 0xff); - outb(TIMER_CNTR0, 0xff); + outb(TIMER_CNTR0, 0); + outb(TIMER_CNTR0, 0); break; case MODE_PERIODIC: outb(TIMER_MODE, TIMER_SEL0 | TIMER_RATEGEN | TIMER_16BIT); - outb(TIMER_CNTR0, val & 0xff); - outb(TIMER_CNTR0, val >> 8); + outb(TIMER_CNTR0, new_count & 0xff); + outb(TIMER_CNTR0, new_count >> 8); break; case MODE_ONESHOT: outb(TIMER_MODE, TIMER_SEL0 | TIMER_INTTC | TIMER_16BIT); - outb(TIMER_CNTR0, val & 0xff); - outb(TIMER_CNTR0, val >> 8); + outb(TIMER_CNTR0, new_count & 0xff); + outb(TIMER_CNTR0, new_count >> 8); break; } +out: mtx_unlock_spin(&clock_lock); } @@ -404,7 +411,8 @@ static void i8254_restore(void) { - if (attimer_sc) + timer0_period = -2; + if (attimer_sc != NULL) set_i8254_freq(attimer_sc->mode, attimer_sc->period); else set_i8254_freq(0, 0); @@ -473,7 +481,7 @@ sysctl_machdep_i8254_freq(SYSCTL_HANDLER error = sysctl_handle_int(oidp, &freq, 0, req); if (error == 0 && req->newptr != NULL) { i8254_freq = freq; - if (attimer_sc) { + if (attimer_sc != NULL) { set_i8254_freq(attimer_sc->mode, attimer_sc->period); attimer_sc->tc.tc_frequency = freq; } else { From owner-svn-src-head@FreeBSD.ORG Sat Sep 18 07:45:54 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E7D28106566C; Sat, 18 Sep 2010 07:45:54 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D77798FC0A; Sat, 18 Sep 2010 07:45:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8I7jsiI056328; Sat, 18 Sep 2010 07:45:54 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8I7js3J056326; Sat, 18 Sep 2010 07:45:54 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201009180745.o8I7js3J056326@svn.freebsd.org> From: Alexander Motin Date: Sat, 18 Sep 2010 07:45:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212813 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Sep 2010 07:45:55 -0000 Author: mav Date: Sat Sep 18 07:45:54 2010 New Revision: 212813 URL: http://svn.freebsd.org/changeset/base/212813 Log: Document hw.i8254.freq tunable and machdep.i8254_freq sysctl. Modified: head/share/man/man4/attimer.4 Modified: head/share/man/man4/attimer.4 ============================================================================== --- head/share/man/man4/attimer.4 Sat Sep 18 07:36:43 2010 (r212812) +++ head/share/man/man4/attimer.4 Sat Sep 18 07:45:54 2010 (r212813) @@ -42,6 +42,11 @@ Default value is 1. .It Va hint.attimer. Ns Ar X Ns Va .timecounter controls time counter functionality support. Setting to 0, disables it. Default value is 1. +.It Va hw.i8254.freq +allows to override default counter frequency. +The same value is also available in run-time via +.Va machdep.i8254_freq +sysctl. .El .Sh DESCRIPTION This driver uses i8254 Programmable Interval Timer (AT Timer) hardware From owner-svn-src-head@FreeBSD.ORG Sat Sep 18 11:01:17 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BD3D31065675; Sat, 18 Sep 2010 11:01:17 +0000 (UTC) (envelope-from Daan@vehosting.nl) Received: from VM01.VEHosting.nl (vm01.vehosting.nl [85.17.51.140]) by mx1.freebsd.org (Postfix) with ESMTP id 6E1208FC20; Sat, 18 Sep 2010 11:01:17 +0000 (UTC) Received: from [192.168.45.11] (180-161.ftth.onsbrabantnet.nl [88.159.161.180]) (authenticated bits=0) by VM01.VEHosting.nl (8.14.3/8.13.8) with ESMTP id o8IAYKtN061136; Sat, 18 Sep 2010 12:34:20 +0200 (CEST) (envelope-from Daan@vehosting.nl) From: Daan Vreeken Organization: VEHosting.nl To: Alexander Motin Date: Sat, 18 Sep 2010 12:34:17 +0200 User-Agent: KMail/1.9.10 References: <201009130725.o8D7PZX8073399@svn.freebsd.org> In-Reply-To: <201009130725.o8D7PZX8073399@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <201009181234.17851.Daan@vehosting.nl> x-ve-auth-version: mi-1.0.3 2008-05-30 - Copyright (c) 2008 - Daan Vreeken - VEHosting x-ve-auth: authenticated as 'pa4dan' on VM01.VEHosting.nl Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r212541 - in head/sys: amd64/amd64 amd64/include dev/acpica i386/i386 i386/include kern mips/include mips/mips pc98/pc98 powerpc/aim powerpc/booke powerpc/include powerpc/powerpc sparc6... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Sep 2010 11:01:17 -0000 Hi Alexander, On Monday 13 September 2010 09:25:35 Alexander Motin wrote: > Author: mav > Date: Mon Sep 13 07:25:35 2010 > New Revision: 212541 > URL: http://svn.freebsd.org/changeset/base/212541 > > Log: > Refactor timer management code with priority to one-shot operation mode. > The main goal of this is to generate timer interrupts only when there is > some work to do. When CPU is busy interrupts are generating at full rate > of hz + stathz to fullfill scheduler and timekeeping requirements. But > when CPU is idle, only minimum set of interrupts (down to 8 interrupts > per second per CPU now), needed to handle scheduled callouts is executed. > This allows significantly increase idle CPU sleep time, increasing effect > of static power-saving technologies. Also it should reduce host CPU load on > virtualized systems, when guest system is idle. [snip] When re-basing an ARM system running an older -current with local patches/additions to a more recent version of -current (around 2010-09-16-ish) I found out that the resulting kernel stopped booting. To factor out our local changes I've tried to boot a 'SHEEVAPLUG' kernel without modifications. This kernel also fails to boot. It just stops right after : ... ehci0: mem 0xf1050000-0xf1050fff irq 48,19 on simplebus0 ehci0: [FILTER] ehci0: [ITHREAD] usbus0: EHCI version 1.0 usbus0: set host controller mode usbus0: on ehci0 Timecounters tick every 1.000 msec usbus0: 480Mbps High Speed USB v2.0 Doing a binary search I've found that a kernel built from sources directly before your commit boots normally, but with this commit the board hangs during boot. The debugger is accessible when the system 'hangs'. 'ps' shows: KDB: enter: Line break on console [ thread pid 10 tid 100002 ] Stopped at kdb_enter+0x48: ldrb r15, [r15, r15, ror r15]! db> ps pid ppid pgrp uid state wmesg wchan cmd 5 0 0 0 DL ccb_scan 0xc0bc49ec [xpt_thrd] 13 0 0 0 DL (threaded) [usb] 100023 D - 0xc3500d0c [usbus0] 100022 D USBWAIT 0xc0bca57c [usbus0] 100021 D - 0xc3500cac [usbus0] 100020 D - 0xc3500c7c [usbus0] 12 0 0 0 DL - 0xc0bca57c [yarrow] 4 0 0 0 DL - 0xc0bc7d38 [g_down] 3 0 0 0 DL - 0xc0bc7d34 [g_up] 2 0 0 0 DL - 0xc0bc7d2c [g_event] 11 0 0 0 WL (threaded) [intr] 100019 I [intr19: ehci0] 100018 I [swi0: uart uart] 100017 I [intr13: mge0] 100016 I [intr12: mge0] 100015 I [swi6: Giant taskq] 100013 I [swi5: +] 100011 I [swi2: cambio] 100010 I [swi6: task queue] 100005 I [swi3: vm] 100004 I [swi1: netisr 0] 100003 I [swi4: clock] 10 0 0 0 RL CPU 0 [idle] 1 0 0 0 ?L [kernel] 0 0 0 0 DLs (threaded) [kernel] 100014 D - 0xc343be80 [thread taskq] 100012 D - 0xc343d080 [kqueue taskq] 100000 D conifhk 0xc0bb3d5c [swapper] After fiddling around a bit with the debugger, I found out that calling cpu_idleclock() followed by cpu_activeclock() manually from the debugger will 'un-freeze' the system and get it to continue booting. For a full dmesg and the logs of the debugging session see : http://vehosting.nl/pub_diffs/dmesg-arm-2010-09-18-timer-code.txt Can you perhaps tell me what's going wrong after this commit? (If you need more info, I'd be happy to provide it where I can.) Regards, -- Daan Vreeken VEHosting http://VEHosting.nl tel: +31-(0)40-7113050 / +31-(0)6-46210825 KvK nr: 17174380 From owner-svn-src-head@FreeBSD.ORG Sat Sep 18 11:16:43 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 86785106566B; Sat, 18 Sep 2010 11:16:43 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 760E28FC15; Sat, 18 Sep 2010 11:16:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8IBGhwL063937; Sat, 18 Sep 2010 11:16:43 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8IBGhJV063935; Sat, 18 Sep 2010 11:16:43 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201009181116.o8IBGhJV063935@svn.freebsd.org> From: Andriy Gapon Date: Sat, 18 Sep 2010 11:16:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212821 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Sep 2010 11:16:43 -0000 Author: avg Date: Sat Sep 18 11:16:43 2010 New Revision: 212821 URL: http://svn.freebsd.org/changeset/base/212821 Log: kern.sched.topology_spec sysctl: use step of 1 for group levels numeration This is just a cosmetic change for prettier output. 'indent' variable/parameter serves two purposes: it specifies whitespace indentation level and also implies cpu group level/depth. It would have been better to split those two uses, but for now just a simple change. MFC after: 1 week Modified: head/sys/kern/sched_ule.c Modified: head/sys/kern/sched_ule.c ============================================================================== --- head/sys/kern/sched_ule.c Sat Sep 18 08:45:43 2010 (r212820) +++ head/sys/kern/sched_ule.c Sat Sep 18 11:16:43 2010 (r212821) @@ -2648,7 +2648,7 @@ sysctl_kern_sched_topology_spec_internal int i, first; sbuf_printf(sb, "%*s\n", indent, - "", indent, cg->cg_level); + "", 1 + indent / 2, cg->cg_level); sbuf_printf(sb, "%*s ", indent, "", cg->cg_count, cg->cg_mask); first = TRUE; From owner-svn-src-head@FreeBSD.ORG Sat Sep 18 11:18:42 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9FE6C1065673; Sat, 18 Sep 2010 11:18:42 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 74DD08FC19; Sat, 18 Sep 2010 11:18:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8IBIg8W064014; Sat, 18 Sep 2010 11:18:42 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8IBIgRg064011; Sat, 18 Sep 2010 11:18:42 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201009181118.o8IBIgRg064011@svn.freebsd.org> From: Robert Watson Date: Sat, 18 Sep 2010 11:18:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212822 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Sep 2010 11:18:42 -0000 Author: rwatson Date: Sat Sep 18 11:18:42 2010 New Revision: 212822 URL: http://svn.freebsd.org/changeset/base/212822 Log: With reworking of the socket life cycle in 7.x, the need for a "sotryfree()" was eliminated: all references to sockets are explicitly managed by sorele() and the protocols. As such, garbage collect sotryfree(), and update sofree() comments to make the new world order more clear. MFC after: 3 days Reported by: Anuranjan Shukla Modified: head/sys/kern/uipc_socket.c head/sys/sys/socketvar.h Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Sat Sep 18 11:16:43 2010 (r212821) +++ head/sys/kern/uipc_socket.c Sat Sep 18 11:18:42 2010 (r212822) @@ -559,9 +559,12 @@ solisten_proto(struct socket *so, int ba } /* - * Attempt to free a socket. This should really be sotryfree(). + * Evaluate the reference count and named references on a socket; if no + * references remain, free it. This should be called whenever a reference is + * released, such as in sorele(), but also when named reference flags are + * cleared in socket or protocol code. * - * sofree() will succeed if: + * sofree() will free the socket if: * * - There are no outstanding file descriptor references or related consumers * (so_count == 0). @@ -574,9 +577,6 @@ solisten_proto(struct socket *so, int ba * - The socket is not in a completed connection queue, so a process has been * notified that it is present. If it is removed, the user process may * block in accept() despite select() saying the socket was ready. - * - * Otherwise, it will quietly abort so that a future call to sofree(), when - * conditions are right, can succeed. */ void sofree(struct socket *so) Modified: head/sys/sys/socketvar.h ============================================================================== --- head/sys/sys/socketvar.h Sat Sep 18 11:16:43 2010 (r212821) +++ head/sys/sys/socketvar.h Sat Sep 18 11:18:42 2010 (r212822) @@ -234,17 +234,6 @@ struct xsocket { } \ } while (0) -#define sotryfree(so) do { \ - ACCEPT_LOCK_ASSERT(); \ - SOCK_LOCK_ASSERT(so); \ - if ((so)->so_count == 0) \ - sofree(so); \ - else { \ - SOCK_UNLOCK(so); \ - ACCEPT_UNLOCK(); \ - } \ -} while(0) - /* * In sorwakeup() and sowwakeup(), acquire the socket buffer lock to * avoid a non-atomic test-and-wakeup. However, sowakeup is From owner-svn-src-head@FreeBSD.ORG Sat Sep 18 11:35:08 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C29FE106567A; Sat, 18 Sep 2010 11:35:08 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.cksoft.de (mail.cksoft.de [IPv6:2001:4068:10::3]) by mx1.freebsd.org (Postfix) with ESMTP id 380718FC20; Sat, 18 Sep 2010 11:35:08 +0000 (UTC) Received: from localhost (amavis.fra.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id 9653341C752; Sat, 18 Sep 2010 13:35:06 +0200 (CEST) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([192.168.74.103]) by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id hR-kTW6TcyNu; Sat, 18 Sep 2010 13:35:05 +0200 (CEST) Received: by mail.cksoft.de (Postfix, from userid 66) id C571841C750; Sat, 18 Sep 2010 13:35:05 +0200 (CEST) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id 564064448FA; Sat, 18 Sep 2010 11:34:30 +0000 (UTC) Date: Sat, 18 Sep 2010 11:34:30 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: Andre Oppermann In-Reply-To: <201009172205.o8HM5RPG043265@svn.freebsd.org> Message-ID: <20100918113224.J31898@maildrop.int.zabbadoz.net> References: <201009172205.o8HM5RPG043265@svn.freebsd.org> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r212803 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Sep 2010 11:35:09 -0000 On Fri, 17 Sep 2010, Andre Oppermann wrote: Hey, > Author: andre > Date: Fri Sep 17 22:05:27 2010 > New Revision: 212803 > URL: http://svn.freebsd.org/changeset/base/212803 > > Log: > Rearrange the TSO code to make it more readable and to clearly > separate the decision logic, of whether we can do TSO, and the > calculation of the burst length into two distinct parts. > > Change the way the TSO burst length calculation is done. While > TSO could do bursts of 65535 bytes that can't be represented in > ip_len together with the IP and TCP header. Account for that and > use IP_MAXPACKET instead of TCP_MAXWIN as base constant (both > have the same value of 64K). When more data is available prevent > less than MSS sized segments from being sent during the current > TSO burst. > > Add two more KASSERTs to ensure the integrity of the packets. > > Tested by: Ben Wilber > MFC after: 10 days > > Modified: > head/sys/netinet/tcp_output.c > > Modified: head/sys/netinet/tcp_output.c > ============================================================================== > --- head/sys/netinet/tcp_output.c Fri Sep 17 21:53:56 2010 (r212802) > +++ head/sys/netinet/tcp_output.c Fri Sep 17 22:05:27 2010 (r212803) > @@ -465,9 +465,8 @@ after_sack_rexmit: > } > > /* > - * Truncate to the maximum segment length or enable TCP Segmentation > - * Offloading (if supported by hardware) and ensure that FIN is removed > - * if the length no longer contains the last data byte. > + * Decide if we can use TCP Segmentation Offloading (if supported by > + * hardware). > * > * TSO may only be used if we are in a pure bulk sending state. The > * presence of TCP-MD5, SACK retransmits, SACK advertizements and > @@ -475,10 +474,6 @@ after_sack_rexmit: > * (except for the sequence number) for all generated packets. This > * makes it impossible to transmit any options which vary per generated > * segment or packet. > - * > - * The length of TSO bursts is limited to TCP_MAXWIN. That limit and > - * removal of FIN (if not already catched here) are handled later after > - * the exact length of the TCP options are known. > */ > #ifdef IPSEC > /* > @@ -487,22 +482,15 @@ after_sack_rexmit: > */ > ipsec_optlen = ipsec_hdrsiz_tcp(tp); > #endif > - if (len > tp->t_maxseg) { > - if ((tp->t_flags & TF_TSO) && V_tcp_do_tso && > - ((tp->t_flags & TF_SIGNATURE) == 0) && > - tp->rcv_numsacks == 0 && sack_rxmit == 0 && > - tp->t_inpcb->inp_options == NULL && > - tp->t_inpcb->in6p_options == NULL > + if ((tp->t_flags & TF_TSO) && V_tcp_do_tso && len > tp->t_maxseg && > + ((tp->t_flags & TF_SIGNATURE) == 0) && > + tp->rcv_numsacks == 0 && sack_rxmit == 0 && > #ifdef IPSEC > - && ipsec_optlen == 0 > + ipsec_optlen == 0 && > #endif > - ) { > - tso = 1; > - } else { > - len = tp->t_maxseg; > - sendalot = 1; > - } > - } > + tp->t_inpcb->inp_options == NULL && > + tp->t_inpcb->in6p_options == NULL) > + tso = 1; In the non-TSO case you are no longer reducing len to tp->t_maxseg here, if it's larger, which I think breaks asssumptions all the way down. > if (sack_rxmit) { > if (SEQ_LT(p->rxmit + len, tp->snd_una + so->so_snd.sb_cc)) > @@ -732,28 +720,53 @@ send: > * bump the packet length beyond the t_maxopd length. > * Clear the FIN bit because we cut off the tail of > * the segment. > - * > - * When doing TSO limit a burst to TCP_MAXWIN minus the > - * IP, TCP and Options length to keep ip->ip_len from > - * overflowing. Prevent the last segment from being > - * fractional thus making them all equal sized and set > - * the flag to continue sending. TSO is disabled when > - * IP options or IPSEC are present. > */ > if (len + optlen + ipoptlen > tp->t_maxopd) { > flags &= ~TH_FIN; > + > if (tso) { > - if (len > TCP_MAXWIN - hdrlen - optlen) { > - len = TCP_MAXWIN - hdrlen - optlen; > - len = len - (len % (tp->t_maxopd - optlen)); > + KASSERT(ipoptlen == 0, > + ("%s: TSO can't do IP options", __func__)); > + > + /* > + * Limit a burst to IP_MAXPACKET minus IP, > + * TCP and options length to keep ip->ip_len > + * from overflowing. > + */ > + if (len > IP_MAXPACKET - hdrlen) { > + len = IP_MAXPACKET - hdrlen; > + sendalot = 1; > + } > + > + /* > + * Prevent the last segment from being > + * fractional unless the send sockbuf can > + * be emptied. > + */ > + if (sendalot && off + len < so->so_snd.sb_cc) { > + len -= len % (tp->t_maxopd - optlen); > sendalot = 1; > - } else if (tp->t_flags & TF_NEEDFIN) > + } > + > + /* > + * Send the FIN in a separate segment > + * after the bulk sending is done. > + * We don't trust the TSO implementations > + * to clear the FIN flag on all but the > + * last segment. > + */ > + if (tp->t_flags & TF_NEEDFIN) > sendalot = 1; > + > } else { > len = tp->t_maxopd - optlen - ipoptlen; > sendalot = 1; > } > - } > + } else > + tso = 0; > + > + KASSERT(len + hdrlen + ipoptlen <= IP_MAXPACKET, > + ("%s: len > IP_MAXPACKET", __func__)); > > /*#ifdef DIAGNOSTIC*/ > #ifdef INET6 > @@ -1068,6 +1081,9 @@ send: > m->m_pkthdr.tso_segsz = tp->t_maxopd - optlen; > } > > + KASSERT(len + hdrlen + ipoptlen == m_length(m, NULL), > + ("%s: mbuf chain shorter than expected", __func__)); > + > /* > * In transmit state, time the transmission and arrange for > * the retransmit. In persist state, just set snd_max. > -- Bjoern A. Zeeb Welcome a new stage of life. From owner-svn-src-head@FreeBSD.ORG Sat Sep 18 11:45:10 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5A7CB106566B; Sat, 18 Sep 2010 11:45:10 +0000 (UTC) (envelope-from stefan@fafoe.narf.at) Received: from fep23.mx.upcmail.net (fep23.mx.upcmail.net [62.179.121.43]) by mx1.freebsd.org (Postfix) with ESMTP id BB3848FC1B; Sat, 18 Sep 2010 11:45:08 +0000 (UTC) Received: from edge04.upcmail.net ([192.168.13.239]) by viefep11-int.chello.at (InterMail vM.8.01.02.02 201-2260-120-106-20100312) with ESMTP id <20100918112343.SVJM4509.viefep11-int.chello.at@edge04.upcmail.net>; Sat, 18 Sep 2010 13:23:43 +0200 Received: from mole.fafoe.narf.at ([213.47.85.26]) by edge04.upcmail.net with edge id 8BPh1f05M0a5KZh04BPi6A; Sat, 18 Sep 2010 13:23:43 +0200 X-SourceIP: 213.47.85.26 Received: by mole.fafoe.narf.at (Postfix, from userid 1001) id A02896D439; Sat, 18 Sep 2010 13:23:41 +0200 (CEST) Date: Sat, 18 Sep 2010 13:23:41 +0200 From: Stefan Farfeleder To: Pawel Jakub Dawidek Message-ID: <20100918112341.GA1733@mole.fafoe.narf.at> References: <201009172251.o8HMpjZJ044307@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201009172251.o8HMpjZJ044307@svn.freebsd.org> User-Agent: Mutt/1.5.20 (2009-06-14) X-Cloudmark-Analysis: v=1.1 cv=ZDt3ILgE3VX9xkJc7+9REBIC4hFTL6V7NAq0V56QRNQ= c=1 sm=0 a=h7MPh2D0RE8A:10 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=15cyhmPGUgWBd1Axkl0A:9 a=1g8AJalCpwuiQ2vk4RMA:7 a=DppC85V-0hkMsPaI1HWbjYsOHS8A:4 a=CjuIK1q_8ugA:10 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r212804 - head/sys/boot/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Sep 2010 11:45:10 -0000 Um, was the change from 32 to 31 deliberate? On Fri, Sep 17, 2010 at 10:51:45PM +0000, Pawel Jakub Dawidek wrote: > Author: pjd > Date: Fri Sep 17 22:51:45 2010 > New Revision: 212804 > URL: http://svn.freebsd.org/changeset/base/212804 > > Log: > Remove magic value. > > Modified: > head/sys/boot/zfs/zfs.c > > Modified: head/sys/boot/zfs/zfs.c > ============================================================================== > --- head/sys/boot/zfs/zfs.c Fri Sep 17 22:05:27 2010 (r212803) > +++ head/sys/boot/zfs/zfs.c Fri Sep 17 22:51:45 2010 (r212804) > @@ -45,6 +45,8 @@ __FBSDID("$FreeBSD$"); > > #include "zfsimpl.c" > > +#define MAXBDDEV 31 > + > static int zfs_open(const char *path, struct open_file *f); > static int zfs_write(struct open_file *f, void *buf, size_t size, size_t *resid); > static int zfs_close(struct open_file *f); > @@ -402,7 +404,7 @@ zfs_dev_init(void) > * diskN, diskNpM or diskNsM. > */ > zfs_init(); > - for (unit = 0; unit < 32 /* XXX */; unit++) { > + for (unit = 0; unit < MAXBDDEV; unit++) { > sprintf(devname, "disk%d:", unit); > fd = open(devname, O_RDONLY); > if (fd == -1) > From owner-svn-src-head@FreeBSD.ORG Sat Sep 18 12:08:34 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3269A1065670; Sat, 18 Sep 2010 12:08:34 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id C93108FC17; Sat, 18 Sep 2010 12:08:33 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 3F32845E9C; Sat, 18 Sep 2010 14:08:32 +0200 (CEST) Received: from localhost (chello089077043238.chello.pl [89.77.43.238]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 45ECD45E87; Sat, 18 Sep 2010 14:08:27 +0200 (CEST) Date: Sat, 18 Sep 2010 14:08:09 +0200 From: Pawel Jakub Dawidek To: Stefan Farfeleder Message-ID: <20100918120809.GG1902@garage.freebsd.pl> References: <201009172251.o8HMpjZJ044307@svn.freebsd.org> <20100918112341.GA1733@mole.fafoe.narf.at> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="TdkiTnkLhLQllcMS" Content-Disposition: inline In-Reply-To: <20100918112341.GA1733@mole.fafoe.narf.at> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 9.0-CURRENT amd64 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-0.6 required=4.5 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.4 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r212804 - head/sys/boot/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Sep 2010 12:08:34 -0000 --TdkiTnkLhLQllcMS Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Sep 18, 2010 at 01:23:41PM +0200, Stefan Farfeleder wrote: > Um, was the change from 32 to 31 deliberate? Yes. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --TdkiTnkLhLQllcMS Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkyUq6kACgkQForvXbEpPzSZ5gCgx8Jp7h8PhJ0fVSbG33i9norX MuYAoId8vvJJIFzcn8Xm6C5mlaRrTStn =qNPA -----END PGP SIGNATURE----- --TdkiTnkLhLQllcMS-- From owner-svn-src-head@FreeBSD.ORG Sat Sep 18 13:44:39 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E0BAD106566B; Sat, 18 Sep 2010 13:44:39 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D03D58FC1F; Sat, 18 Sep 2010 13:44:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8IDidvm067237; Sat, 18 Sep 2010 13:44:39 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8IDidNS067235; Sat, 18 Sep 2010 13:44:39 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201009181344.o8IDidNS067235@svn.freebsd.org> From: Alexander Motin Date: Sat, 18 Sep 2010 13:44:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212823 - head/sys/arm/mv X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Sep 2010 13:44:40 -0000 Author: mav Date: Sat Sep 18 13:44:39 2010 New Revision: 212823 URL: http://svn.freebsd.org/changeset/base/212823 Log: Clear timer interrupt status before calling callback, not after it, This fixes timer interrupt losses, fatal in one-shot mode. Modified: head/sys/arm/mv/timer.c Modified: head/sys/arm/mv/timer.c ============================================================================== --- head/sys/arm/mv/timer.c Sat Sep 18 11:18:42 2010 (r212822) +++ head/sys/arm/mv/timer.c Sat Sep 18 13:44:39 2010 (r212823) @@ -178,14 +178,14 @@ mv_hardclock(void *arg) struct mv_timer_softc *sc; uint32_t irq_cause; - sc = (struct mv_timer_softc *)arg; - if (sc->et.et_active) - sc->et.et_event_cb(&sc->et, sc->et.et_arg); - irq_cause = read_cpu_ctrl(BRIDGE_IRQ_CAUSE); irq_cause &= ~(IRQ_TIMER0); write_cpu_ctrl(BRIDGE_IRQ_CAUSE, irq_cause); + sc = (struct mv_timer_softc *)arg; + if (sc->et.et_active) + sc->et.et_event_cb(&sc->et, sc->et.et_arg); + return (FILTER_HANDLED); } @@ -394,6 +394,8 @@ mv_timer_start(struct eventtimer *et, val |= CPU_TIMER0_EN; if (period != NULL) val |= CPU_TIMER0_AUTO; + else + val &= ~CPU_TIMER0_AUTO; mv_set_timer_control(val); return (0); } From owner-svn-src-head@FreeBSD.ORG Sat Sep 18 13:48:19 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3B81F1065695; Sat, 18 Sep 2010 13:48:19 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 55A318FC1B; Sat, 18 Sep 2010 13:48:18 +0000 (UTC) Received: by bwz15 with SMTP id 15so4408001bwz.13 for ; Sat, 18 Sep 2010 06:48:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:content-type:content-transfer-encoding; bh=fCegHOiQmuvLh8aBikZ81yMzWf83vIsEnogt9V3fceg=; b=QNlq1NCt2PHLhvWEN7JAZBvetfLJZ8g/fSJGCwzhzRV7eKGN/pFXgxJDbAD6vE8kJc 6Ks9lYLs1FuG7GzC58m4+h8KXnBWyAcQtsJKM4R0uUq8uPqMWUwU+OpKMjKXHMFvx9F9 qPCgOSx9B9gWxksIyaT/Zw55i+/GLXMD713eg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=N/gWSJkx21g+bXY+zvltET6kWOnwL3pR+B/69Ll4QPo2mBU9v86Zkb+FZfexEdwdeA 5QrLH4023mkMJzsSVZPPHKV2IVgY8ZLOUi03i8G+4WbWVDG4YXYr2liTj1HTHoDBtbeQ QJHksfVl+tulfsSFHYinITtIbI9SpSmZXsXjU= Received: by 10.204.123.137 with SMTP id p9mr4693999bkr.206.1284817697295; Sat, 18 Sep 2010 06:48:17 -0700 (PDT) Received: from mavbook.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id y2sm4722676bkx.20.2010.09.18.06.48.14 (version=SSLv3 cipher=RC4-MD5); Sat, 18 Sep 2010 06:48:15 -0700 (PDT) Sender: Alexander Motin Message-ID: <4C94C31C.6080102@FreeBSD.org> Date: Sat, 18 Sep 2010 16:48:12 +0300 From: Alexander Motin User-Agent: Thunderbird 2.0.0.24 (X11/20100402) MIME-Version: 1.0 To: Daan Vreeken References: <201009130725.o8D7PZX8073399@svn.freebsd.org> <201009181234.17851.Daan@vehosting.nl> In-Reply-To: <201009181234.17851.Daan@vehosting.nl> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r212541 - in head/sys: amd64/amd64 amd64/include dev/acpica i386/i386 i386/include kern mips/include mips/mips pc98/pc98 powerpc/aim powerpc/booke powerpc/include powerpc/powerpc sparc6... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Sep 2010 13:48:19 -0000 Hi. Daan Vreeken wrote: > On Monday 13 September 2010 09:25:35 Alexander Motin wrote: >> Author: mav >> Date: Mon Sep 13 07:25:35 2010 >> New Revision: 212541 >> URL: http://svn.freebsd.org/changeset/base/212541 >> >> Log: >> Refactor timer management code with priority to one-shot operation mode. >> The main goal of this is to generate timer interrupts only when there is >> some work to do. When CPU is busy interrupts are generating at full rate >> of hz + stathz to fullfill scheduler and timekeeping requirements. But >> when CPU is idle, only minimum set of interrupts (down to 8 interrupts >> per second per CPU now), needed to handle scheduled callouts is executed. >> This allows significantly increase idle CPU sleep time, increasing effect >> of static power-saving technologies. Also it should reduce host CPU load on >> virtualized systems, when guest system is idle. > [snip] > > When re-basing an ARM system running an older -current with local > patches/additions to a more recent version of -current (around > 2010-09-16-ish) I found out that the resulting kernel stopped booting. > To factor out our local changes I've tried to boot a 'SHEEVAPLUG' kernel > without modifications. This kernel also fails to boot. It just stops right > after : > > Can you perhaps tell me what's going wrong after this commit? > (If you need more info, I'd be happy to provide it where I can.) Sorry. Timer interrupt loss in one-shot mode made timer to not reload. r212823 fixes this problem for me. -- Alexander Motin From owner-svn-src-head@FreeBSD.ORG Sat Sep 18 14:39:11 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3610F1065694; Sat, 18 Sep 2010 14:39:11 +0000 (UTC) (envelope-from Daan@vehosting.nl) Received: from VM01.VEHosting.nl (vm01.vehosting.nl [85.17.51.140]) by mx1.freebsd.org (Postfix) with ESMTP id AAAA98FC1E; Sat, 18 Sep 2010 14:39:10 +0000 (UTC) Received: from [192.168.45.11] (180-161.ftth.onsbrabantnet.nl [88.159.161.180]) (authenticated bits=0) by VM01.VEHosting.nl (8.14.3/8.13.8) with ESMTP id o8IEcufP063948; Sat, 18 Sep 2010 16:38:56 +0200 (CEST) (envelope-from Daan@vehosting.nl) From: Daan Vreeken Organization: http://VEHosting.nl/ To: Alexander Motin Date: Sat, 18 Sep 2010 16:38:52 +0200 User-Agent: KMail/1.9.10 References: <201009130725.o8D7PZX8073399@svn.freebsd.org> <201009181234.17851.Daan@vehosting.nl> <4C94C31C.6080102@FreeBSD.org> In-Reply-To: <4C94C31C.6080102@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <201009181638.53234.Daan@vehosting.nl> x-ve-auth-version: mi-1.0.3 2008-05-30 - Copyright (c) 2008 - Daan Vreeken - VEHosting x-ve-auth: authenticated as 'pa4dan' on VM01.VEHosting.nl Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r212541 - in head/sys: amd64/amd64 amd64/include dev/acpica i386/i386 i386/include kern mips/include mips/mips pc98/pc98 powerpc/aim powerpc/booke powerpc/include powerpc/powerpc sparc6... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Sep 2010 14:39:11 -0000 Hi, On Saturday 18 September 2010 15:48:12 Alexander Motin wrote: > Hi. > > Daan Vreeken wrote: > > On Monday 13 September 2010 09:25:35 Alexander Motin wrote: > >> Author: mav > >> Date: Mon Sep 13 07:25:35 2010 > >> New Revision: 212541 > >> URL: http://svn.freebsd.org/changeset/base/212541 > >> > >> Log: > >> Refactor timer management code with priority to one-shot operation > >> mode. The main goal of this is to generate timer interrupts only when > >> there is some work to do. When CPU is busy interrupts are generating at > >> full rate of hz + stathz to fullfill scheduler and timekeeping > >> requirements. But when CPU is idle, only minimum set of interrupts (down > >> to 8 interrupts per second per CPU now), needed to handle scheduled > >> callouts is executed. This allows significantly increase idle CPU sleep > >> time, increasing effect of static power-saving technologies. Also it > >> should reduce host CPU load on virtualized systems, when guest system is > >> idle. > > > > [snip] > > > > When re-basing an ARM system running an older -current with local > > patches/additions to a more recent version of -current (around > > 2010-09-16-ish) I found out that the resulting kernel stopped booting. > > To factor out our local changes I've tried to boot a 'SHEEVAPLUG' kernel > > without modifications. This kernel also fails to boot. It just stops > > right after : > > > > Can you perhaps tell me what's going wrong after this commit? > > (If you need more info, I'd be happy to provide it where I can.) > > Sorry. Timer interrupt loss in one-shot mode made timer to not reload. > r212823 fixes this problem for me. Yes, that fixed it. Thanks for the quick fix! Regards, -- Daan Vreeken VEHosting http://VEHosting.nl tel: +31-(0)40-7113050 / +31-(0)6-46210825 KvK nr: 17174380 From owner-svn-src-head@FreeBSD.ORG Sat Sep 18 15:03:31 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BD1311065673; Sat, 18 Sep 2010 15:03:31 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AB4608FC08; Sat, 18 Sep 2010 15:03:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8IF3VwS069188; Sat, 18 Sep 2010 15:03:31 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8IF3VgV069184; Sat, 18 Sep 2010 15:03:31 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201009181503.o8IF3VgV069184@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 18 Sep 2010 15:03:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212824 - in head/sys: sys vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Sep 2010 15:03:31 -0000 Author: kib Date: Sat Sep 18 15:03:31 2010 New Revision: 212824 URL: http://svn.freebsd.org/changeset/base/212824 Log: Adopt the deferring of object deallocation for the deleted map entries on map unlock to the lock downgrade and later read unlock operation. System map entries cannot be backed by OBJT_VNODE objects, no need to defer deallocation for them. Map entries from user maps do not require the owner map for deallocation, and can be accumulated in the thread-local list for freeing when a user map is unlocked. Move the collection of entries for deferred reclamation into vm_map_delete(). Create helper vm_map_process_deferred(), that is called from locations where processing is feasible. Do not process deferred entries in vm_map_unlock_and_wait() since map_sleep_mtx is held. Reviewed by: alc, rstone (previous versions) Tested by: pho MFC after: 2 weeks Modified: head/sys/sys/proc.h head/sys/vm/vm_map.c head/sys/vm/vm_map.h Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Sat Sep 18 13:44:39 2010 (r212823) +++ head/sys/sys/proc.h Sat Sep 18 15:03:31 2010 (r212824) @@ -262,6 +262,7 @@ struct thread { struct ksiginfo td_dbgksi; /* (c) ksi reflected to debugger. */ int td_ng_outbound; /* (k) Thread entered ng from above. */ struct osd td_osd; /* (k) Object specific data. */ + struct vm_map_entry *td_map_def_user; /* (k) Deferred entries. */ #define td_endzero td_base_pri /* Copied during fork1() or thread_sched_upcall(). */ Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Sat Sep 18 13:44:39 2010 (r212823) +++ head/sys/vm/vm_map.c Sat Sep 18 15:03:31 2010 (r212824) @@ -128,6 +128,7 @@ static int vm_map_zinit(void *mem, int i static void vm_map_zfini(void *mem, int size); static void _vm_map_init(vm_map_t map, pmap_t pmap, vm_offset_t min, vm_offset_t max); +static void vm_map_entry_deallocate(vm_map_entry_t entry, boolean_t system_map); static void vm_map_entry_dispose(vm_map_t map, vm_map_entry_t entry); #ifdef INVARIANTS static void vm_map_zdtor(void *mem, int size, void *arg); @@ -454,30 +455,39 @@ _vm_map_lock(vm_map_t map, const char *f map->timestamp++; } -void -_vm_map_unlock(vm_map_t map, const char *file, int line) +static void +vm_map_process_deferred(void) { - vm_map_entry_t free_entry, entry; - vm_object_t object; + struct thread *td; + vm_map_entry_t entry; - free_entry = map->deferred_freelist; - map->deferred_freelist = NULL; + td = curthread; + + while ((entry = td->td_map_def_user) != NULL) { + td->td_map_def_user = entry->next; + vm_map_entry_deallocate(entry, FALSE); + } +} + +void +_vm_map_unlock_nodefer(vm_map_t map, const char *file, int line) +{ if (map->system_map) _mtx_unlock_flags(&map->system_mtx, 0, file, line); else _sx_xunlock(&map->lock, file, line); +} - while (free_entry != NULL) { - entry = free_entry; - free_entry = free_entry->next; - - if ((entry->eflags & MAP_ENTRY_IS_SUB_MAP) == 0) { - object = entry->object.vm_object; - vm_object_deallocate(object); - } +void +_vm_map_unlock(vm_map_t map, const char *file, int line) +{ - vm_map_entry_dispose(map, entry); + if (map->system_map) + _mtx_unlock_flags(&map->system_mtx, 0, file, line); + else { + _sx_xunlock(&map->lock, file, line); + vm_map_process_deferred(); } } @@ -497,8 +507,10 @@ _vm_map_unlock_read(vm_map_t map, const if (map->system_map) _mtx_unlock_flags(&map->system_mtx, 0, file, line); - else + else { _sx_sunlock(&map->lock, file, line); + vm_map_process_deferred(); + } } int @@ -548,6 +560,7 @@ _vm_map_lock_upgrade(vm_map_t map, const if (!_sx_try_upgrade(&map->lock, file, line)) { last_timestamp = map->timestamp; _sx_sunlock(&map->lock, file, line); + vm_map_process_deferred(); /* * If the map's timestamp does not change while the * map is unlocked, then the upgrade succeeds. @@ -631,7 +644,7 @@ vm_map_unlock_and_wait(vm_map_t map, int { mtx_lock(&map_sleep_mtx); - vm_map_unlock(map); + vm_map_unlock_nodefer(map); return (msleep(&map->root, &map_sleep_mtx, PDROP | PVM, "vmmaps", timo)); } @@ -699,7 +712,6 @@ _vm_map_init(vm_map_t map, pmap_t pmap, map->flags = 0; map->root = NULL; map->timestamp = 0; - map->deferred_freelist = NULL; } void @@ -2602,6 +2614,15 @@ vm_map_entry_unwire(vm_map_t map, vm_map entry->wired_count = 0; } +static void +vm_map_entry_deallocate(vm_map_entry_t entry, boolean_t system_map) +{ + + if ((entry->eflags & MAP_ENTRY_IS_SUB_MAP) == 0) + vm_object_deallocate(entry->object.vm_object); + uma_zfree(system_map ? kmapentzone : mapentzone, entry); +} + /* * vm_map_entry_delete: [ internal use only ] * @@ -2656,6 +2677,12 @@ vm_map_entry_delete(vm_map_t map, vm_map VM_OBJECT_UNLOCK(object); } else entry->object.vm_object = NULL; + if (map->system_map) + vm_map_entry_deallocate(entry, TRUE); + else { + entry->next = curthread->td_map_def_user; + curthread->td_map_def_user = entry; + } } /* @@ -2744,8 +2771,6 @@ vm_map_delete(vm_map_t map, vm_offset_t * will be set in the wrong object!) */ vm_map_entry_delete(map, entry); - entry->next = map->deferred_freelist; - map->deferred_freelist = entry; entry = next; } return (KERN_SUCCESS); Modified: head/sys/vm/vm_map.h ============================================================================== --- head/sys/vm/vm_map.h Sat Sep 18 13:44:39 2010 (r212823) +++ head/sys/vm/vm_map.h Sat Sep 18 15:03:31 2010 (r212824) @@ -185,7 +185,6 @@ struct vm_map { vm_flags_t flags; /* flags for this vm_map */ vm_map_entry_t root; /* Root of a binary search tree */ pmap_t pmap; /* (c) Physical map */ - vm_map_entry_t deferred_freelist; #define min_offset header.start /* (c) */ #define max_offset header.end /* (c) */ }; @@ -267,6 +266,7 @@ vmspace_pmap(struct vmspace *vmspace) void _vm_map_lock(vm_map_t map, const char *file, int line); void _vm_map_unlock(vm_map_t map, const char *file, int line); +void _vm_map_unlock_nodefer(vm_map_t map, const char *file, int line); void _vm_map_lock_read(vm_map_t map, const char *file, int line); void _vm_map_unlock_read(vm_map_t map, const char *file, int line); int _vm_map_trylock(vm_map_t map, const char *file, int line); @@ -279,6 +279,8 @@ void vm_map_wakeup(vm_map_t map); #define vm_map_lock(map) _vm_map_lock(map, LOCK_FILE, LOCK_LINE) #define vm_map_unlock(map) _vm_map_unlock(map, LOCK_FILE, LOCK_LINE) +#define vm_map_unlock_nodefer(map) \ + _vm_map_unlock_nodefer(map, LOCK_FILE, LOCK_LINE) #define vm_map_lock_read(map) _vm_map_lock_read(map, LOCK_FILE, LOCK_LINE) #define vm_map_unlock_read(map) _vm_map_unlock_read(map, LOCK_FILE, LOCK_LINE) #define vm_map_trylock(map) _vm_map_trylock(map, LOCK_FILE, LOCK_LINE) From owner-svn-src-head@FreeBSD.ORG Sat Sep 18 16:57:06 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2E6EA106566B; Sat, 18 Sep 2010 16:57:06 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 03C768FC0A; Sat, 18 Sep 2010 16:57:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8IGv5l6071868; Sat, 18 Sep 2010 16:57:05 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8IGv5Kw071864; Sat, 18 Sep 2010 16:57:05 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201009181657.o8IGv5Kw071864@svn.freebsd.org> From: Alexander Motin Date: Sat, 18 Sep 2010 16:57:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212825 - in head/sys/arm: arm include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Sep 2010 16:57:06 -0000 Author: mav Date: Sat Sep 18 16:57:05 2010 New Revision: 212825 URL: http://svn.freebsd.org/changeset/base/212825 Log: Add basic cpu_sleep() support for Marvell SoCs. This drops my SheevaPlug's heatsink termperature in open air from 49C to 43C when idle. Modified: head/sys/arm/arm/cpufunc.c head/sys/arm/arm/cpufunc_asm_sheeva.S head/sys/arm/include/cpufunc.h Modified: head/sys/arm/arm/cpufunc.c ============================================================================== --- head/sys/arm/arm/cpufunc.c Sat Sep 18 15:03:31 2010 (r212824) +++ head/sys/arm/arm/cpufunc.c Sat Sep 18 16:57:05 2010 (r212825) @@ -397,7 +397,7 @@ struct cpu_functions sheeva_cpufuncs = { cpufunc_nullop, /* flush_brnchtgt_C */ (void *)cpufunc_nullop, /* flush_brnchtgt_E */ - (void *)cpufunc_nullop, /* sleep */ + sheeva_cpu_sleep, /* sleep */ /* Soft functions */ @@ -1076,6 +1076,9 @@ set_cpufuncs() FC_DCACHE_STREAM_EN | FC_WR_ALLOC_EN | FC_BRANCH_TARG_BUF_DIS | FC_L2CACHE_EN); } + + /* Use powersave on this CPU. */ + cpu_do_powersave = 1; } else cpufuncs = armv5_ec_cpufuncs; Modified: head/sys/arm/arm/cpufunc_asm_sheeva.S ============================================================================== --- head/sys/arm/arm/cpufunc_asm_sheeva.S Sat Sep 18 15:03:31 2010 (r212824) +++ head/sys/arm/arm/cpufunc_asm_sheeva.S Sat Sep 18 16:57:05 2010 (r212825) @@ -392,3 +392,10 @@ ENTRY(sheeva_control_ext) mcrne p15, 1, r2, c15, c1, 0 /* Write new control register */ mov r0, r3 /* Return old value */ RET + +ENTRY(sheeva_cpu_sleep) + mov r0, #0 + mcr p15, 0, r0, c7, c10, 4 /* Drain write buffer */ + mcr p15, 0, r0, c7, c0, 4 /* Wait for interrupt */ + mov pc, lr + Modified: head/sys/arm/include/cpufunc.h ============================================================================== --- head/sys/arm/include/cpufunc.h Sat Sep 18 15:03:31 2010 (r212824) +++ head/sys/arm/include/cpufunc.h Sat Sep 18 16:57:05 2010 (r212825) @@ -400,6 +400,7 @@ extern unsigned arm10_dcache_index_max; extern unsigned arm10_dcache_index_inc; u_int sheeva_control_ext (u_int, u_int); +void sheeva_cpu_sleep (int); void sheeva_setttb (u_int); void sheeva_dcache_wbinv_range (vm_offset_t, vm_size_t); void sheeva_dcache_inv_range (vm_offset_t, vm_size_t); From owner-svn-src-head@FreeBSD.ORG Sat Sep 18 18:37:42 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3CD16106566B; Sat, 18 Sep 2010 18:37:42 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2CD6E8FC08; Sat, 18 Sep 2010 18:37:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8IIbgvu074323; Sat, 18 Sep 2010 18:37:42 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8IIbg20074321; Sat, 18 Sep 2010 18:37:42 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201009181837.o8IIbg20074321@svn.freebsd.org> From: Jaakko Heinonen Date: Sat, 18 Sep 2010 18:37:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212826 - head/sys/fs/devfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Sep 2010 18:37:42 -0000 Author: jh Date: Sat Sep 18 18:37:41 2010 New Revision: 212826 URL: http://svn.freebsd.org/changeset/base/212826 Log: - For consistency, remove "." and ".." entries from de_dlist before calling devfs_delete() (and thus possibly dropping dm_lock) in devfs_rmdir_empty(). - Assert that we don't return doomed entries from devfs_find(). [1] Suggested by: kib [1] Reviewed by: kib Modified: head/sys/fs/devfs/devfs_devs.c Modified: head/sys/fs/devfs/devfs_devs.c ============================================================================== --- head/sys/fs/devfs/devfs_devs.c Sat Sep 18 16:57:05 2010 (r212825) +++ head/sys/fs/devfs/devfs_devs.c Sat Sep 18 18:37:41 2010 (r212826) @@ -171,6 +171,8 @@ devfs_find(struct devfs_dirent *dd, cons continue; break; } + KASSERT(de == NULL || (de->de_flags & DE_DOOMED) == 0, + ("devfs_find: returning a doomed entry")); return (de); } @@ -302,6 +304,8 @@ devfs_rmdir_empty(struct devfs_mount *dm dd = devfs_parent_dirent(de); KASSERT(dd != NULL, ("devfs_rmdir_empty: NULL dd")); + TAILQ_REMOVE(&de->de_dlist, de_dot, de_list); + TAILQ_REMOVE(&de->de_dlist, de_dotdot, de_list); TAILQ_REMOVE(&dd->de_dlist, de, de_list); DEVFS_DE_HOLD(dd); devfs_delete(dm, de, DEVFS_DEL_NORECURSE); From owner-svn-src-head@FreeBSD.ORG Sat Sep 18 19:23:14 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A5D471065670; Sat, 18 Sep 2010 19:23:14 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7B8BC8FC14; Sat, 18 Sep 2010 19:23:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8IJNEe5075404; Sat, 18 Sep 2010 19:23:14 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8IJNE3E075401; Sat, 18 Sep 2010 19:23:14 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201009181923.o8IJNE3E075401@svn.freebsd.org> From: Glen Barber Date: Sat, 18 Sep 2010 19:23:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212827 - head/share/man/man5 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Sep 2010 19:23:14 -0000 Author: gjb (doc committer) Date: Sat Sep 18 19:23:14 2010 New Revision: 212827 URL: http://svn.freebsd.org/changeset/base/212827 Log: Note that devfs(5) and fdescfs(5) both create /dev/fd file descriptors. PR: 144534 Submitted by: Matthew Seaman Patch by: Matthew Seaman, keramida Approved by: keramida (mentor) MFC after: 1 week Modified: head/share/man/man5/devfs.5 head/share/man/man5/fdescfs.5 Modified: head/share/man/man5/devfs.5 ============================================================================== --- head/share/man/man5/devfs.5 Sat Sep 18 18:37:41 2010 (r212826) +++ head/share/man/man5/devfs.5 Sat Sep 18 19:23:14 2010 (r212827) @@ -38,7 +38,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 30, 2010 +.Dd September 18, 2010 .Dt DEVFS 5 .Os .Sh NAME @@ -69,6 +69,27 @@ The .Xr mknod 8 tool can be used to recover deleted device entries under .Nm . +.Pp +The +.Xr fdescfs 5 +filesystem is an alternate means for populating +.Pa /dev/fd . +The character devices that both +.Nm +and +.Xr fdescfs 5 +present in +.Pa /dev/fd +correspond to the open file descriptors of the process +accessing the directory. +.Nm +only creates files for the standard file descriptors +.Pa 0 , +.Pa 1 +and +.Pa 2 . +.Xr fdescfs 5 +creates files for all open descriptors. .Sh FILES .Bl -tag -width /dev/XXXX -compact .It Pa /dev @@ -85,6 +106,7 @@ volume located on .Dl "mount -t devfs devfs /mychroot/dev" .Sh SEE ALSO .Xr devfs 8 , +.Xr fdescfs 5 , .Xr mount 8 .Sh HISTORY The Modified: head/share/man/man5/fdescfs.5 ============================================================================== --- head/share/man/man5/fdescfs.5 Sat Sep 18 18:37:41 2010 (r212826) +++ head/share/man/man5/fdescfs.5 Sat Sep 18 19:23:14 2010 (r212827) @@ -38,7 +38,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 14, 1996 +.Dd September 18, 2010 .Dt FDESCFS 5 .Os .Sh NAME @@ -87,6 +87,15 @@ call other than and .Dv O_RDWR are ignored. +.Pp +.Em "Note:" +.Pa /dev/fd/0 , +.Pa /dev/fd/1 +and +.Pa /dev/fd/2 +files are created by default when devfs alone is mounted. +.Nm +creates entries for all file descriptors opened by the process. .Sh FILES .Bl -tag -width /dev/stderr -compact .It Pa /dev/fd/# @@ -99,6 +108,7 @@ volume located on .Pp .Dl "mount -t fdescfs null /dev/fd" .Sh SEE ALSO +.Xr devfs 5 , .Xr mount 8 .Sh HISTORY The From owner-svn-src-head@FreeBSD.ORG Sat Sep 18 21:45:12 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8B35D1065696 for ; Sat, 18 Sep 2010 21:45:12 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) by mx1.freebsd.org (Postfix) with ESMTP id F10B18FC1B for ; Sat, 18 Sep 2010 21:45:11 +0000 (UTC) Received: (qmail 27080 invoked from network); 18 Sep 2010 21:39:21 -0000 Received: from localhost (HELO [127.0.0.1]) ([127.0.0.1]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 18 Sep 2010 21:39:21 -0000 Message-ID: <4C9532E7.8090904@freebsd.org> Date: Sat, 18 Sep 2010 23:45:11 +0200 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.9) Gecko/20100825 Thunderbird/3.1.3 MIME-Version: 1.0 To: "Bjoern A. Zeeb" References: <201009172205.o8HM5RPG043265@svn.freebsd.org> <20100918113224.J31898@maildrop.int.zabbadoz.net> In-Reply-To: <20100918113224.J31898@maildrop.int.zabbadoz.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r212803 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Sep 2010 21:45:12 -0000 On 18.09.2010 13:34, Bjoern A. Zeeb wrote: > On Fri, 17 Sep 2010, Andre Oppermann wrote: >> @@ -487,22 +482,15 @@ after_sack_rexmit: >> */ >> ipsec_optlen = ipsec_hdrsiz_tcp(tp); >> #endif >> - if (len > tp->t_maxseg) { >> - if ((tp->t_flags & TF_TSO) && V_tcp_do_tso && >> - ((tp->t_flags & TF_SIGNATURE) == 0) && >> - tp->rcv_numsacks == 0 && sack_rxmit == 0 && >> - tp->t_inpcb->inp_options == NULL && >> - tp->t_inpcb->in6p_options == NULL >> + if ((tp->t_flags & TF_TSO) && V_tcp_do_tso && len > tp->t_maxseg && >> + ((tp->t_flags & TF_SIGNATURE) == 0) && >> + tp->rcv_numsacks == 0 && sack_rxmit == 0 && >> #ifdef IPSEC >> - && ipsec_optlen == 0 >> + ipsec_optlen == 0 && >> #endif >> - ) { >> - tso = 1; >> - } else { >> - len = tp->t_maxseg; >> - sendalot = 1; >> - } >> - } >> + tp->t_inpcb->inp_options == NULL && >> + tp->t_inpcb->in6p_options == NULL) >> + tso = 1; > > In the non-TSO case you are no longer reducing len to tp->t_maxseg > here, if it's larger, which I think breaks asssumptions all the way down. No assumptions are broken for the non-TSO case. The value of len is only tested against t_maxseg for being equal or grater. This always hold true. When the decision to send has been made len is correctly limited in the non-TSO and TSO case. Before it was a bit of either was done in both places. That is now merged into one spot. -- Andre From owner-svn-src-head@FreeBSD.ORG Sat Sep 18 22:26:50 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A24D5106566B; Sat, 18 Sep 2010 22:26:50 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 920988FC0A; Sat, 18 Sep 2010 22:26:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8IMQoBq080058; Sat, 18 Sep 2010 22:26:50 GMT (envelope-from n_hibma@svn.freebsd.org) Received: (from n_hibma@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8IMQofx080056; Sat, 18 Sep 2010 22:26:50 GMT (envelope-from n_hibma@svn.freebsd.org) Message-Id: <201009182226.o8IMQofx080056@svn.freebsd.org> From: Nick Hibma Date: Sat, 18 Sep 2010 22:26:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212829 - head/usr.sbin/ppp X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Sep 2010 22:26:50 -0000 Author: n_hibma Date: Sat Sep 18 22:26:50 2010 New Revision: 212829 URL: http://svn.freebsd.org/changeset/base/212829 Log: Bugfix: Reset the packet counters at the same time as the byte counts. Reviewed by: brian MFC after: 3 weeks Modified: head/usr.sbin/ppp/throughput.c Modified: head/usr.sbin/ppp/throughput.c ============================================================================== --- head/usr.sbin/ppp/throughput.c Sat Sep 18 20:50:36 2010 (r212828) +++ head/usr.sbin/ppp/throughput.c Sat Sep 18 22:26:50 2010 (r212829) @@ -201,7 +201,7 @@ throughput_start(struct pppThroughput *t for (i = 0; i < t->SamplePeriod; i++) t->in.SampleOctets[i] = t->out.SampleOctets[i] = 0; t->nSample = 0; - t->OctetsIn = t->OctetsOut = 0; + t->OctetsIn = t->OctetsOut = t->PacketsIn = t->PacketsOut = 0; t->in.OctetsPerSecond = t->out.OctetsPerSecond = t->BestOctetsPerSecond = 0; time(&t->BestOctetsPerSecondTime); t->downtime = 0; @@ -268,7 +268,7 @@ throughput_clear(struct pppThroughput *t divisor = 1; prompt_Printf(prompt, "overall cleared (was %6qu bytes/sec)\n", (t->OctetsIn + t->OctetsOut) / divisor); - t->OctetsIn = t->OctetsOut = 0; + t->OctetsIn = t->OctetsOut = t->PacketsIn = t->PacketsOut = 0; t->downtime = 0; time(&t->uptime); } From owner-svn-src-head@FreeBSD.ORG Sat Sep 18 22:37:48 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 10F901065674; Sat, 18 Sep 2010 22:37:48 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DAC808FC14; Sat, 18 Sep 2010 22:37:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8IMbl5x080343; Sat, 18 Sep 2010 22:37:47 GMT (envelope-from n_hibma@svn.freebsd.org) Received: (from n_hibma@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8IMblaq080341; Sat, 18 Sep 2010 22:37:47 GMT (envelope-from n_hibma@svn.freebsd.org) Message-Id: <201009182237.o8IMblaq080341@svn.freebsd.org> From: Nick Hibma Date: Sat, 18 Sep 2010 22:37:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212830 - head/sys/dev/usb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Sep 2010 22:37:48 -0000 Author: n_hibma Date: Sat Sep 18 22:37:47 2010 New Revision: 212830 URL: http://svn.freebsd.org/changeset/base/212830 Log: Cleanup white space and typos. Modified: head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Sat Sep 18 22:26:50 2010 (r212829) +++ head/sys/dev/usb/usbdevs Sat Sep 18 22:37:47 2010 (r212830) @@ -488,7 +488,7 @@ vendor GEOCAST 0x0a79 Geocast Network S vendor IDQUANTIQUE 0x0aba id Quantique vendor ZYDAS 0x0ace Zydas Technology Corporation vendor NEODIO 0x0aec Neodio -vendor OPTION 0x0af0 Option N.V: +vendor OPTION 0x0af0 Option N.V. vendor ASUS 0x0b05 ASUSTeK Computer vendor TODOS 0x0b0c Todos Data System vendor SIIG2 0x0b39 SIIG @@ -1444,7 +1444,7 @@ product EDIMAX EW7718 0x7718 EW-7718 /* eGalax Products */ product EGALAX TPANEL 0x0001 Touch Panel product EGALAX TPANEL2 0x0002 Touch Panel -product EGALAX2 TPANEL 0x0001 Touch Panel +product EGALAX2 TPANEL 0x0001 Touch Panel /* Eicon Networks */ product EICON DIVA852 0x4905 Diva 852 ISDN TA @@ -2096,7 +2096,7 @@ product MELCO LUATX1 0x0001 LUA-TX Ethe product MELCO LUATX5 0x0005 LUA-TX Ethernet product MELCO LUA2TX5 0x0009 LUA2-TX Ethernet product MELCO LUAKTX 0x0012 LUA-KTX Ethernet -product MELCO DUBPXXG 0x001c USB-IDE Bridge: DUB-PxxG +product MELCO DUBPXXG 0x001c DUB-PxxG product MELCO LUAU2KTX 0x003d LUA-U2-KTX Ethernet product MELCO KG54YB 0x005e WLI-U2-KG54-YB WLAN product MELCO KG54 0x0066 WLI-U2-KG54 WLAN @@ -2456,7 +2456,7 @@ product PANASONIC TYTP50P6S 0x3900 TY-TP /* PARA Industrial products */ product PARA RT3070 0x8888 RT3070 - + /* Pegatron products */ product PEGATRON RT2870 0x0002 RT2870 product PEGATRON RT3070 0x000c RT3070 @@ -2742,7 +2742,7 @@ product SAGEM XG76NA 0x0062 XG-76NA product SAMSUNG ML6060 0x3008 ML-6060 laser printer product SAMSUNG YP_U2 0x5050 YP-U2 MP3 Player product SAMSUNG YP_U4 0x5092 YP-U4 MP3 Player -product SAMSUNG I500 0x6601 I500 Palm USB Phone +product SAMSUNG I500 0x6601 I500 Palm USB Phone product SAMSUNG I330 0x8001 I330 phone cradle product SAMSUNG2 RT2870_1 0x2018 RT2870 @@ -3371,7 +3371,7 @@ product ZOOM 2986L 0x9700 2986L Fax mod product ZORAN EX20DSC 0x4343 Digital Camera EX-20 DSC /* Zydas Technology Corporation products */ -product ZYDAS ZD1211 0x1211 ZD1211 WLAN abg +product ZYDAS ZD1211 0x1211 ZD1211 WLAN abg product ZYDAS ZD1211B 0x1215 ZD1211B /* ZyXEL Communication Co. products */ From owner-svn-src-head@FreeBSD.ORG Sat Sep 18 23:38:21 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8AFA4106567A; Sat, 18 Sep 2010 23:38:21 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7AE8C8FC0C; Sat, 18 Sep 2010 23:38:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8INcLVU081792; Sat, 18 Sep 2010 23:38:21 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8INcLF8081790; Sat, 18 Sep 2010 23:38:21 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201009182338.o8INcLF8081790@svn.freebsd.org> From: Rui Paulo Date: Sat, 18 Sep 2010 23:38:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212831 - head/lib/libproc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Sep 2010 23:38:21 -0000 Author: rpaulo Date: Sat Sep 18 23:38:21 2010 New Revision: 212831 URL: http://svn.freebsd.org/changeset/base/212831 Log: Ignore EINTR when calling waitpid. Modified: head/lib/libproc/proc_util.c Modified: head/lib/libproc/proc_util.c ============================================================================== --- head/lib/libproc/proc_util.c Sat Sep 18 22:37:47 2010 (r212830) +++ head/lib/libproc/proc_util.c Sat Sep 18 23:38:21 2010 (r212831) @@ -145,7 +145,8 @@ proc_wstatus(struct proc_handle *phdl) if (phdl == NULL) return (-1); if (waitpid(phdl->pid, &status, WUNTRACED) < 0) { - warn("waitpid"); + if (errno != EINTR) + warn("waitpid"); return (-1); } if (WIFSTOPPED(status))