From owner-svn-src-head@FreeBSD.ORG Sun Dec 9 00:32:40 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 614C4303; Sun, 9 Dec 2012 00:32:40 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4468C8FC0C; Sun, 9 Dec 2012 00:32:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB90We0P050433; Sun, 9 Dec 2012 00:32:40 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB90WcWW050424; Sun, 9 Dec 2012 00:32:38 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201212090032.qB90WcWW050424@svn.freebsd.org> From: Alan Cox Date: Sun, 9 Dec 2012 00:32:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244043 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 09 Dec 2012 00:32:40 -0000 Author: alc Date: Sun Dec 9 00:32:38 2012 New Revision: 244043 URL: http://svnweb.freebsd.org/changeset/base/244043 Log: In the past four years, we've added two new vm object types. Each time, similar changes had to be made in various places throughout the machine- independent virtual memory layer to support the new vm object type. However, in most of these places, it's actually not the type of the vm object that matters to us but instead certain attributes of its pages. For example, OBJT_DEVICE, OBJT_MGTDEVICE, and OBJT_SG objects contain fictitious pages. In other words, in most of these places, we were testing the vm object's type to determine if it contained fictitious (or unmanaged) pages. To both simplify the code in these places and make the addition of future vm object types easier, this change introduces two new vm object flags that describe attributes of the vm object's pages, specifically, whether they are fictitious or unmanaged. Reviewed and tested by: kib Modified: head/sys/vm/vm_fault.c head/sys/vm/vm_map.c head/sys/vm/vm_meter.c head/sys/vm/vm_object.c head/sys/vm/vm_object.h head/sys/vm/vm_page.c head/sys/vm/vm_pageout.c Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Sat Dec 8 22:52:39 2012 (r244042) +++ head/sys/vm/vm_fault.c Sun Dec 9 00:32:38 2012 (r244043) @@ -968,8 +968,8 @@ vm_fault_cache_behind(const struct fault VM_OBJECT_LOCK(object); } } - if (first_object->type != OBJT_DEVICE && - first_object->type != OBJT_PHYS && first_object->type != OBJT_SG) { + /* Neither fictitious nor unmanaged pages can be cached. */ + if ((first_object->flags & (OBJ_FICTITIOUS | OBJ_UNMANAGED)) == 0) { if (fs->first_pindex < distance) pindex = 0; else Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Sat Dec 8 22:52:39 2012 (r244042) +++ head/sys/vm/vm_map.c Sun Dec 9 00:32:38 2012 (r244043) @@ -2324,8 +2324,8 @@ done: */ vm_fault_unwire(map, entry->start, entry->end, entry->object.vm_object != NULL && - (entry->object.vm_object->type == OBJT_DEVICE || - entry->object.vm_object->type == OBJT_SG)); + (entry->object.vm_object->flags & + OBJ_FICTITIOUS) != 0); } } KASSERT(entry->eflags & MAP_ENTRY_IN_TRANSITION, @@ -2445,8 +2445,8 @@ vm_map_wire(vm_map_t map, vm_offset_t st saved_start = entry->start; saved_end = entry->end; fictitious = entry->object.vm_object != NULL && - (entry->object.vm_object->type == OBJT_DEVICE || - entry->object.vm_object->type == OBJT_SG); + (entry->object.vm_object->flags & + OBJ_FICTITIOUS) != 0; /* * Release the map lock, relying on the in-transition * mark. Mark the map busy for fork. @@ -2544,8 +2544,8 @@ done: */ vm_fault_unwire(map, entry->start, entry->end, entry->object.vm_object != NULL && - (entry->object.vm_object->type == OBJT_DEVICE || - entry->object.vm_object->type == OBJT_SG)); + (entry->object.vm_object->flags & + OBJ_FICTITIOUS) != 0); } } next_entry_done: @@ -2681,8 +2681,7 @@ vm_map_entry_unwire(vm_map_t map, vm_map { vm_fault_unwire(map, entry->start, entry->end, entry->object.vm_object != NULL && - (entry->object.vm_object->type == OBJT_DEVICE || - entry->object.vm_object->type == OBJT_SG)); + (entry->object.vm_object->flags & OBJ_FICTITIOUS) != 0); entry->wired_count = 0; } Modified: head/sys/vm/vm_meter.c ============================================================================== --- head/sys/vm/vm_meter.c Sat Dec 8 22:52:39 2012 (r244042) +++ head/sys/vm/vm_meter.c Sun Dec 9 00:32:38 2012 (r244043) @@ -200,7 +200,7 @@ vmtotal(SYSCTL_HANDLER_ARGS) * synchronization should not impair the accuracy of * the reported statistics. */ - if (object->type == OBJT_DEVICE || object->type == OBJT_SG) { + if ((object->flags & OBJ_FICTITIOUS) != 0) { /* * Devices, like /dev/mem, will badly skew our totals. */ Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Sat Dec 8 22:52:39 2012 (r244042) +++ head/sys/vm/vm_object.c Sun Dec 9 00:32:38 2012 (r244043) @@ -212,15 +212,35 @@ _vm_object_allocate(objtype_t type, vm_p object->root = NULL; object->type = type; + switch (type) { + case OBJT_DEAD: + panic("_vm_object_allocate: can't create OBJT_DEAD"); + case OBJT_DEFAULT: + case OBJT_SWAP: + object->flags = OBJ_ONEMAPPING; + break; + case OBJT_DEVICE: + case OBJT_SG: + object->flags = OBJ_FICTITIOUS | OBJ_UNMANAGED; + break; + case OBJT_MGTDEVICE: + object->flags = OBJ_FICTITIOUS; + break; + case OBJT_PHYS: + object->flags = OBJ_UNMANAGED; + break; + case OBJT_VNODE: + object->flags = 0; + break; + default: + panic("_vm_object_allocate: type %d is undefined", type); + } object->size = size; object->generation = 1; object->ref_count = 1; object->memattr = VM_MEMATTR_DEFAULT; - object->flags = 0; object->cred = NULL; object->charge = 0; - if ((object->type == OBJT_DEFAULT) || (object->type == OBJT_SWAP)) - object->flags = OBJ_ONEMAPPING; object->pg_color = 0; object->handle = NULL; object->backing_object = NULL; @@ -1064,7 +1084,7 @@ shadowlookup: (tobject->flags & OBJ_ONEMAPPING) == 0) { goto unlock_tobject; } - } else if (tobject->type == OBJT_PHYS) + } else if ((tobject->flags & OBJ_UNMANAGED) != 0) goto unlock_tobject; m = vm_page_lookup(tobject, tpindex); if (m == NULL && advise == MADV_WILLNEED) { @@ -1834,7 +1854,7 @@ vm_object_page_remove(vm_object_t object int wirings; VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); - KASSERT((object->type != OBJT_DEVICE && object->type != OBJT_PHYS) || + KASSERT((object->flags & OBJ_UNMANAGED) == 0 || (options & (OBJPR_CLEANONLY | OBJPR_NOTMAPPED)) == OBJPR_NOTMAPPED, ("vm_object_page_remove: illegal options for object %p", object)); if (object->resident_page_count == 0) @@ -1918,7 +1938,7 @@ skipmemq: * pages are moved to the cache queue. * * This operation should only be performed on objects that - * contain managed pages. + * contain non-fictitious, managed pages. * * The object must be locked. */ @@ -1929,8 +1949,7 @@ vm_object_page_cache(vm_object_t object, vm_page_t p, next; VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); - KASSERT((object->type != OBJT_DEVICE && object->type != OBJT_SG && - object->type != OBJT_PHYS), + KASSERT((object->flags & (OBJ_FICTITIOUS | OBJ_UNMANAGED)) == 0, ("vm_object_page_cache: illegal object %p", object)); if (object->resident_page_count == 0) return; Modified: head/sys/vm/vm_object.h ============================================================================== --- head/sys/vm/vm_object.h Sat Dec 8 22:52:39 2012 (r244042) +++ head/sys/vm/vm_object.h Sun Dec 9 00:32:38 2012 (r244043) @@ -165,6 +165,8 @@ struct vm_object { /* * Flags */ +#define OBJ_FICTITIOUS 0x0001 /* (c) contains fictitious pages */ +#define OBJ_UNMANAGED 0x0002 /* (c) contains unmanaged pages */ #define OBJ_ACTIVE 0x0004 /* active objects */ #define OBJ_DEAD 0x0008 /* dead objects (during rundown) */ #define OBJ_NOSPLIT 0x0010 /* dont split this object */ Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Sat Dec 8 22:52:39 2012 (r244042) +++ head/sys/vm/vm_page.c Sun Dec 9 00:32:38 2012 (r244043) @@ -1414,9 +1414,8 @@ vm_page_alloc(vm_object_t object, vm_pin mtx_unlock(&vm_page_queue_free_mtx); return (NULL); #if VM_NRESERVLEVEL > 0 - } else if (object == NULL || object->type == OBJT_DEVICE || - object->type == OBJT_SG || - (object->flags & OBJ_COLORED) == 0 || + } else if (object == NULL || (object->flags & (OBJ_COLORED | + OBJ_FICTITIOUS)) != OBJ_COLORED || (m = vm_reserv_alloc_page(object, pindex)) == NULL) { #else } else { @@ -1491,10 +1490,8 @@ vm_page_alloc(vm_object_t object, vm_pin m->flags = flags; mtx_unlock(&vm_page_queue_free_mtx); m->aflags = 0; - if (object == NULL || object->type == OBJT_PHYS) - m->oflags = VPO_UNMANAGED; - else - m->oflags = 0; + m->oflags = object == NULL || (object->flags & OBJ_UNMANAGED) != 0 ? + VPO_UNMANAGED : 0; if ((req & (VM_ALLOC_NOBUSY | VM_ALLOC_NOOBJ)) == 0) m->oflags |= VPO_BUSY; if (req & VM_ALLOC_WIRED) { @@ -1510,7 +1507,7 @@ vm_page_alloc(vm_object_t object, vm_pin if (object != NULL) { /* Ignore device objects; the pager sets "memattr" for them. */ if (object->memattr != VM_MEMATTR_DEFAULT && - object->type != OBJT_DEVICE && object->type != OBJT_SG) + (object->flags & OBJ_FICTITIOUS) == 0) pmap_page_set_memattr(m, object->memattr); vm_page_insert(m, object, pindex); } else Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Sat Dec 8 22:52:39 2012 (r244042) +++ head/sys/vm/vm_pageout.c Sun Dec 9 00:32:38 2012 (r244043) @@ -705,14 +705,14 @@ vm_pageout_object_deactivate_pages(pmap_ int actcount, remove_mode; VM_OBJECT_LOCK_ASSERT(first_object, MA_OWNED); - if (first_object->type == OBJT_DEVICE || - first_object->type == OBJT_SG) + if ((first_object->flags & OBJ_FICTITIOUS) != 0) return; for (object = first_object;; object = backing_object) { if (pmap_resident_count(pmap) <= desired) goto unlock_return; VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); - if (object->type == OBJT_PHYS || object->paging_in_progress) + if ((object->flags & OBJ_UNMANAGED) != 0 || + object->paging_in_progress != 0) goto unlock_return; remove_mode = 0; From owner-svn-src-head@FreeBSD.ORG Sun Dec 9 01:08:45 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5DB3ACC8; Sun, 9 Dec 2012 01:08:45 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 29C8F8FC13; Sun, 9 Dec 2012 01:08:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB918jh4055045; Sun, 9 Dec 2012 01:08:45 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB918iUW055043; Sun, 9 Dec 2012 01:08:44 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201212090108.qB918iUW055043@svn.freebsd.org> From: Adrian Chadd Date: Sun, 9 Dec 2012 01:08:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244044 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 09 Dec 2012 01:08:45 -0000 Author: adrian Date: Sun Dec 9 01:08:44 2012 New Revision: 244044 URL: http://svnweb.freebsd.org/changeset/base/244044 Log: Don't panic if the stageq here is empty; just fall through with NULL pointers and leave the stage queue flush routine to just do nothing (since both head and tail here will be NULL.) This should quieten the "stageq empty" panic where the stageq itself is empty, but it won't fix the second KASSERT() here "staging queue empty" as that's likely a different underlying problem. PR: kern/174283 Modified: head/sys/net80211/ieee80211_superg.c head/sys/net80211/ieee80211_superg.h Modified: head/sys/net80211/ieee80211_superg.c ============================================================================== --- head/sys/net80211/ieee80211_superg.c Sun Dec 9 00:32:38 2012 (r244043) +++ head/sys/net80211/ieee80211_superg.c Sun Dec 9 01:08:44 2012 (r244044) @@ -547,6 +547,14 @@ ff_flush(struct mbuf *head, struct mbuf /* * Age frames on the staging queue. + * + * This is called without the comlock held, but it does all its work + * behind the comlock. Because of this, it's possible that the + * staging queue will be serviced between the function which called + * it and now; thus simply checking that the queue has work in it + * may fail. + * + * See PR kern/174283 for more details. */ void ieee80211_ff_age(struct ieee80211com *ic, struct ieee80211_stageq *sq, @@ -557,7 +565,9 @@ ieee80211_ff_age(struct ieee80211com *ic struct ieee80211_node *ni; struct ieee80211_tx_ampdu *tap; +#if 0 KASSERT(sq->head != NULL, ("stageq empty")); +#endif IEEE80211_LOCK(ic); head = sq->head; Modified: head/sys/net80211/ieee80211_superg.h ============================================================================== --- head/sys/net80211/ieee80211_superg.h Sun Dec 9 00:32:38 2012 (r244043) +++ head/sys/net80211/ieee80211_superg.h Sun Dec 9 01:08:44 2012 (r244044) @@ -87,6 +87,10 @@ struct mbuf *ieee80211_ff_check(struct i void ieee80211_ff_age(struct ieee80211com *, struct ieee80211_stageq *, int quanta); +/* + * See ieee80211_ff_age() for a description of the locking + * expectation here. + */ static __inline void ieee80211_ff_flush(struct ieee80211com *ic, int ac) { @@ -96,6 +100,10 @@ ieee80211_ff_flush(struct ieee80211com * ieee80211_ff_age(ic, &sg->ff_stageq[ac], 0x7fffffff); } +/* + * See ieee80211_ff_age() for a description of the locking + * expectation here. + */ static __inline void ieee80211_ff_age_all(struct ieee80211com *ic, int quanta) { From owner-svn-src-head@FreeBSD.ORG Sun Dec 9 04:54:23 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5D59261B; Sun, 9 Dec 2012 04:54:23 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3AF968FC12; Sun, 9 Dec 2012 04:54:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB94sNe8087136; Sun, 9 Dec 2012 04:54:23 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB94sNNZ087134; Sun, 9 Dec 2012 04:54:23 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201212090454.qB94sNNZ087134@svn.freebsd.org> From: Attilio Rao Date: Sun, 9 Dec 2012 04:54:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244046 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 09 Dec 2012 04:54:23 -0000 Author: attilio Date: Sun Dec 9 04:54:22 2012 New Revision: 244046 URL: http://svnweb.freebsd.org/changeset/base/244046 Log: Add a comment on why inlining critical_enter() may not be a good idea for the general case. Reviewed by: bde MFC after: 1 week Modified: head/sys/kern/kern_switch.c Modified: head/sys/kern/kern_switch.c ============================================================================== --- head/sys/kern/kern_switch.c Sun Dec 9 04:15:51 2012 (r244045) +++ head/sys/kern/kern_switch.c Sun Dec 9 04:54:22 2012 (r244046) @@ -176,6 +176,12 @@ retry: /* * Kernel thread preemption implementation. Critical sections mark * regions of code in which preemptions are not allowed. + * + * It might seem a good idea to inline critical_enter() but, in order + * to prevent instructions reordering by the compiler, a __compiler_membar() + * would have to be used here (the same as sched_pin()). The performance + * penalty imposed by the membar could, then, produce slower code than + * the function call itself, for most cases. */ void critical_enter(void) From owner-svn-src-head@FreeBSD.ORG Sun Dec 9 09:58:45 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4986A5B2; Sun, 9 Dec 2012 09:58:45 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 13E0B8FC13; Sun, 9 Dec 2012 09:58:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB99witn026928; Sun, 9 Dec 2012 09:58:44 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB99wiig026926; Sun, 9 Dec 2012 09:58:44 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201212090958.qB99wiig026926@svn.freebsd.org> From: Hans Petter Selasky Date: Sun, 9 Dec 2012 09:58:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244047 - in head/sys/dev/usb: . serial X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 09 Dec 2012 09:58:45 -0000 Author: hselasky Date: Sun Dec 9 09:58:44 2012 New Revision: 244047 URL: http://svnweb.freebsd.org/changeset/base/244047 Log: Add new USB ID. MFC after: 1 week Submitted by: Artyom Mirgorodskiy Modified: head/sys/dev/usb/serial/u3g.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/serial/u3g.c ============================================================================== --- head/sys/dev/usb/serial/u3g.c Sun Dec 9 04:54:22 2012 (r244046) +++ head/sys/dev/usb/serial/u3g.c Sun Dec 9 09:58:44 2012 (r244047) @@ -553,6 +553,7 @@ static const STRUCT_USB_HOST_ID u3g_devs U3G_DEV(TOSHIBA, G450, 0), U3G_DEV(TOSHIBA, HSDPA, 0), U3G_DEV(YISO, C893, 0), + U3G_DEV(WETELECOM, WM_D200, 0), /* Autoinstallers */ U3G_DEV(NOVATEL, ZEROCD, U3GINIT_SCSIEJECT), U3G_DEV(OPTION, GTICON322, U3GINIT_REZERO), Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Sun Dec 9 04:54:22 2012 (r244046) +++ head/sys/dev/usb/usbdevs Sun Dec 9 09:58:44 2012 (r244047) @@ -721,6 +721,7 @@ vendor RTSYSTEMS 0x2100 RTSYSTEMS vendor VIALABS 0x2109 VIA Labs vendor ERICSSON 0x2282 Ericsson vendor MOTOROLA2 0x22b8 Motorola +vendor WETELECOM 0x22de WeTelecom vendor TRIPPLITE 0x2478 Tripp-Lite vendor HIROSE 0x2631 Hirose Electric vendor NHJ 0x2770 NHJ @@ -4194,6 +4195,9 @@ product WESTERN HUB 0x0500 USB HUB product WESTERN MYBOOK 0x0901 MyBook External HDD product WESTERN MYPASSWORD 0x0704 MyPassword External HDD +/* WeTelecom products */ +product WETELECOM WM_D200 0x6801 WM-D200 + /* WIENER Plein & Baus GmbH products */ product WIENERPLEINBAUS PL512 0x0010 PL512 PSU product WIENERPLEINBAUS RCM 0x0011 RCM Remote Control From owner-svn-src-head@FreeBSD.ORG Sun Dec 9 15:25:34 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E24BC800; Sun, 9 Dec 2012 15:25:34 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C672B8FC08; Sun, 9 Dec 2012 15:25:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB9FPYH0074745; Sun, 9 Dec 2012 15:25:34 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB9FPYsG074743; Sun, 9 Dec 2012 15:25:34 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201212091525.qB9FPYsG074743@svn.freebsd.org> From: Devin Teske Date: Sun, 9 Dec 2012 15:25:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244048 - head/sys/boot/forth X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 09 Dec 2012 15:25:35 -0000 Author: dteske Date: Sun Dec 9 15:25:34 2012 New Revision: 244048 URL: http://svnweb.freebsd.org/changeset/base/244048 Log: Use ASCII characters for box/line characters in frames.4th Committed with changes to support the following from loader.conf(5): + console="vidconsole comconsole" (not just console="comconsole") + boot_serial="anything" (not just boot_serial="YES") + boot_multicons="anything" (unsupported in originally-submitted patch) PR: conf/121064 Submitted by: koitsu Reviewed by: gcooper, adrian (co-mentor) Approved by: adrian (co-mentor) Modified: head/sys/boot/forth/frames.4th head/sys/boot/forth/support.4th Modified: head/sys/boot/forth/frames.4th ============================================================================== --- head/sys/boot/forth/frames.4th Sun Dec 9 09:58:44 2012 (r244047) +++ head/sys/boot/forth/frames.4th Sun Dec 9 15:25:34 2012 (r244048) @@ -12,6 +12,11 @@ variable rt_el variable rb_el variable fill +\ ASCII frames (used when serial console is detected) + 45 constant ascii_dash +124 constant ascii_pipe + 43 constant ascii_plus + s" arch-pc98" environment? [if] \ Single frames 149 constant sh_el @@ -63,7 +68,17 @@ s" arch-pc98" environment? [if] loop ; +: f_ascii ( -- ) ( -- ) \ set frames to ascii + ascii_dash h_el ! + ascii_pipe v_el ! + ascii_plus lt_el ! + ascii_plus lb_el ! + ascii_plus rt_el ! + ascii_plus rb_el ! +; + : f_single ( -- ) \ set frames to single + boot_serial? if f_ascii exit then sh_el h_el ! sv_el v_el ! slt_el lt_el ! @@ -73,6 +88,7 @@ s" arch-pc98" environment? [if] ; : f_double ( -- ) \ set frames to double + boot_serial? if f_ascii exit then dh_el h_el ! dv_el v_el ! dlt_el lt_el ! Modified: head/sys/boot/forth/support.4th ============================================================================== --- head/sys/boot/forth/support.4th Sun Dec 9 09:58:44 2012 (r244047) +++ head/sys/boot/forth/support.4th Sun Dec 9 15:25:34 2012 (r244048) @@ -201,6 +201,46 @@ create last_module_option sizeof module. : getenv? getenv -1 = if false else drop true then ; +\ determine if a word appears in a string, case-insensitive +: contains? ( addr1 len1 addr2 len2 -- 0 | -1 ) + 2 pick 0= if 2drop 2drop true exit then + dup 0= if 2drop 2drop false exit then + begin + begin + swap dup c@ dup 32 = over 9 = or + over 10 = or over 13 = or swap drop + while 1+ swap 1- repeat + swap 2 pick 1- over < + while + 2over 2over drop over compare-insensitive 0= if + 2 pick over = if 2drop 2drop true exit then + 2 pick tuck - -rot + swap over c@ dup 32 = + over 9 = or over 10 = or over 13 = or + swap drop if 2drop 2drop true exit then + then begin + swap dup c@ + dup 32 = over 9 = or over 10 = or over 13 = or + swap drop if false else true then 2 pick 0> and + while 1+ swap 1- repeat + swap + repeat + 2drop 2drop false +; + +: boot_serial? ( -- 0 | -1 ) + s" console" getenv dup -1 <> if + s" comconsole" 2swap contains? + else drop false then + s" boot_serial" getenv dup -1 <> if + swap drop 0> + else drop false then + or \ console contains comconsole ( or ) boot_serial + s" boot_multicons" getenv dup -1 <> if + swap drop 0> + else drop false then + or \ previous boolean ( or ) boot_multicons +; + \ Private definitions vocabulary support-functions From owner-svn-src-head@FreeBSD.ORG Sun Dec 9 17:27:44 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 700FA8A1; Sun, 9 Dec 2012 17:27:44 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id 502338FC12; Sun, 9 Dec 2012 17:27:42 +0000 (UTC) Received: by mail-la0-f54.google.com with SMTP id j13so1828815lah.13 for ; Sun, 09 Dec 2012 09:27:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=BdjMQY+z/SKGfcSntiLKelDdhYnzYFUmP3jlrWLv+v8=; b=gn8kwOS7NIW7KrZN5TWxtuiPJsokRGiihL06aC/u+Vdva455bIhB0hQLSaTo4njoDc OWrR1S5L+lMNtdYD9lm8SNIjxHyowz0lr5Gvuxl0pStTB3Te/pCAyOr5MjDghYEJSJ45 wUGo0tEzuvqiTZXd7XHy1wmMVfCx31YbyDwXyV6/+v5miOkWmhJW2FQn6uy7biCzkIxI Kw2XyhwI5XPIIJ5+nK0nzM+i9o97SGoqIVISurTHSXcq8hQ/jTzRIUkW+8m7yaBsgmxq sS58RKIPzBjrA9JdlIgDoKxu1pVccKrR3Zreem9yIjBIhfNAdc00dJ480Dl6OfVD0dsX ZX9A== MIME-Version: 1.0 Received: by 10.112.84.168 with SMTP id a8mr4810670lbz.75.1355074062073; Sun, 09 Dec 2012 09:27:42 -0800 (PST) Sender: asmrookie@gmail.com Received: by 10.112.84.193 with HTTP; Sun, 9 Dec 2012 09:27:41 -0800 (PST) In-Reply-To: <201211251422.qAPEM8BV074656@svn.freebsd.org> References: <201211251422.qAPEM8BV074656@svn.freebsd.org> Date: Sun, 9 Dec 2012 17:27:41 +0000 X-Google-Sender-Auth: a7Kkxz9PMzXXOI4Xip0qi5vCKfA Message-ID: Subject: Re: svn commit: r243515 - head/sys/kern From: Attilio Rao To: Andriy Gapon Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: attilio@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: Sun, 09 Dec 2012 17:27:44 -0000 On Sun, Nov 25, 2012 at 2:22 PM, Andriy Gapon wrote: > Author: avg > Date: Sun Nov 25 14:22:08 2012 > New Revision: 243515 > URL: http://svnweb.freebsd.org/changeset/base/243515 > > Log: > remove stop_scheduler_on_panic knob > > There has not been any complaints about the default behavior, so there > is no need to keep a knob that enables the worse alternative. > > Now that the hard-stopping of other CPUs is the only behavior, the panic_cpu > spinlock-like logic can be dropped, because only a single CPU is > supposed to win stop_cpus_hard(other_cpus) race and proceed past that > call. While this is true for the sane case, for the case report by Ryan this still breaks. Infact, immagine CPU0 (winner) and CPU1 (looser) both panic'ing. CPU0 wins and then sets stopping_cpu. When the deadlock happens in the spinning loop, because of generic_stop_cpus() logic CPU0 won't deadlock and will correctly continue, but the problem is that it sets back stopping_cpu to NOCPU, letting CPU1 continuing too and then deadlocking. At the minimum, what I think that should happen is to have the check in panic() as prior this change but with the add I outlined (thus we need to generalize cpustop_handler()). However, it seems to me that generic_stop_cpus() may still be broken by this and we eventually need to fix it. I would then revert this part of the patch and fix it appropriately. Later we can better discuss the generic_stop_cpus() similar race. Thanks, Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-head@FreeBSD.ORG Sun Dec 9 17:51:24 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B28C8E16; Sun, 9 Dec 2012 17:51:24 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx1.freebsd.org (Postfix) with ESMTP id 9C1F28FC0C; Sun, 9 Dec 2012 17:51:23 +0000 (UTC) Received: by mail-lb0-f182.google.com with SMTP id go10so1920990lbb.13 for ; Sun, 09 Dec 2012 09:51:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=3iCi0Hk1r20dghuz1lyN0yJI6F9AZjQ9yOaOBkPbB/E=; b=x1Zzf3JZa8Q3Iu+HEyqxJ+lEyuDhEQUkBAVkpC10ANHJKMr2fWTqD/Mk2T6hzNkTxu OgWAMehDm9Gk/GWFH5ja/V6wyJfSRYriHZcpVoG1OQ3mnXVvAyCGez2DRSPhDXRDgxTa KwSZ3Yke5NxbfU4sDgn0M9knGnMKI6zl0Ggg2EHfiKPpifIEVDewPBhY9JQW0gEpNsS0 dulxKA3HsMiZf8yGk1B+FcAtmEvsaEqTRprAL58am78xYuzUTyGqW5e/4FbOFNvOp0sy +JePIZHtmsT1dChYiIdfoZ52e+pUCnDGJZdnOkSAryDqFZiHNmsFtUdtk0XRlgWk2P8s vwGg== MIME-Version: 1.0 Received: by 10.112.87.40 with SMTP id u8mr5054504lbz.50.1355075481404; Sun, 09 Dec 2012 09:51:21 -0800 (PST) Sender: asmrookie@gmail.com Received: by 10.112.84.193 with HTTP; Sun, 9 Dec 2012 09:51:21 -0800 (PST) In-Reply-To: <201206120014.q5C0EsqK018853@svn.freebsd.org> References: <201206120014.q5C0EsqK018853@svn.freebsd.org> Date: Sun, 9 Dec 2012 17:51:21 +0000 X-Google-Sender-Auth: KVT3G0Wzz-egBYGvmiH3iBrf5xs Message-ID: Subject: Re: svn commit: r236938 - in head/sys: amd64/amd64 amd64/include i386/i386 i386/include x86/acpica From: Attilio Rao To: Mitsuru IWASAKI Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: attilio@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: Sun, 09 Dec 2012 17:51:24 -0000 On Tue, Jun 12, 2012 at 1:14 AM, Mitsuru IWASAKI wrote: > Author: iwasaki > Date: Tue Jun 12 00:14:54 2012 > New Revision: 236938 > URL: http://svn.freebsd.org/changeset/base/236938 > > Log: > Share IPI init and startup code of mp_machdep.c with acpi_wakeup.c > as ipi_startup(). > > Modified: > head/sys/amd64/amd64/mp_machdep.c > head/sys/amd64/include/smp.h I think that after these changes smp.h should go in x86/ subdir. Infact now amd64 and i386 version are so similar that they can do safely be merged (the only difference being the lazypmap ipi counter and the mpboot exports. If you are interested into it, please make a patch, I'd be happy to review. Thanks, Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-head@FreeBSD.ORG Sun Dec 9 18:06:28 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id ECAFB4B0; Sun, 9 Dec 2012 18:06:28 +0000 (UTC) (envelope-from flo@smeets.im) Received: from mail.solomo.de (mail.solomo.de [5.9.87.18]) by mx1.freebsd.org (Postfix) with ESMTP id 980AF8FC12; Sun, 9 Dec 2012 18:06:28 +0000 (UTC) Received: from cpos1.nexxtmobile.de (localhost [127.0.0.1]) by mail.solomo.de (Postfix) with ESMTP id D4E301005; Sun, 9 Dec 2012 19:06:26 +0100 (CET) X-Virus-Scanned: amavisd-new at nexxtmobile.de Received: from mail.solomo.de ([127.0.0.1]) by cpos1.nexxtmobile.de (cpos1.nexxtmobile.de [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 1v6qjIdiJvJp; Sun, 9 Dec 2012 19:06:24 +0100 (CET) Received: from nibbler-osx.local (b2b-92-50-66-163.unitymedia.biz [92.50.66.163]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mail.solomo.de (Postfix) with ESMTPSA id 4E64E1FF9; Sun, 9 Dec 2012 19:06:23 +0100 (CET) Message-ID: <50C4D31E.4080000@smeets.im> Date: Sun, 09 Dec 2012 19:06:22 +0100 From: Florian Smeets User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:20.0) Gecko/20100101 Thunderbird/20.0a1 MIME-Version: 1.0 To: Andre Oppermann , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r243147 - head/usr.bin/fetch References: <201211161205.qAGC5Bwr081144@svn.freebsd.org> In-Reply-To: <201211161205.qAGC5Bwr081144@svn.freebsd.org> X-Enigmail-Version: 1.5a1pre Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="----enig2XUNTGKQQBDLJVEWGJVBS" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 09 Dec 2012 18:06:29 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2XUNTGKQQBDLJVEWGJVBS Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 16.11.12 13:05, Andre Oppermann wrote: > Author: andre > Date: Fri Nov 16 12:05:10 2012 > New Revision: 243147 > URL: http://svnweb.freebsd.org/changeset/base/243147 >=20 > Log: > Change fetch(1) to: > =20 > o Report the instantaneous bandwidth instead of an average since the > beginning of the download. > =20 > o At the finish of the download report the average bandwidth and also= > the total time it took instead of 00m00s. > =20 Andre, it looks like this change breaks the bandwidth calculation when using -r 52% of 146 MB -25199509 Bps 03m28s Going back to r243146 fixes it. Florian ------enig2XUNTGKQQBDLJVEWGJVBS Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iEYEARECAAYFAlDE0x4ACgkQapo8P8lCvwlBsgCeK1XRwTcFa68HE3bfiOEeD7NV 78AAoNTJTMNNcACYSMfyA1IelgDuCsND =HR+/ -----END PGP SIGNATURE----- ------enig2XUNTGKQQBDLJVEWGJVBS-- From owner-svn-src-head@FreeBSD.ORG Sun Dec 9 18:27:42 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E5C539D6; Sun, 9 Dec 2012 18:27:42 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wg0-f52.google.com (mail-wg0-f52.google.com [74.125.82.52]) by mx1.freebsd.org (Postfix) with ESMTP id E264F8FC12; Sun, 9 Dec 2012 18:27:41 +0000 (UTC) Received: by mail-wg0-f52.google.com with SMTP id 12so1308902wgh.31 for ; Sun, 09 Dec 2012 10:27:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=/VbGk2qhT8BouDMTJNHk9WZN4QQhNjKcqvFzJ29T5zE=; b=QX9bEvdXUCNHXKCS09Y2aYnE23g9H22f7pfQWDhtjT6AwGCgGhxo2B+tWYhMxccOTd r0s6hxI2wpabBzIy6jZh5hYebW8BO1+T/Jkxf/Merm24cD6MGlnuK3Epbrh0GDUMZ4Wf lMh89fP9kBxFp8E3QNKUUvQt3emnfmIPGYFVn0oBg8prqnerxsA4P7mUoeArx+xq4r3Z D8VKYKZK4kavZKBwQI9UHDPrzvHOgYQW/CJs89vGuuN0oXJiWtg0DSJYlPXrtOmMiiNJ EO+y0TNY6YXyjS/EjYVYnHEQBk0I3/YVeR53dU90Z6tPcqKS3sbufkN2uH9qP9QRVBPm IK0A== Received: by 10.180.106.34 with SMTP id gr2mr7209066wib.18.1355077660433; Sun, 09 Dec 2012 10:27:40 -0800 (PST) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by mx.google.com with ESMTPS id t17sm8038708wiv.6.2012.12.09.10.27.38 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 09 Dec 2012 10:27:39 -0800 (PST) Date: Sun, 9 Dec 2012 19:27:30 +0100 From: Mateusz Guzik To: Florian Smeets Subject: Re: svn commit: r243147 - head/usr.bin/fetch Message-ID: <20121209182730.GA28989@dft-labs.eu> References: <201211161205.qAGC5Bwr081144@svn.freebsd.org> <50C4D31E.4080000@smeets.im> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <50C4D31E.4080000@smeets.im> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Andre Oppermann X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 09 Dec 2012 18:27:43 -0000 On Sun, Dec 09, 2012 at 07:06:22PM +0100, Florian Smeets wrote: > On 16.11.12 13:05, Andre Oppermann wrote: > > Author: andre > > Date: Fri Nov 16 12:05:10 2012 > > New Revision: 243147 > > URL: http://svnweb.freebsd.org/changeset/base/243147 > > > > Log: > > Change fetch(1) to: > > > > o Report the instantaneous bandwidth instead of an average since the > > beginning of the download. > > > > o At the finish of the download report the average bandwidth and also > > the total time it took instead of 00m00s. > > > > Andre, > > it looks like this change breaks the bandwidth calculation when using -r > > 52% of 146 MB -25199509 Bps 03m28s > > Going back to r243146 fixes it. > Try this: diff --git a/usr.bin/fetch/fetch.c b/usr.bin/fetch/fetch.c index 025fcdc..e723d40 100644 --- a/usr.bin/fetch/fetch.c +++ b/usr.bin/fetch/fetch.c @@ -243,7 +243,7 @@ stat_start(struct xferstat *xs, const char *name, off_t size, off_t of gettimeofday(&xs->start, NULL); xs->last.tv_sec = xs->last.tv_usec = 0; xs->size = size; - xs->offset = offset; + xs->offset = 0; xs->rcvd = offset; xs->lastrcvd = offset; if (v_tty && v_level > 0) -- Mateusz Guzik From owner-svn-src-head@FreeBSD.ORG Sun Dec 9 18:42:08 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 43BFBE4F; Sun, 9 Dec 2012 18:42:08 +0000 (UTC) (envelope-from flo@smeets.im) Received: from mail.solomo.de (mail.solomo.de [5.9.87.18]) by mx1.freebsd.org (Postfix) with ESMTP id DB6318FC08; Sun, 9 Dec 2012 18:42:07 +0000 (UTC) Received: from cpos1.nexxtmobile.de (localhost [127.0.0.1]) by mail.solomo.de (Postfix) with ESMTP id E4EC5108A; Sun, 9 Dec 2012 19:42:06 +0100 (CET) X-Virus-Scanned: amavisd-new at nexxtmobile.de Received: from mail.solomo.de ([127.0.0.1]) by cpos1.nexxtmobile.de (cpos1.nexxtmobile.de [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 6a3prhVXlyid; Sun, 9 Dec 2012 19:42:05 +0100 (CET) Received: from nibbler-osx.local (b2b-92-50-66-163.unitymedia.biz [92.50.66.163]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mail.solomo.de (Postfix) with ESMTPSA id 3C1801081; Sun, 9 Dec 2012 19:42:04 +0100 (CET) Message-ID: <50C4DB7A.9050302@smeets.im> Date: Sun, 09 Dec 2012 19:42:02 +0100 From: Florian Smeets User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:20.0) Gecko/20100101 Thunderbird/20.0a1 MIME-Version: 1.0 To: Mateusz Guzik Subject: Re: svn commit: r243147 - head/usr.bin/fetch References: <201211161205.qAGC5Bwr081144@svn.freebsd.org> <50C4D31E.4080000@smeets.im> <20121209182730.GA28989@dft-labs.eu> In-Reply-To: <20121209182730.GA28989@dft-labs.eu> X-Enigmail-Version: 1.5a1pre Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="----enig2OQMAESFMISHHKKNJLKDJ" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Andre Oppermann X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 09 Dec 2012 18:42:08 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2OQMAESFMISHHKKNJLKDJ Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 09.12.12 19:27, Mateusz Guzik wrote: > On Sun, Dec 09, 2012 at 07:06:22PM +0100, Florian Smeets wrote: >> On 16.11.12 13:05, Andre Oppermann wrote: >>> Author: andre >>> Date: Fri Nov 16 12:05:10 2012 >>> New Revision: 243147 >>> URL: http://svnweb.freebsd.org/changeset/base/243147 >>> >>> Log: >>> Change fetch(1) to: >>> =20 >>> o Report the instantaneous bandwidth instead of an average since th= e >>> beginning of the download. >>> =20 >>> o At the finish of the download report the average bandwidth and al= so >>> the total time it took instead of 00m00s. >>> =20 >> >> Andre, >> >> it looks like this change breaks the bandwidth calculation when using = -r >> >> 52% of 146 MB -25199509 Bps 03m28s >> >> Going back to r243146 fixes it. >> >=20 > Try this: > diff --git a/usr.bin/fetch/fetch.c b/usr.bin/fetch/fetch.c > index 025fcdc..e723d40 100644 > --- a/usr.bin/fetch/fetch.c > +++ b/usr.bin/fetch/fetch.c > @@ -243,7 +243,7 @@ stat_start(struct xferstat *xs, const char *name, o= ff_t size, off_t of > gettimeofday(&xs->start, NULL); > xs->last.tv_sec =3D xs->last.tv_usec =3D 0; > xs->size =3D size; > - xs->offset =3D offset; > + xs->offset =3D 0; > xs->rcvd =3D offset; > xs->lastrcvd =3D offset; > if (v_tty && v_level > 0) >=20 That way the bandwidth calculation looks OK but now it counts the time since starting to resume the download and not the time left :) 63% of 146 MB 7069 kBps 00m07s Florian ------enig2OQMAESFMISHHKKNJLKDJ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iEYEARECAAYFAlDE23oACgkQapo8P8lCvwnVaQCdHhGGQsFzDMcqve+kVqsGsFEJ 4OkAoJUIEMjAovUsgNbos0ASjrAXmbO/ =2JJ9 -----END PGP SIGNATURE----- ------enig2OQMAESFMISHHKKNJLKDJ-- From owner-svn-src-head@FreeBSD.ORG Sun Dec 9 19:01:33 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 065D44B9; Sun, 9 Dec 2012 19:01:33 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wi0-f174.google.com (mail-wi0-f174.google.com [209.85.212.174]) by mx1.freebsd.org (Postfix) with ESMTP id 0BC808FC14; Sun, 9 Dec 2012 19:01:31 +0000 (UTC) Received: by mail-wi0-f174.google.com with SMTP id hm9so679611wib.13 for ; Sun, 09 Dec 2012 11:01:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=8eRDa8ifi1KxbXGDQY7hAuZmOkSeVgHqMJ0GSy1N/IE=; b=H2zbTIPRi9AuUCAwJnHH+tvGobvtoDEFBnfzI/7GSA2nCNfdw008zAIjzt/GrytKZk nCndFK+EczHoLZcyPhVkHpRHa1zJJjgIS768MfhdISkDrvYSqLXRtZc6Uz1MTVfxbTRl 14T2SHtpR2gpUMiAzs/XDEytek2HXvosB8dxRQPQ94P91dg5ww2vk4YCudTzKT5rYswW TmCiJCBCQ6rZZWa5zvp6PdPDAVoHPm5Q1wedT+NboXJHI0NOlJOVZGx8bfPVErfrNc7h 78sDTHleKjf6pAKwoqkQAZXwkYi8BjNzOpHz9y0Mu3KiUfYZs6tARp/lwfW7D9UQ237C sSxQ== Received: by 10.180.75.135 with SMTP id c7mr7309616wiw.10.1355079690935; Sun, 09 Dec 2012 11:01:30 -0800 (PST) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by mx.google.com with ESMTPS id w5sm8159012wiz.10.2012.12.09.11.01.28 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 09 Dec 2012 11:01:29 -0800 (PST) Date: Sun, 9 Dec 2012 20:01:20 +0100 From: Mateusz Guzik To: Florian Smeets Subject: Re: svn commit: r243147 - head/usr.bin/fetch Message-ID: <20121209190120.GB28989@dft-labs.eu> References: <201211161205.qAGC5Bwr081144@svn.freebsd.org> <50C4D31E.4080000@smeets.im> <20121209182730.GA28989@dft-labs.eu> <50C4DB7A.9050302@smeets.im> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <50C4DB7A.9050302@smeets.im> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Andre Oppermann X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 09 Dec 2012 19:01:33 -0000 On Sun, Dec 09, 2012 at 07:42:02PM +0100, Florian Smeets wrote: > On 09.12.12 19:27, Mateusz Guzik wrote: > > On Sun, Dec 09, 2012 at 07:06:22PM +0100, Florian Smeets wrote: > >> On 16.11.12 13:05, Andre Oppermann wrote: > >>> Author: andre > >>> Date: Fri Nov 16 12:05:10 2012 > >>> New Revision: 243147 > >>> URL: http://svnweb.freebsd.org/changeset/base/243147 > >>> > >>> Log: > >>> Change fetch(1) to: > >>> > >>> o Report the instantaneous bandwidth instead of an average since the > >>> beginning of the download. > >>> > >>> o At the finish of the download report the average bandwidth and also > >>> the total time it took instead of 00m00s. > >>> > >> > >> Andre, > >> > >> it looks like this change breaks the bandwidth calculation when using -r > >> > >> 52% of 146 MB -25199509 Bps 03m28s > >> > >> Going back to r243146 fixes it. > >> > > > > Try this: > > diff --git a/usr.bin/fetch/fetch.c b/usr.bin/fetch/fetch.c > > index 025fcdc..e723d40 100644 > > --- a/usr.bin/fetch/fetch.c > > +++ b/usr.bin/fetch/fetch.c > > @@ -243,7 +243,7 @@ stat_start(struct xferstat *xs, const char *name, off_t size, off_t of > > gettimeofday(&xs->start, NULL); > > xs->last.tv_sec = xs->last.tv_usec = 0; > > xs->size = size; > > - xs->offset = offset; > > + xs->offset = 0; > > xs->rcvd = offset; > > xs->lastrcvd = offset; > > if (v_tty && v_level > 0) > > > > That way the bandwidth calculation looks OK but now it counts the time > since starting to resume the download and not the time left :) > > 63% of 146 MB 7069 kBps 00m07s > Oops.. revert that and try this instead: diff --git a/usr.bin/fetch/fetch.c b/usr.bin/fetch/fetch.c index 025fcdc..d3e9b21 100644 --- a/usr.bin/fetch/fetch.c +++ b/usr.bin/fetch/fetch.c @@ -183,7 +183,7 @@ stat_bps(struct xferstat *xs) if (delta == 0.0) { snprintf(str, sizeof str, "?? Bps"); } else { - bps = (xs->rcvd - xs->lastrcvd - xs->offset) / delta; + bps = (xs->rcvd - xs->lastrcvd) / delta; snprintf(str, sizeof str, "%sps", stat_bytes((off_t)bps)); } return (str); -- Mateusz Guzik From owner-svn-src-head@FreeBSD.ORG Sun Dec 9 19:20:29 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 995AE8CC; Sun, 9 Dec 2012 19:20:29 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 738668FC12; Sun, 9 Dec 2012 19:20:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB9JKT73010063; Sun, 9 Dec 2012 19:20:29 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB9JKTF7010061; Sun, 9 Dec 2012 19:20:29 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201212091920.qB9JKTF7010061@svn.freebsd.org> From: Adrian Chadd Date: Sun, 9 Dec 2012 19:20:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244051 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 09 Dec 2012 19:20:29 -0000 Author: adrian Date: Sun Dec 9 19:20:28 2012 New Revision: 244051 URL: http://svnweb.freebsd.org/changeset/base/244051 Log: Atheros SuperG bug fixes, as part of hunting down kern/174283. The stageqdepth (global, over all staging queues) was being kept incorrectly. It was being incremented whenever things were added, but only decremented during a flush. During active fast frames activity it wasn't being decremented, resulting in it always having a non-zero value during normal fast-frames operation. It was only used when checking if the aging queue should be checked; we may as well just defer to each of those staging queue counters (which look correct, thankfully.) Whilst I'm here, add locking assertions in the staging queue add/remove functions. The current crash shows that the staging queue has one frame, but only has a tail pointer set (the head pointer being set to NULL.) I'd like to grab a few more crashes where these locking assertions are in place so I can narrow down the issue between "somehow locking is messed up and things are racy" and "the stage queue head/tail pointer manipulation logic is subtly wrong." Tested: * AR5416 STA, AR5413 AP; with FastFrames enabled in the AR5416 HAL. PR: kern/174283 Modified: head/sys/net80211/ieee80211_superg.c head/sys/net80211/ieee80211_superg.h Modified: head/sys/net80211/ieee80211_superg.c ============================================================================== --- head/sys/net80211/ieee80211_superg.c Sun Dec 9 18:45:59 2012 (r244050) +++ head/sys/net80211/ieee80211_superg.c Sun Dec 9 19:20:28 2012 (r244051) @@ -560,7 +560,6 @@ void ieee80211_ff_age(struct ieee80211com *ic, struct ieee80211_stageq *sq, int quanta) { - struct ieee80211_superg *sg = ic->ic_superg; struct mbuf *m, *head; struct ieee80211_node *ni; struct ieee80211_tx_ampdu *tap; @@ -582,7 +581,6 @@ ieee80211_ff_age(struct ieee80211com *ic sq->head = m->m_nextpkt; sq->depth--; - sg->ff_stageqdepth--; } if (m == NULL) sq->tail = NULL; @@ -594,9 +592,12 @@ ieee80211_ff_age(struct ieee80211com *ic } static void -stageq_add(struct ieee80211_stageq *sq, struct mbuf *m) +stageq_add(struct ieee80211com *ic, struct ieee80211_stageq *sq, struct mbuf *m) { int age = ieee80211_ffagemax; + + IEEE80211_LOCK_ASSERT(ic); + if (sq->tail != NULL) { sq->tail->m_nextpkt = m; age -= M_AGE_GET(sq->head); @@ -610,10 +611,12 @@ stageq_add(struct ieee80211_stageq *sq, } static void -stageq_remove(struct ieee80211_stageq *sq, struct mbuf *mstaged) +stageq_remove(struct ieee80211com *ic, struct ieee80211_stageq *sq, struct mbuf *mstaged) { struct mbuf *m, *mprev; + IEEE80211_LOCK_ASSERT(ic); + mprev = NULL; for (m = sq->head; m != NULL; m = m->m_nextpkt) { if (m == mstaged) { @@ -725,7 +728,7 @@ ieee80211_ff_check(struct ieee80211_node tap->txa_private = NULL; if (mstaged != NULL) - stageq_remove(sq, mstaged); + stageq_remove(ic, sq, mstaged); IEEE80211_UNLOCK(ic); if (mstaged != NULL) { @@ -745,7 +748,7 @@ ieee80211_ff_check(struct ieee80211_node */ if (mstaged != NULL) { tap->txa_private = NULL; - stageq_remove(sq, mstaged); + stageq_remove(ic, sq, mstaged); IEEE80211_UNLOCK(ic); IEEE80211_NOTE(vap, IEEE80211_MSG_SUPERG, ni, @@ -766,8 +769,7 @@ ieee80211_ff_check(struct ieee80211_node ("txa_private %p", tap->txa_private)); tap->txa_private = m; - stageq_add(sq, m); - sg->ff_stageqdepth++; + stageq_add(ic, sq, m); IEEE80211_UNLOCK(ic); IEEE80211_NOTE(vap, IEEE80211_MSG_SUPERG, ni, @@ -806,7 +808,7 @@ ieee80211_ff_node_cleanup(struct ieee802 m = tap->txa_private; if (m != NULL) { tap->txa_private = NULL; - stageq_remove(&sg->ff_stageq[ac], m); + stageq_remove(ic, &sg->ff_stageq[ac], m); m->m_nextpkt = head; head = m; } Modified: head/sys/net80211/ieee80211_superg.h ============================================================================== --- head/sys/net80211/ieee80211_superg.h Sun Dec 9 18:45:59 2012 (r244050) +++ head/sys/net80211/ieee80211_superg.h Sun Dec 9 19:20:28 2012 (r244051) @@ -66,7 +66,6 @@ struct ieee80211_stageq { struct ieee80211_superg { /* fast-frames staging q */ struct ieee80211_stageq ff_stageq[WME_NUM_AC]; - int ff_stageqdepth; /* cumulative depth */ }; void ieee80211_superg_attach(struct ieee80211com *); @@ -109,7 +108,7 @@ ieee80211_ff_age_all(struct ieee80211com { struct ieee80211_superg *sg = ic->ic_superg; - if (sg != NULL && sg->ff_stageqdepth) { + if (sg != NULL) { if (sg->ff_stageq[WME_AC_VO].depth) ieee80211_ff_age(ic, &sg->ff_stageq[WME_AC_VO], quanta); if (sg->ff_stageq[WME_AC_VI].depth) From owner-svn-src-head@FreeBSD.ORG Sun Dec 9 19:53:22 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0A6804C2; Sun, 9 Dec 2012 19:53:22 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E335D8FC14; Sun, 9 Dec 2012 19:53:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB9JrLnc016537; Sun, 9 Dec 2012 19:53:21 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB9JrL34016535; Sun, 9 Dec 2012 19:53:21 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201212091953.qB9JrL34016535@svn.freebsd.org> From: "Kenneth D. Merry" Date: Sun, 9 Dec 2012 19:53:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244052 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 09 Dec 2012 19:53:22 -0000 Author: ken Date: Sun Dec 9 19:53:21 2012 New Revision: 244052 URL: http://svnweb.freebsd.org/changeset/base/244052 Log: Fix a couple of CTL locking issues and clean up some duplicated code. ctl_frontend_cam_sim.c: Coalesce cfcs_online() and cfcs_offline() into a single function since these were identical except for one line. Make sure we hold the SIM lock around path creation, and calling xpt_rescan(). scsi_ctl.c: In ctlfe_onoffline(), make sure we hold the SIM lock around path creation and free calls, as well as xpt_action(). In ctlfe_lun_enable(), hold the SIM lock around path and peripheral operations that require it. Sponsored by: Spectra Logic Corporation MFC after: 1 week Modified: head/sys/cam/ctl/ctl_frontend_cam_sim.c head/sys/cam/ctl/scsi_ctl.c Modified: head/sys/cam/ctl/ctl_frontend_cam_sim.c ============================================================================== --- head/sys/cam/ctl/ctl_frontend_cam_sim.c Sun Dec 9 19:20:28 2012 (r244051) +++ head/sys/cam/ctl/ctl_frontend_cam_sim.c Sun Dec 9 19:53:21 2012 (r244052) @@ -275,7 +275,7 @@ cfcs_shutdown(void) } static void -cfcs_online(void *arg) +cfcs_onoffline(void *arg, int online) { struct cfcs_softc *softc; union ccb *ccb; @@ -283,13 +283,12 @@ cfcs_online(void *arg) softc = (struct cfcs_softc *)arg; mtx_lock(&softc->lock); - softc->online = 1; - mtx_unlock(&softc->lock); + softc->online = online; ccb = xpt_alloc_ccb_nowait(); if (ccb == NULL) { printf("%s: unable to allocate CCB for rescan\n", __func__); - return; + goto bailout; } if (xpt_create_path(&ccb->ccb_h.path, xpt_periph, @@ -297,37 +296,24 @@ cfcs_online(void *arg) CAM_LUN_WILDCARD) != CAM_REQ_CMP) { printf("%s: can't allocate path for rescan\n", __func__); xpt_free_ccb(ccb); - return; + goto bailout; } xpt_rescan(ccb); + +bailout: + mtx_unlock(&softc->lock); } static void -cfcs_offline(void *arg) +cfcs_online(void *arg) { - struct cfcs_softc *softc; - union ccb *ccb; - - softc = (struct cfcs_softc *)arg; - - mtx_lock(&softc->lock); - softc->online = 0; - mtx_unlock(&softc->lock); - - ccb = xpt_alloc_ccb_nowait(); - if (ccb == NULL) { - printf("%s: unable to allocate CCB for rescan\n", __func__); - return; - } + cfcs_onoffline(arg, /*online*/ 1); +} - if (xpt_create_path(&ccb->ccb_h.path, xpt_periph, - cam_sim_path(softc->sim), CAM_TARGET_WILDCARD, - CAM_LUN_WILDCARD) != CAM_REQ_CMP) { - printf("%s: can't allocate path for rescan\n", __func__); - xpt_free_ccb(ccb); - return; - } - xpt_rescan(ccb); +static void +cfcs_offline(void *arg) +{ + cfcs_onoffline(arg, /*online*/ 0); } static int Modified: head/sys/cam/ctl/scsi_ctl.c ============================================================================== --- head/sys/cam/ctl/scsi_ctl.c Sun Dec 9 19:20:28 2012 (r244051) +++ head/sys/cam/ctl/scsi_ctl.c Sun Dec 9 19:53:21 2012 (r244052) @@ -1687,16 +1687,21 @@ ctlfe_onoffline(void *arg, int online) set_wwnn = 0; + sim = bus_softc->sim; + + CAM_SIM_LOCK(sim); status = xpt_create_path(&path, /*periph*/ NULL, bus_softc->path_id, CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD); if (status != CAM_REQ_CMP) { printf("%s: unable to create path!\n", __func__); + CAM_SIM_UNLOCK(sim); return; } + CAM_SIM_UNLOCK(sim); + ccb = (union ccb *)malloc(sizeof(*ccb), M_TEMP, M_WAITOK | M_ZERO); xpt_setup_ccb(&ccb->ccb_h, path, CAM_PRIORITY_NONE); - sim = xpt_path_sim(path); /* * Copan WWN format: @@ -1883,27 +1888,30 @@ ctlfe_lun_enable(void *arg, struct ctl_i bus_softc = (struct ctlfe_softc *)arg; + sim = bus_softc->sim; + + CAM_SIM_LOCK(sim); - status = xpt_create_path_unlocked(&path, /*periph*/ NULL, - bus_softc->path_id, - targ_id.id, - lun_id); + status = xpt_create_path(&path, /*periph*/ NULL, bus_softc->path_id, + targ_id.id, lun_id); /* XXX KDM need some way to return status to CTL here? */ if (status != CAM_REQ_CMP) { printf("%s: could not create path, status %#x\n", __func__, status); + CAM_SIM_UNLOCK(sim); return (1); } + CAM_SIM_UNLOCK(sim); softc = malloc(sizeof(*softc), M_CTLFE, M_WAITOK | M_ZERO); - sim = xpt_path_sim(path); - mtx_lock(sim->mtx); + + CAM_SIM_LOCK(sim); periph = cam_periph_find(path, "ctl"); if (periph != NULL) { /* We've already got a periph, no need to alloc a new one. */ xpt_free_path(path); free(softc, M_CTLFE); - mtx_unlock(sim->mtx); + CAM_SIM_UNLOCK(sim); return (0); } @@ -1923,7 +1931,7 @@ ctlfe_lun_enable(void *arg, struct ctl_i xpt_free_path(path); - mtx_unlock(sim->mtx); + CAM_SIM_UNLOCK(sim); return (0); } From owner-svn-src-head@FreeBSD.ORG Sun Dec 9 19:53:57 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F3341631; Sun, 9 Dec 2012 19:53:56 +0000 (UTC) (envelope-from flo@smeets.im) Received: from mail.solomo.de (mail.solomo.de [5.9.87.18]) by mx1.freebsd.org (Postfix) with ESMTP id 7241C8FC14; Sun, 9 Dec 2012 19:53:56 +0000 (UTC) Received: from cpos1.nexxtmobile.de (localhost [127.0.0.1]) by mail.solomo.de (Postfix) with ESMTP id 867241214; Sun, 9 Dec 2012 20:53:54 +0100 (CET) X-Virus-Scanned: amavisd-new at nexxtmobile.de Received: from mail.solomo.de ([127.0.0.1]) by cpos1.nexxtmobile.de (cpos1.nexxtmobile.de [127.0.0.1]) (amavisd-new, port 10024) with LMTP id r-MBOwv5F49L; Sun, 9 Dec 2012 20:53:52 +0100 (CET) Received: from nibbler-osx.local (b2b-92-50-66-163.unitymedia.biz [92.50.66.163]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mail.solomo.de (Postfix) with ESMTPSA id F1BD3120B; Sun, 9 Dec 2012 20:53:51 +0100 (CET) Message-ID: <50C4EC4E.6060006@smeets.im> Date: Sun, 09 Dec 2012 20:53:50 +0100 From: Florian Smeets User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:20.0) Gecko/20100101 Thunderbird/20.0a1 MIME-Version: 1.0 To: Mateusz Guzik Subject: Re: svn commit: r243147 - head/usr.bin/fetch References: <201211161205.qAGC5Bwr081144@svn.freebsd.org> <50C4D31E.4080000@smeets.im> <20121209182730.GA28989@dft-labs.eu> <50C4DB7A.9050302@smeets.im> <20121209190120.GB28989@dft-labs.eu> In-Reply-To: <20121209190120.GB28989@dft-labs.eu> X-Enigmail-Version: 1.5a1pre Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="----enig2GWMXOHKMAEKERRJRPQUQ" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Andre Oppermann X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 09 Dec 2012 19:53:57 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2GWMXOHKMAEKERRJRPQUQ Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 09.12.12 20:01, Mateusz Guzik wrote: > On Sun, Dec 09, 2012 at 07:42:02PM +0100, Florian Smeets wrote: >> On 09.12.12 19:27, Mateusz Guzik wrote: >>> On Sun, Dec 09, 2012 at 07:06:22PM +0100, Florian Smeets wrote: >>>> On 16.11.12 13:05, Andre Oppermann wrote: >>>>> Author: andre >>>>> Date: Fri Nov 16 12:05:10 2012 >>>>> New Revision: 243147 >>>>> URL: http://svnweb.freebsd.org/changeset/base/243147 >>>>> >>>>> Log: >>>>> Change fetch(1) to: >>>>> =20 >>>>> o Report the instantaneous bandwidth instead of an average since = the >>>>> beginning of the download. >>>>> =20 >>>>> o At the finish of the download report the average bandwidth and = also >>>>> the total time it took instead of 00m00s. >>>>> =20 >>>> >>>> Andre, >>>> >>>> it looks like this change breaks the bandwidth calculation when usin= g -r >>>> >>>> 52% of 146 MB -25199509 Bps 03m28s >>>> >>>> Going back to r243146 fixes it. >>>> >>> >>> Try this: >>> diff --git a/usr.bin/fetch/fetch.c b/usr.bin/fetch/fetch.c >>> index 025fcdc..e723d40 100644 >>> --- a/usr.bin/fetch/fetch.c >>> +++ b/usr.bin/fetch/fetch.c >>> @@ -243,7 +243,7 @@ stat_start(struct xferstat *xs, const char *name,= off_t size, off_t of >>> gettimeofday(&xs->start, NULL); >>> xs->last.tv_sec =3D xs->last.tv_usec =3D 0; >>> xs->size =3D size; >>> - xs->offset =3D offset; >>> + xs->offset =3D 0; >>> xs->rcvd =3D offset; >>> xs->lastrcvd =3D offset; >>> if (v_tty && v_level > 0) >>> >> >> That way the bandwidth calculation looks OK but now it counts the time= >> since starting to resume the download and not the time left :) >> >> 63% of 146 MB 7069 kBps 00m07s >> >=20 > Oops.. revert that and try this instead: > diff --git a/usr.bin/fetch/fetch.c b/usr.bin/fetch/fetch.c > index 025fcdc..d3e9b21 100644 > --- a/usr.bin/fetch/fetch.c > +++ b/usr.bin/fetch/fetch.c > @@ -183,7 +183,7 @@ stat_bps(struct xferstat *xs) > if (delta =3D=3D 0.0) { > snprintf(str, sizeof str, "?? Bps"); > } else { > - bps =3D (xs->rcvd - xs->lastrcvd - xs->offset) / delta;= > + bps =3D (xs->rcvd - xs->lastrcvd) / delta; > snprintf(str, sizeof str, "%sps", stat_bytes((off_t)bps= )); > } > return (str); >=20 That looks much better. 68% of 146 MB 556 kBps 01m40s Thanks! Florian ------enig2GWMXOHKMAEKERRJRPQUQ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iEYEARECAAYFAlDE7E4ACgkQapo8P8lCvwkdNACffeHvkd0JO8cU8ftkXviDwxeL KzgAoIf2r2Af6pbeyeCA45YCGNZJVuqT =w/Eq -----END PGP SIGNATURE----- ------enig2GWMXOHKMAEKERRJRPQUQ-- From owner-svn-src-head@FreeBSD.ORG Sun Dec 9 20:26:52 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 14BE6F26; Sun, 9 Dec 2012 20:26:52 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F04288FC14; Sun, 9 Dec 2012 20:26:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB9KQpbC024000; Sun, 9 Dec 2012 20:26:51 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB9KQpDl023999; Sun, 9 Dec 2012 20:26:51 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201212092026.qB9KQpDl023999@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 9 Dec 2012 20:26:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244053 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 09 Dec 2012 20:26:52 -0000 Author: kib Date: Sun Dec 9 20:26:51 2012 New Revision: 244053 URL: http://svnweb.freebsd.org/changeset/base/244053 Log: Fix typo. MFC after: 3 days Modified: head/sys/kern/vfs_mount.c Modified: head/sys/kern/vfs_mount.c ============================================================================== --- head/sys/kern/vfs_mount.c Sun Dec 9 19:53:21 2012 (r244052) +++ head/sys/kern/vfs_mount.c Sun Dec 9 20:26:51 2012 (r244053) @@ -711,7 +711,7 @@ sys_mount(td, uap) int error; /* - * Mount flags are now 64-bits. On 32-bit archtectures only + * Mount flags are now 64-bits. On 32-bit architectures only * 32-bits are passed in, but from here on everything handles * 64-bit flags correctly. */ From owner-svn-src-head@FreeBSD.ORG Sun Dec 9 20:34:12 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 46AEA32D; Sun, 9 Dec 2012 20:34:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 27FC18FC08; Sun, 9 Dec 2012 20:34:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB9KYCjl025392; Sun, 9 Dec 2012 20:34:12 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB9KYCgM025391; Sun, 9 Dec 2012 20:34:12 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201212092034.qB9KYCgM025391@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 9 Dec 2012 20:34:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244054 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 09 Dec 2012 20:34:12 -0000 Author: kib Date: Sun Dec 9 20:34:11 2012 New Revision: 244054 URL: http://svnweb.freebsd.org/changeset/base/244054 Log: Remove useless comment. MFC after: 3 days Modified: head/sys/kern/vfs_bio.c Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Sun Dec 9 20:26:51 2012 (r244053) +++ head/sys/kern/vfs_bio.c Sun Dec 9 20:34:11 2012 (r244054) @@ -2605,8 +2605,6 @@ loop: * If this check ever becomes a bottleneck it may be better to * move it into the else, when gbincore() fails. At the moment * it isn't a problem. - * - * XXX remove if 0 sections (clean this up after its proven) */ if (numfreebuffers == 0) { if (TD_IS_IDLETHREAD(curthread)) From owner-svn-src-head@FreeBSD.ORG Sun Dec 9 20:35:12 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B39BB4AD; Sun, 9 Dec 2012 20:35:12 +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 774818FC08; Sun, 9 Dec 2012 20:35:12 +0000 (UTC) Received: from mh1.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh1.mail.rice.edu (Postfix) with ESMTP id 76BCC460150; Sun, 9 Dec 2012 14:35:06 -0600 (CST) Received: from mh1.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh1.mail.rice.edu (Postfix) with ESMTP id 74939460147; Sun, 9 Dec 2012 14:35:06 -0600 (CST) X-Virus-Scanned: by amavis-2.7.0 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 cYkcu6Rmuwqi; Sun, 9 Dec 2012 14:35:06 -0600 (CST) 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 E777046011D; Sun, 9 Dec 2012 14:35:05 -0600 (CST) Message-ID: <50C4F5F7.7080101@rice.edu> Date: Sun, 09 Dec 2012 14:35:03 -0600 From: Alan Cox User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:16.0) Gecko/20121111 Thunderbird/16.0.2 MIME-Version: 1.0 To: Andre Oppermann Subject: Re: svn commit: r243668 - in head/sys: kern sys References: <201211290730.qAT7Uhkv016745@svn.freebsd.org> In-Reply-To: <201211290730.qAT7Uhkv016745@svn.freebsd.org> 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 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 09 Dec 2012 20:35:12 -0000 Andre, I believe that this change did not actually correct the overflow problem. See below for an explanation. On 11/29/2012 01:30, Andre Oppermann wrote: > Author: andre > Date: Thu Nov 29 07:30:42 2012 > New Revision: 243668 > URL: http://svnweb.freebsd.org/changeset/base/243668 > > Log: > Using a long is the wrong type to represent the realmem and maxmbufmem > variable as they may overflow on i386/PAE and i386 with > 2GB RAM. > > Use 64bit quad_t instead. It has broader kernel infrastructure support > with TUNABLE_QUAD_FETCH() and qmin/qmax() than other available types. > > Pointed out by: alc, bde > > Modified: > head/sys/kern/subr_param.c > head/sys/sys/mbuf.h > > Modified: head/sys/kern/subr_param.c > ============================================================================== > --- head/sys/kern/subr_param.c Thu Nov 29 06:26:42 2012 (r243667) > +++ head/sys/kern/subr_param.c Thu Nov 29 07:30:42 2012 (r243668) > @@ -93,7 +93,7 @@ int ncallout; /* maximum # of timer ev > int nbuf; > int ngroups_max; /* max # groups per process */ > int nswbuf; > -long maxmbufmem; /* max mbuf memory */ > +quad_t maxmbufmem; /* max mbuf memory */ > pid_t pid_max = PID_MAX; > long maxswzone; /* max swmeta KVA storage */ > long maxbcache; /* max buffer cache KVA storage */ > @@ -271,7 +271,7 @@ init_param1(void) > void > init_param2(long physpages) > { > - long realmem; > + quad_t realmem; > > /* Base parameters */ > maxusers = MAXUSERS; > @@ -332,10 +332,10 @@ init_param2(long physpages) > * available kernel memory (physical or kmem). > * At most it can be 3/4 of available kernel memory. > */ > - realmem = lmin(physpages * PAGE_SIZE, > + realmem = qmin(physpages * PAGE_SIZE, > VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS); "physpages" is a signed long. Suppose it is 1,000,000. On i386/PAE, the product of 1,000,000 and PAGE_SIZE will be a negative number. Likewise, quad_t is a signed type. So, the negative product of 1,000,000 and PAGE_SIZE will be sign extended to a 64-bit signed value when it is passed to qmin(), and qmin() will return a negative number. > maxmbufmem = realmem / 2; > - TUNABLE_LONG_FETCH("kern.maxmbufmem", &maxmbufmem); > + TUNABLE_QUAD_FETCH("kern.maxmbufmem", &maxmbufmem); > if (maxmbufmem > (realmem / 4) * 3) > maxmbufmem = (realmem / 4) * 3; > > > Modified: head/sys/sys/mbuf.h > ============================================================================== > --- head/sys/sys/mbuf.h Thu Nov 29 06:26:42 2012 (r243667) > +++ head/sys/sys/mbuf.h Thu Nov 29 07:30:42 2012 (r243668) > @@ -395,7 +395,7 @@ struct mbstat { > * > * The rest of it is defined in kern/kern_mbuf.c > */ > -extern long maxmbufmem; > +extern quad_t maxmbufmem; > extern uma_zone_t zone_mbuf; > extern uma_zone_t zone_clust; > extern uma_zone_t zone_pack; > From owner-svn-src-head@FreeBSD.ORG Sun Dec 9 21:26:48 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 42239BDD; Sun, 9 Dec 2012 21:26:48 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 26EFE8FC14; Sun, 9 Dec 2012 21:26:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB9LQm1T035409; Sun, 9 Dec 2012 21:26:48 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB9LQmVS035407; Sun, 9 Dec 2012 21:26:48 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201212092126.qB9LQmVS035407@svn.freebsd.org> From: Rick Macklem Date: Sun, 9 Dec 2012 21:26:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244055 - head/sbin/mount_nfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 09 Dec 2012 21:26:48 -0000 Author: rmacklem Date: Sun Dec 9 21:26:47 2012 New Revision: 244055 URL: http://svnweb.freebsd.org/changeset/base/244055 Log: Document the new NFS mount options added by r244042. This is a content change. Modified: head/sbin/mount_nfs/mount_nfs.8 Modified: head/sbin/mount_nfs/mount_nfs.8 ============================================================================== --- head/sbin/mount_nfs/mount_nfs.8 Sun Dec 9 20:34:11 2012 (r244054) +++ head/sbin/mount_nfs/mount_nfs.8 Sun Dec 9 21:26:47 2012 (r244055) @@ -28,7 +28,7 @@ .\" @(#)mount_nfs.8 8.3 (Berkeley) 3/29/95 .\" $FreeBSD$ .\" -.Dd May 3, 2011 +.Dd December 9, 2012 .Dt MOUNT_NFS 8 .Os .Sh NAME @@ -175,6 +175,18 @@ Use the NFS Version 3 protocol. Use the NFS Version 4 protocol. This option will force the mount to use TCP transport. +.It Cm minorversion Ns = Ns Aq Ar value +Override the default of 0 for the minor version of the NFS Version 4 protocol. +The only minor version currently supported is 1. +This option is only meaningful when used with the +.Cm nfsv4 +option. +.It Cm pnfs +Enable support for parallel NFS (pNFS) for minor version 1 of the +NFS Version 4 protocol. +This option is only meaningful when used with the +.Cm minorversion +option. .It Cm noconn For UDP mount points, do not do a .Xr connect 2 . From owner-svn-src-head@FreeBSD.ORG Sun Dec 9 22:23:51 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 63AE6D8D; Sun, 9 Dec 2012 22:23:51 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 47A6C8FC0C; Sun, 9 Dec 2012 22:23:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB9MNp15047147; Sun, 9 Dec 2012 22:23:51 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB9MNpMn047146; Sun, 9 Dec 2012 22:23:51 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201212092223.qB9MNpMn047146@svn.freebsd.org> From: Rick Macklem Date: Sun, 9 Dec 2012 22:23:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244056 - head/sys/fs/nfsclient X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 09 Dec 2012 22:23:51 -0000 Author: rmacklem Date: Sun Dec 9 22:23:50 2012 New Revision: 244056 URL: http://svnweb.freebsd.org/changeset/base/244056 Log: Add "nfsstat -m" support for the two new NFS mount options added by r244042. Modified: head/sys/fs/nfsclient/nfs_clvfsops.c Modified: head/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvfsops.c Sun Dec 9 21:26:47 2012 (r244055) +++ head/sys/fs/nfsclient/nfs_clvfsops.c Sun Dec 9 22:23:50 2012 (r244056) @@ -1743,6 +1743,12 @@ void nfscl_retopts(struct nfsmount *nmp, blen = buflen; nfscl_printopt(nmp, (nmp->nm_flag & NFSMNT_NFSV4) != 0, "nfsv4", &buf, &blen); + if ((nmp->nm_flag & NFSMNT_NFSV4) != 0) { + nfscl_printoptval(nmp, nmp->nm_minorvers, ",minorversion", &buf, + &blen); + nfscl_printopt(nmp, (nmp->nm_flag & NFSMNT_PNFS) != 0, ",pnfs", + &buf, &blen); + } nfscl_printopt(nmp, (nmp->nm_flag & NFSMNT_NFSV3) != 0, "nfsv3", &buf, &blen); nfscl_printopt(nmp, (nmp->nm_flag & (NFSMNT_NFSV3 | NFSMNT_NFSV4)) == 0, From owner-svn-src-head@FreeBSD.ORG Sun Dec 9 22:42:38 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D41E4381 for ; Sun, 9 Dec 2012 22:42:38 +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 37A468FC15 for ; Sun, 9 Dec 2012 22:42:37 +0000 (UTC) Received: (qmail 97264 invoked from network); 10 Dec 2012 00:12:01 -0000 Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 10 Dec 2012 00:12:01 -0000 Message-ID: <50C513D4.4000306@freebsd.org> Date: Sun, 09 Dec 2012 23:42:28 +0100 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121026 Thunderbird/16.0.2 MIME-Version: 1.0 To: Alan Cox Subject: Re: svn commit: r243668 - in head/sys: kern sys References: <201211290730.qAT7Uhkv016745@svn.freebsd.org> <50C4F5F7.7080101@rice.edu> In-Reply-To: <50C4F5F7.7080101@rice.edu> 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 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 09 Dec 2012 22:42:39 -0000 On 09.12.2012 21:35, Alan Cox wrote: > Andre, > > I believe that this change did not actually correct the overflow > problem. See below for an explanation. > > On 11/29/2012 01:30, Andre Oppermann wrote: >> Author: andre >> Date: Thu Nov 29 07:30:42 2012 >> New Revision: 243668 >> URL: http://svnweb.freebsd.org/changeset/base/243668 >> >> Log: >> Using a long is the wrong type to represent the realmem and maxmbufmem >> variable as they may overflow on i386/PAE and i386 with > 2GB RAM. >> >> Use 64bit quad_t instead. It has broader kernel infrastructure support >> with TUNABLE_QUAD_FETCH() and qmin/qmax() than other available types. >> >> Pointed out by: alc, bde >> >> Modified: >> head/sys/kern/subr_param.c >> head/sys/sys/mbuf.h >> >> Modified: head/sys/kern/subr_param.c >> ============================================================================== >> --- head/sys/kern/subr_param.c Thu Nov 29 06:26:42 2012 (r243667) >> +++ head/sys/kern/subr_param.c Thu Nov 29 07:30:42 2012 (r243668) >> @@ -93,7 +93,7 @@ int ncallout; /* maximum # of timer ev >> int nbuf; >> int ngroups_max; /* max # groups per process */ >> int nswbuf; >> -long maxmbufmem; /* max mbuf memory */ >> +quad_t maxmbufmem; /* max mbuf memory */ >> pid_t pid_max = PID_MAX; >> long maxswzone; /* max swmeta KVA storage */ >> long maxbcache; /* max buffer cache KVA storage */ >> @@ -271,7 +271,7 @@ init_param1(void) >> void >> init_param2(long physpages) >> { >> - long realmem; >> + quad_t realmem; >> >> /* Base parameters */ >> maxusers = MAXUSERS; >> @@ -332,10 +332,10 @@ init_param2(long physpages) >> * available kernel memory (physical or kmem). >> * At most it can be 3/4 of available kernel memory. >> */ >> - realmem = lmin(physpages * PAGE_SIZE, >> + realmem = qmin(physpages * PAGE_SIZE, >> VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS); > > > "physpages" is a signed long. Suppose it is 1,000,000. On i386/PAE, > the product of 1,000,000 and PAGE_SIZE will be a negative number. > Likewise, quad_t is a signed type. So, the negative product of > 1,000,000 and PAGE_SIZE will be sign extended to a 64-bit signed value > when it is passed to qmin(), and qmin() will return a negative number. Thank you taking a second look it. To be honest I got a bit confused on which automatic type expansion applies here. qmax() is defined as this in libkern.h: static __inline quad_t qmax(quad_t a, quad_t b) { return (a > b ? a : b); } Wouldn't physpages be expanded to quad_t? Hmm, no, only the result of the computation, which happens in long space, is passed on. This is a function, not a macro. Dang... This change will force the computation to be in quad_t space: - realmem = qmin(physpages * PAGE_SIZE, + realmem = qmin((quad_t)physpages * PAGE_SIZE, VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS); VM_[MAX|MIN]_KERNEL_ADDRESS is safe as it is of the unsigned vm_offset_t type. -- Andre >> maxmbufmem = realmem / 2; >> - TUNABLE_LONG_FETCH("kern.maxmbufmem", &maxmbufmem); >> + TUNABLE_QUAD_FETCH("kern.maxmbufmem", &maxmbufmem); >> if (maxmbufmem > (realmem / 4) * 3) >> maxmbufmem = (realmem / 4) * 3; >> >> >> Modified: head/sys/sys/mbuf.h >> ============================================================================== >> --- head/sys/sys/mbuf.h Thu Nov 29 06:26:42 2012 (r243667) >> +++ head/sys/sys/mbuf.h Thu Nov 29 07:30:42 2012 (r243668) >> @@ -395,7 +395,7 @@ struct mbstat { >> * >> * The rest of it is defined in kern/kern_mbuf.c >> */ >> -extern long maxmbufmem; >> +extern quad_t maxmbufmem; >> extern uma_zone_t zone_mbuf; >> extern uma_zone_t zone_clust; >> extern uma_zone_t zone_pack; >> > D > > From owner-svn-src-head@FreeBSD.ORG Sun Dec 9 22:53:54 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 983E2673; Sun, 9 Dec 2012 22:53:54 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7CB408FC0C; Sun, 9 Dec 2012 22:53:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB9MrsH5052478; Sun, 9 Dec 2012 22:53:54 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB9Mrsce052477; Sun, 9 Dec 2012 22:53:54 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201212092253.qB9Mrsce052477@svn.freebsd.org> From: Glen Barber Date: Sun, 9 Dec 2012 22:53:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244057 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 09 Dec 2012 22:53:54 -0000 Author: gjb (doc,ports committer) Date: Sun Dec 9 22:53:53 2012 New Revision: 244057 URL: http://svnweb.freebsd.org/changeset/base/244057 Log: Get 'uname -r' earlier, so it can be used to determine what branch is being run to set BSDINSTALL_DISTSITE accordingly. This change allows non-RELEASE branches to use the FTP snapshots directory for bootonly.iso installations. Approved by: simon Modified: head/usr.sbin/bsdinstall/scripts/mirrorselect Modified: head/usr.sbin/bsdinstall/scripts/mirrorselect ============================================================================== --- head/usr.sbin/bsdinstall/scripts/mirrorselect Sun Dec 9 22:23:50 2012 (r244056) +++ head/usr.sbin/bsdinstall/scripts/mirrorselect Sun Dec 9 22:53:53 2012 (r244057) @@ -191,7 +191,18 @@ MIRROR=`dialog --backtitle "FreeBSD Inst MIRROR_BUTTON=$? exec 3>&- -BSDINSTALL_DISTSITE="$MIRROR/pub/FreeBSD/releases/`uname -m`/`uname -p`/`uname -r`" +_UNAME_R=`uname -r` + +case ${_UNAME_R} in + *-CURRENT|*-STABLE|*-PRERELEASE|*-RC*) + RELDIR="snapshots" + ;; + *) + RELDIR="releases" + ;; +esac + +BSDINSTALL_DISTSITE="$MIRROR/pub/FreeBSD/${RELDIR}/`uname -m`/`uname -p`/${_UNAME_R}" case $MIRROR_BUTTON in $DIALOG_CANCEL) From owner-svn-src-head@FreeBSD.ORG Sun Dec 9 22:54:03 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C4C4378E; Sun, 9 Dec 2012 22:54:03 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AA1DB8FC13; Sun, 9 Dec 2012 22:54:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB9Ms3ao052562; Sun, 9 Dec 2012 22:54:03 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB9Ms3ge052561; Sun, 9 Dec 2012 22:54:03 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201212092254.qB9Ms3ge052561@svn.freebsd.org> From: Andre Oppermann Date: Sun, 9 Dec 2012 22:54:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244058 - head/usr.bin/fetch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 09 Dec 2012 22:54:03 -0000 Author: andre Date: Sun Dec 9 22:54:03 2012 New Revision: 244058 URL: http://svnweb.freebsd.org/changeset/base/244058 Log: Fix bandwidth reporting when doing a restarted download with "-r". The offset is already accounted for in xs->lastrcvd and doesn't have to be subtracted again. Reported by: Florian Smeets Submitted by: Mateusz Guzik Tested by: Florian Smeets MFC after: 1 week Modified: head/usr.bin/fetch/fetch.c Modified: head/usr.bin/fetch/fetch.c ============================================================================== --- head/usr.bin/fetch/fetch.c Sun Dec 9 22:53:53 2012 (r244057) +++ head/usr.bin/fetch/fetch.c Sun Dec 9 22:54:03 2012 (r244058) @@ -183,7 +183,7 @@ stat_bps(struct xferstat *xs) if (delta == 0.0) { snprintf(str, sizeof str, "?? Bps"); } else { - bps = (xs->rcvd - xs->lastrcvd - xs->offset) / delta; + bps = (xs->rcvd - xs->lastrcvd) / delta; snprintf(str, sizeof str, "%sps", stat_bytes((off_t)bps)); } return (str); From owner-svn-src-head@FreeBSD.ORG Sun Dec 9 22:55:52 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1B395950; Sun, 9 Dec 2012 22:55:52 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F39368FC14; Sun, 9 Dec 2012 22:55:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB9MtpPp052913; Sun, 9 Dec 2012 22:55:51 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB9MtpMH052912; Sun, 9 Dec 2012 22:55:51 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201212092255.qB9MtpMH052912@svn.freebsd.org> From: Glen Barber Date: Sun, 9 Dec 2012 22:55:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244059 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 09 Dec 2012 22:55:52 -0000 Author: gjb (doc,ports committer) Date: Sun Dec 9 22:55:51 2012 New Revision: 244059 URL: http://svnweb.freebsd.org/changeset/base/244059 Log: Add missed BETA* to list. Approved by: simon (implicit) MFC after: 3 days X-MFC-With: r244058 Modified: head/usr.sbin/bsdinstall/scripts/mirrorselect Modified: head/usr.sbin/bsdinstall/scripts/mirrorselect ============================================================================== --- head/usr.sbin/bsdinstall/scripts/mirrorselect Sun Dec 9 22:54:03 2012 (r244058) +++ head/usr.sbin/bsdinstall/scripts/mirrorselect Sun Dec 9 22:55:51 2012 (r244059) @@ -194,7 +194,7 @@ exec 3>&- _UNAME_R=`uname -r` case ${_UNAME_R} in - *-CURRENT|*-STABLE|*-PRERELEASE|*-RC*) + *-CURRENT|*-STABLE|*-BETA*|*-PRERELEASE|*-RC*) RELDIR="snapshots" ;; *) From owner-svn-src-head@FreeBSD.ORG Sun Dec 9 22:56:30 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 91428AC1; Sun, 9 Dec 2012 22:56:30 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6BFC68FC08; Sun, 9 Dec 2012 22:56:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB9MuUqP053075; Sun, 9 Dec 2012 22:56:30 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB9MuTRc053071; Sun, 9 Dec 2012 22:56:29 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201212092256.qB9MuTRc053071@svn.freebsd.org> From: Adrian Chadd Date: Sun, 9 Dec 2012 22:56:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244060 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 09 Dec 2012 22:56:30 -0000 Author: adrian Date: Sun Dec 9 22:56:29 2012 New Revision: 244060 URL: http://svnweb.freebsd.org/changeset/base/244060 Log: Handle ath-specific and WME IE's in adhoc mode. The Adhoc support wasn't parsing and handling the ath specific and WME IEs, thus the atheros vendor support and WME TXOP parameters aren't being copied from the peer. It copies the WME parameters from whichever adhoc node it decides to associate to, rather than just having them be statically configured per adhoc node. This may or may not be exactly "right", but it's certainly going to be more convienent for people - they just have to ensure their adhoc nodes are setup with correct WME parameters. Since WME parameters aren't per-node but are configured on hardware TX queues, if some nodes support WME and some don't - or perhaps, have different WME parameters - things will get quite quirky. So ensure that you configure your adhoc nodes with the same WME parameters. Secondly - the Atheros Vendor IE is parsed and operated on per-node, so this should work out ok between nodes that do and don't do Atheros extensions. Once you see a becaon from that node and you setup the association state, it _should_ parse things correctly. TODO: * I do need to ensure that both adhoc setup paths are correctly updating the IE stuff. Ie, if the adhoc node is created by a data frame instead of a beacon frame, it'll come up with no WME/ath IE config. The next beacon frame that it receives from that node will update the state. I just need to sit down and better understand how that's suppose to work in IBSS mode. Tested: * AR5416 <-> AR9280 - fast frames and the WME configuration both popped up. (This is with a local HAL patch that enables the fast frames capability on the AR5416 chipsets.) PR: kern/165969 Modified: head/sys/net80211/ieee80211_adhoc.c head/sys/net80211/ieee80211_sta.c head/sys/net80211/ieee80211_sta.h Modified: head/sys/net80211/ieee80211_adhoc.c ============================================================================== --- head/sys/net80211/ieee80211_adhoc.c Sun Dec 9 22:55:51 2012 (r244059) +++ head/sys/net80211/ieee80211_adhoc.c Sun Dec 9 22:56:29 2012 (r244060) @@ -63,6 +63,7 @@ __FBSDID("$FreeBSD$"); #ifdef IEEE80211_SUPPORT_TDMA #include #endif +#include #define IEEE80211_RATE2MBS(r) (((r) & IEEE80211_RATE_VAL) / 2) @@ -745,6 +746,16 @@ adhoc_recv_mgmt(struct ieee80211_node *n memcpy(ni->ni_tstamp.data, scan.tstamp, sizeof(ni->ni_tstamp)); } + if (scan.wme != NULL && + (ni->ni_flags & IEEE80211_NODE_QOS) && + ieee80211_parse_wmeparams(vap, scan.wme, wh) > 0) { + ieee80211_wme_updateparams(vap); + } +#ifdef IEEE80211_SUPPORT_SUPERG + if (scan.ath != NULL) { + ieee80211_parse_athparams(ni, scan.ath, wh); + } +#endif if (ni != NULL) { IEEE80211_RSSI_LPF(ni->ni_avgrssi, rssi); ni->ni_noise = nf; Modified: head/sys/net80211/ieee80211_sta.c ============================================================================== --- head/sys/net80211/ieee80211_sta.c Sun Dec 9 22:55:51 2012 (r244059) +++ head/sys/net80211/ieee80211_sta.c Sun Dec 9 22:56:29 2012 (r244060) @@ -63,6 +63,7 @@ __FBSDID("$FreeBSD$"); #include #endif #include +#include #define IEEE80211_RATE2MBS(r) (((r) & IEEE80211_RATE_VAL) / 2) @@ -1086,7 +1087,7 @@ bad: IEEE80211_SCAN_FAIL_STATUS); } -static int +int ieee80211_parse_wmeparams(struct ieee80211vap *vap, uint8_t *frm, const struct ieee80211_frame *wh) { Modified: head/sys/net80211/ieee80211_sta.h ============================================================================== --- head/sys/net80211/ieee80211_sta.h Sun Dec 9 22:55:51 2012 (r244059) +++ head/sys/net80211/ieee80211_sta.h Sun Dec 9 22:56:29 2012 (r244060) @@ -33,4 +33,10 @@ void ieee80211_sta_attach(struct ieee80211com *); void ieee80211_sta_detach(struct ieee80211com *); void ieee80211_sta_vattach(struct ieee80211vap *); + +/* + * Used by the adhoc/mesh/tdma paths. + */ +extern int ieee80211_parse_wmeparams(struct ieee80211vap *vap, uint8_t *frm, + const struct ieee80211_frame *wh); #endif /* !_NET80211_IEEE80211_STA_H_ */ From owner-svn-src-head@FreeBSD.ORG Sun Dec 9 23:01:59 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A9D84C79 for ; Sun, 9 Dec 2012 23:01:59 +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 0893A8FC15 for ; Sun, 9 Dec 2012 23:01:58 +0000 (UTC) Received: (qmail 97346 invoked from network); 10 Dec 2012 00:31:22 -0000 Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 10 Dec 2012 00:31:22 -0000 Message-ID: <50C5185D.3080802@freebsd.org> Date: Mon, 10 Dec 2012 00:01:49 +0100 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121026 Thunderbird/16.0.2 MIME-Version: 1.0 To: Mateusz Guzik Subject: Re: svn commit: r243147 - head/usr.bin/fetch References: <201211161205.qAGC5Bwr081144@svn.freebsd.org> <50C4D31E.4080000@smeets.im> <20121209182730.GA28989@dft-labs.eu> <50C4DB7A.9050302@smeets.im> <20121209190120.GB28989@dft-labs.eu> In-Reply-To: <20121209190120.GB28989@dft-labs.eu> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Florian Smeets , src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 09 Dec 2012 23:01:59 -0000 On 09.12.2012 20:01, Mateusz Guzik wrote: > On Sun, Dec 09, 2012 at 07:42:02PM +0100, Florian Smeets wrote: >> On 09.12.12 19:27, Mateusz Guzik wrote: >>> On Sun, Dec 09, 2012 at 07:06:22PM +0100, Florian Smeets wrote: >>>> On 16.11.12 13:05, Andre Oppermann wrote: >>>>> Author: andre >>>>> Date: Fri Nov 16 12:05:10 2012 >>>>> New Revision: 243147 >>>>> URL: http://svnweb.freebsd.org/changeset/base/243147 >>>>> >>>>> Log: >>>>> Change fetch(1) to: >>>>> >>>>> o Report the instantaneous bandwidth instead of an average since the >>>>> beginning of the download. >>>>> >>>>> o At the finish of the download report the average bandwidth and also >>>>> the total time it took instead of 00m00s. >>>>> >>>> >>>> Andre, >>>> >>>> it looks like this change breaks the bandwidth calculation when using -r >>>> >>>> 52% of 146 MB -25199509 Bps 03m28s >>>> >>>> Going back to r243146 fixes it. >>>> >>> >>> Try this: >>> diff --git a/usr.bin/fetch/fetch.c b/usr.bin/fetch/fetch.c >>> index 025fcdc..e723d40 100644 >>> --- a/usr.bin/fetch/fetch.c >>> +++ b/usr.bin/fetch/fetch.c >>> @@ -243,7 +243,7 @@ stat_start(struct xferstat *xs, const char *name, off_t size, off_t of >>> gettimeofday(&xs->start, NULL); >>> xs->last.tv_sec = xs->last.tv_usec = 0; >>> xs->size = size; >>> - xs->offset = offset; >>> + xs->offset = 0; >>> xs->rcvd = offset; >>> xs->lastrcvd = offset; >>> if (v_tty && v_level > 0) >>> >> >> That way the bandwidth calculation looks OK but now it counts the time >> since starting to resume the download and not the time left :) >> >> 63% of 146 MB 7069 kBps 00m07s >> > > Oops.. revert that and try this instead: > diff --git a/usr.bin/fetch/fetch.c b/usr.bin/fetch/fetch.c > index 025fcdc..d3e9b21 100644 > --- a/usr.bin/fetch/fetch.c > +++ b/usr.bin/fetch/fetch.c > @@ -183,7 +183,7 @@ stat_bps(struct xferstat *xs) > if (delta == 0.0) { > snprintf(str, sizeof str, "?? Bps"); > } else { > - bps = (xs->rcvd - xs->lastrcvd - xs->offset) / delta; > + bps = (xs->rcvd - xs->lastrcvd) / delta; > snprintf(str, sizeof str, "%sps", stat_bytes((off_t)bps)); > } > return (str); Thank you for this patch. Committed as r244058. -- Andre From owner-svn-src-head@FreeBSD.ORG Sun Dec 9 23:56:30 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8DEC477D; Sun, 9 Dec 2012 23:56:30 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 727A98FC13; Sun, 9 Dec 2012 23:56:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB9NuUGV064558; Sun, 9 Dec 2012 23:56:30 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB9NuUdU064557; Sun, 9 Dec 2012 23:56:30 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201212092356.qB9NuUdU064557@svn.freebsd.org> From: Adrian Chadd Date: Sun, 9 Dec 2012 23:56:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244061 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 09 Dec 2012 23:56:30 -0000 Author: adrian Date: Sun Dec 9 23:56:29 2012 New Revision: 244061 URL: http://svnweb.freebsd.org/changeset/base/244061 Log: Undo the previous adhoc commit - doing the WME IE handling here is totally wrong. If we parse the WME IE here, we'll be constantly updating the WME configuration from each WME enabled IBSS node we see. There's a separate issue where the WME configuration is blanked out when the interface is brought up; the WME parameters aren't "sticky." Also, ieee80211_init_neighbor() parses the ath IE, so doing it here isn't required. Sorry about the noise. PR: kern/165969 Modified: head/sys/net80211/ieee80211_adhoc.c Modified: head/sys/net80211/ieee80211_adhoc.c ============================================================================== --- head/sys/net80211/ieee80211_adhoc.c Sun Dec 9 22:56:29 2012 (r244060) +++ head/sys/net80211/ieee80211_adhoc.c Sun Dec 9 23:56:29 2012 (r244061) @@ -746,16 +746,6 @@ adhoc_recv_mgmt(struct ieee80211_node *n memcpy(ni->ni_tstamp.data, scan.tstamp, sizeof(ni->ni_tstamp)); } - if (scan.wme != NULL && - (ni->ni_flags & IEEE80211_NODE_QOS) && - ieee80211_parse_wmeparams(vap, scan.wme, wh) > 0) { - ieee80211_wme_updateparams(vap); - } -#ifdef IEEE80211_SUPPORT_SUPERG - if (scan.ath != NULL) { - ieee80211_parse_athparams(ni, scan.ath, wh); - } -#endif if (ni != NULL) { IEEE80211_RSSI_LPF(ni->ni_avgrssi, rssi); ni->ni_noise = nf; From owner-svn-src-head@FreeBSD.ORG Mon Dec 10 00:16:39 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9D3B1BB9; Mon, 10 Dec 2012 00:16:39 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7ED168FC08; Mon, 10 Dec 2012 00:16:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBA0GdNO069428; Mon, 10 Dec 2012 00:16:39 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBA0GdPs069427; Mon, 10 Dec 2012 00:16:39 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201212100016.qBA0GdPs069427@svn.freebsd.org> From: Adrian Chadd Date: Mon, 10 Dec 2012 00:16:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244062 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 10 Dec 2012 00:16:39 -0000 Author: adrian Date: Mon Dec 10 00:16:38 2012 New Revision: 244062 URL: http://svnweb.freebsd.org/changeset/base/244062 Log: Update the aggressive mode logic to also enable aggressive mode parameters in IBSSes. IBSS was just being plainly ignored here even though aggressive mode was 'on'. This still doesn't fix the "why are the WME parameters reset upon interface down/up" issue. PR: kern/165969 Modified: head/sys/net80211/ieee80211_proto.c Modified: head/sys/net80211/ieee80211_proto.c ============================================================================== --- head/sys/net80211/ieee80211_proto.c Sun Dec 9 23:56:29 2012 (r244061) +++ head/sys/net80211/ieee80211_proto.c Mon Dec 10 00:16:38 2012 (r244062) @@ -996,6 +996,7 @@ ieee80211_wme_updateparams_locked(struct struct wmeParams *chanp, *bssp; enum ieee80211_phymode mode; int i; + int do_aggrmode = 0; /* * Set up the channel access parameters for the physical @@ -1036,11 +1037,38 @@ ieee80211_wme_updateparams_locked(struct * BE uses agressive params to optimize performance of * legacy/non-QoS traffic. */ - if ((vap->iv_opmode == IEEE80211_M_HOSTAP && - (wme->wme_flags & WME_F_AGGRMODE) != 0) || - (vap->iv_opmode == IEEE80211_M_STA && - (vap->iv_bss->ni_flags & IEEE80211_NODE_QOS) == 0) || - (vap->iv_flags & IEEE80211_F_WME) == 0) { + + /* Hostap? Only if aggressive mode is enabled */ + if (vap->iv_opmode == IEEE80211_M_HOSTAP && + (wme->wme_flags & WME_F_AGGRMODE) != 0) + do_aggrmode = 1; + + /* + * Station? Only if we're in a non-QoS BSS. + */ + else if ((vap->iv_opmode == IEEE80211_M_STA && + (vap->iv_bss->ni_flags & IEEE80211_NODE_QOS) == 0)) + do_aggrmode = 1; + + /* + * IBSS? Only if we we have WME enabled. + */ + else if ((vap->iv_opmode == IEEE80211_M_IBSS) && + (vap->iv_flags & IEEE80211_F_WME)) + do_aggrmode = 1; + + /* + * If WME is disabled on this VAP, default to aggressive mode + * regardless of the configuration. + */ + if ((vap->iv_flags & IEEE80211_F_WME) == 0) + do_aggrmode = 1; + + /* XXX WDS? */ + + /* XXX MBSS? */ + + if (do_aggrmode) { chanp = &wme->wme_chanParams.cap_wmeParams[WME_AC_BE]; bssp = &wme->wme_bssChanParams.cap_wmeParams[WME_AC_BE]; @@ -1058,7 +1086,14 @@ ieee80211_wme_updateparams_locked(struct chanp->wmep_acm, chanp->wmep_aifsn, chanp->wmep_logcwmin, chanp->wmep_logcwmax, chanp->wmep_txopLimit); } - + + + /* + * Change the contention window based on the number of associated + * stations. If the number of associated stations is 1 and + * aggressive mode is enabled, lower the contention window even + * further. + */ if (vap->iv_opmode == IEEE80211_M_HOSTAP && ic->ic_sta_assoc < 2 && (wme->wme_flags & WME_F_AGGRMODE) != 0) { static const uint8_t logCwMin[IEEE80211_MODE_MAX] = { @@ -1082,8 +1117,15 @@ ieee80211_wme_updateparams_locked(struct IEEE80211_DPRINTF(vap, IEEE80211_MSG_WME, "update %s (chan+bss) logcwmin %u\n", ieee80211_wme_acnames[WME_AC_BE], chanp->wmep_logcwmin); - } - if (vap->iv_opmode == IEEE80211_M_HOSTAP) { /* XXX ibss? */ + } + + /* + * Arrange for the beacon update. + * + * XXX what about MBSS, WDS? + */ + if (vap->iv_opmode == IEEE80211_M_HOSTAP + || vap->iv_opmode == IEEE80211_M_IBSS) { /* * Arrange for a beacon update and bump the parameter * set number so associated stations load the new values. From owner-svn-src-head@FreeBSD.ORG Mon Dec 10 01:25:31 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AEE68979; Mon, 10 Dec 2012 01:25:31 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from fallbackmx06.syd.optusnet.com.au (fallbackmx06.syd.optusnet.com.au [211.29.132.8]) by mx1.freebsd.org (Postfix) with ESMTP id 2FF6A8FC17; Mon, 10 Dec 2012 01:25:30 +0000 (UTC) Received: from mail06.syd.optusnet.com.au (mail06.syd.optusnet.com.au [211.29.132.187]) by fallbackmx06.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id qBA1PNDD025268; Mon, 10 Dec 2012 12:25:23 +1100 Received: from c122-106-175-26.carlnfd1.nsw.optusnet.com.au (c122-106-175-26.carlnfd1.nsw.optusnet.com.au [122.106.175.26]) by mail06.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id qBA1PCql003215 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 10 Dec 2012 12:25:14 +1100 Date: Mon, 10 Dec 2012 12:25:12 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Andre Oppermann Subject: Re: svn commit: r243668 - in head/sys: kern sys In-Reply-To: <50C513D4.4000306@freebsd.org> Message-ID: <20121210111347.L871@besplex.bde.org> References: <201211290730.qAT7Uhkv016745@svn.freebsd.org> <50C4F5F7.7080101@rice.edu> <50C513D4.4000306@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.0 cv=CJhyxmXD c=1 sm=1 a=0p_glaYd98YA:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=Y5AXMyR2jB0A:10 a=CJE-7khU8NtqFz-BgQEA:9 a=CjuIK1q_8ugA:10 a=rqFzXeojqLPuUmME:21 a=cpdj9V2h1KV6Bcsw:21 a=bxQHXO5Py4tHmhUgaywp5w==:117 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Alan Cox X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 10 Dec 2012 01:25:31 -0000 On Sun, 9 Dec 2012, Andre Oppermann wrote: > On 09.12.2012 21:35, Alan Cox wrote: >> ... >> >> I believe that this change did not actually correct the overflow >> problem. See below for an explanation. >> >> On 11/29/2012 01:30, Andre Oppermann wrote: >>> ... Please trim quotes. >>> >>> Log: >>> Using a long is the wrong type to represent the realmem and maxmbufmem >>> variable as they may overflow on i386/PAE and i386 with > 2GB RAM. >>> >>> Use 64bit quad_t instead. It has broader kernel infrastructure support >>> with TUNABLE_QUAD_FETCH() and qmin/qmax() than other available types. >>> >>> Pointed out by: alc, bde >>> ... >>> Modified: head/sys/kern/subr_param.c >>> ... >>> @@ -332,10 +332,10 @@ init_param2(long physpages) >>> * available kernel memory (physical or kmem). >>> * At most it can be 3/4 of available kernel memory. >>> */ >>> - realmem = lmin(physpages * PAGE_SIZE, >>> + realmem = qmin(physpages * PAGE_SIZE, >>> VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS); >> >> >> "physpages" is a signed long. Suppose it is 1,000,000. On i386/PAE, >> the product of 1,000,000 and PAGE_SIZE will be a negative number. >> Likewise, quad_t is a signed type. So, the negative product of >> 1,000,000 and PAGE_SIZE will be sign extended to a 64-bit signed value >> when it is passed to qmin(), and qmin() will return a negative number. > > Thank you taking a second look it. > > To be honest I got a bit confused on which automatic type expansion > applies here. This is a vanilla overflow bug. It has nothing to do with type extension, except that type extension beyond long doesn't occur for multiplication of longs. It has little to do with signedness, except that with signed longs the overflow occurs at LONG_MAX (2G-1 on i386) instead of at ULONG_MAX (4G-1 on i386). The above part of the patch also shows one of the many style bugs in this and previous commits (random indentation of the continued line -- 2 tabs instead of 4 spaces). > qmax() is defined as this in libkern.h: > static __inline quad_t qmax(quad_t a, quad_t b) { return (a > b ? a : b); } > > Wouldn't physpages be expanded to quad_t? Hmm, no, only the result of the > computation, which happens in long space, is passed on. This is a function, > not a macro. Dang... No, that is backwards. With a macro, the result of the multiplicaton is passed on (unless the macro is very broken and has type casts which to break its type-genericness). With the qmin() function, the result of the multiplication is converted to quad_t. But the mmultiplication has already overflowed, giving an undefined result of type long. (This assumes that PAGE_SIZE has type long or smaller. It is normally a literal int constant like 4096. Any type for this constant would increase bugs in this area. physpages has type long. As with all binary operations, the operands are first converted to a minimal common type that is at least as large as both and also at least as large as int. This type is long. Multiplication of longs then overflows mainly in the PAE case.) > This change will force the computation to be in quad_t space: > > - realmem = qmin(physpages * PAGE_SIZE, > + realmem = qmin((quad_t)physpages * PAGE_SIZE, > VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS); Indeed. > VM_[MAX|MIN]_KERNEL_ADDRESS is safe as it is of the unsigned vm_offset_t > type. This has little to do with its type, except that the type is not larger than quad_t. Actually, it is larger on most 64-bit arches including amd6d, so the above code only works accidentally. It depends on kva not covering more than half of the address space. Now the type errors are: - there is no such type as 'unsigned vm_offset_t' (unsigned foo_t is a syntax error for any typedefed type foo_t). I think you mean that vm_offset_t is an unsigned type. It is not the plain unsigned type on 64-bit arches, so you shouldn't mean that. - the type of constants like VM_MAX_KERNEL_ADDRESS is unclear. Most constants are defined as literals. But VM_{MAX,MIN}_KERNEL_ADDRESS happen to be defined using macros. The macros are quite MD. On i386, the macro is VADDR() which casts parameters to vm_offset_t. I think most parameters in the macro are literals with type int. Also, vm_offset_t is larger than int, so no further promotion occurs and the result has type vm_offset_t. On amd64, the macro is KVADDR() which casts parameters to unsigned long. Again (but more obviously) there is no further promotion, and the result has type unsigned long. vm_offset_t is unsigned long too, so the result has type unsigned long too. I discussed casts of parameters in macros with jake@ in connection with PAE. I had added casts to some macros to reduce some popular overflow bugs and type errors. jake preferred not to cast. It can be difficult to find the right cast to use, since the right cast is often different for PAE (but many cases could be handled by using a typedef that varies with PAE), and the correct cast is context-dependent (sometimes you know that a page count is small, so multiplying it by PAGE_SIZE can't overflow a signed int). I now agree with jake -- the caller must cast as necessary, the same as if the computation is explicit. - it is not a type error to do the subtraction in vm_offset_t arithmetic. VM_MAX_KERNEL_ADDRESS must be >= VM_MIN_KERNEL_ADDRESS, so the result cannot "overflow" to a "negative" value. - the result of the subtraction has type unsigned or unsigned long on most or all arches. On most 32-bit arches including i386, even unsigned long is smaller than quad_t (but vm_offset_t is plain unsigned). On most or all 64-bit arches including amd64, unsigned long is larger than quad_t (since both are 64 bits but quad_t is signed). Thus the result of the subtraction is demoted when qmin() is called. Overflow may occur. Overflow can easily occur, but apparently doesn't. It would occur if the kernel used more than half of the 64-bit address space. This would take a very sparse mapping and hardware support for this so that it doesn't take too many page tables. Apparently, amd64 doesn't have this, so overflow doesn't occur in practice on at least amd64. If overflow occurred, it would normally give a negative value and the result of the qmin() would be clamping down to this negative value. So the case where kva is "infinite" (more than half of a 64-bit address space) is broken. I like to use signed types and thus qmin(). qmin() would be necessary if any of the expressions had a subtraction that could give a negative result. But it doesn't work for certain unsigned types like 64-bit vm_offset_t. >>> maxmbufmem = realmem / 2; >>> - TUNABLE_LONG_FETCH("kern.maxmbufmem", &maxmbufmem); >>> + TUNABLE_QUAD_FETCH("kern.maxmbufmem", &maxmbufmem); >>> if (maxmbufmem > (realmem / 4) * 3) >>> maxmbufmem = (realmem / 4) * 3; More style bugs (excessive parentheses around division) are visible in this part of the patch. Some of the instances of this style bug in kern now are: % subr_param.c: if (maxfiles > (physpages / 4)) It is even more excessive to have parentheses around a simple arithmetic operand. % subr_param.c: if (maxmbufmem > (realmem / 4) * 3) There are no excessive parentheses around the arithmetic operand here, but internal ones in it. % subr_param.c: maxmbufmem = (realmem / 4) * 3; % sys_pipe.c: if (amountpipekva > (3 * maxpipekva) / 4) { This opposite order for multiplying by 3/4 is safe here because maxpipekva can't be very large. It might be safe above too. It is more natural, so should be used if possible. % sys_pipe.c: if ((amountpipekva > (3 * maxpipekva) / 4) && This condition also has excessive parentheses around all of its '&&' terms and misindentation for all of its continuation lines containing the other terms. % uipc_socket.c: over = (head->so_qlen > 3 * head->so_qlimit / 2); Correct use of parentheses. None for the arithmetic expression. The ones used are unnecessary too, but now they are useful because the expression is farily complicated and not idiomatic. Any parentheses for the idiomatic inner terms would obfuscate the outer ones. % vfs_bio.c: maxbuf = (LONG_MAX / 3) / BKVASIZE; Excessive. % vfs_bio.c: while ((long)hidirtybuffers * BKVASIZE > 3 * hibufspace / 4) { Correct. 3 * x / 4 may be more readable than x * 3 / 4 too. Bruce From owner-svn-src-head@FreeBSD.ORG Mon Dec 10 02:26:02 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7D3192D5; Mon, 10 Dec 2012 02:26:02 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 61F998FC0C; Mon, 10 Dec 2012 02:26:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBA2Q2l6093692; Mon, 10 Dec 2012 02:26:02 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBA2Q2WY093690; Mon, 10 Dec 2012 02:26:02 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201212100226.qBA2Q2WY093690@svn.freebsd.org> From: Eitan Adler Date: Mon, 10 Dec 2012 02:26:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244063 - head/usr.bin/locate/locate X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 10 Dec 2012 02:26:02 -0000 Author: eadler Date: Mon Dec 10 02:26:01 2012 New Revision: 244063 URL: http://svnweb.freebsd.org/changeset/base/244063 Log: Give users a hint when their locate database is too small. Reviewed by: wblock, gcooper Reviewed by: "Lowell Gilbert" Approved by: cperciva (implicit) MFC after: 3 weeks Modified: head/usr.bin/locate/locate/locate.c Modified: head/usr.bin/locate/locate/locate.c ============================================================================== --- head/usr.bin/locate/locate/locate.c Mon Dec 10 00:16:38 2012 (r244062) +++ head/usr.bin/locate/locate/locate.c Mon Dec 10 02:26:01 2012 (r244063) @@ -292,7 +292,9 @@ search_mmap(db, s) err(1, "`%s'", db); len = sb.st_size; if (len < (2*NBG)) - errx(1, "database too small: %s", db); + errx(1, + "database too small: %s\nRun /usr/libexec/locate.updatedb", + db); if ((p = mmap((caddr_t)0, (size_t)len, PROT_READ, MAP_SHARED, From owner-svn-src-head@FreeBSD.ORG Mon Dec 10 05:14:05 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8874E2DE; Mon, 10 Dec 2012 05:14:05 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5279C8FC08; Mon, 10 Dec 2012 05:14:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBA5E5Xp027209; Mon, 10 Dec 2012 05:14:05 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBA5E574027208; Mon, 10 Dec 2012 05:14:05 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201212100514.qBA5E574027208@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 10 Dec 2012 05:14:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244076 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 10 Dec 2012 05:14:05 -0000 Author: kib Date: Mon Dec 10 05:14:04 2012 New Revision: 244076 URL: http://svnweb.freebsd.org/changeset/base/244076 Log: Do not ignore zero address, possibly returned by the vm_map_find() call. The function indicates a failure by the TRUE return value. To be extra safe, assert that the return value from the following vm_map_insert() indicates success. Fix style issues in the nearby lines, reformulate the comment. Reviewed by: alc (previous version) Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/kern/vfs_bio.c Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Mon Dec 10 03:11:19 2012 (r244075) +++ head/sys/kern/vfs_bio.c Mon Dec 10 05:14:04 2012 (r244076) @@ -2107,15 +2107,16 @@ restart: if (maxsize != bp->b_kvasize) { vm_offset_t addr = 0; + int rv; bfreekva(bp); vm_map_lock(buffer_map); if (vm_map_findspace(buffer_map, - vm_map_min(buffer_map), maxsize, &addr)) { + vm_map_min(buffer_map), maxsize, &addr)) { /* - * Uh oh. Buffer map is to fragmented. We - * must defragment the map. + * Buffer map is too fragmented. + * We must defragment the map. */ atomic_add_int(&bufdefragcnt, 1); vm_map_unlock(buffer_map); @@ -2124,22 +2125,21 @@ restart: brelse(bp); goto restart; } - if (addr) { - vm_map_insert(buffer_map, NULL, 0, - addr, addr + maxsize, - VM_PROT_ALL, VM_PROT_ALL, MAP_NOFAULT); - - bp->b_kvabase = (caddr_t) addr; - bp->b_kvasize = maxsize; - atomic_add_long(&bufspace, bp->b_kvasize); - atomic_add_int(&bufreusecnt, 1); - } + rv = vm_map_insert(buffer_map, NULL, 0, addr, + addr + maxsize, VM_PROT_ALL, VM_PROT_ALL, + MAP_NOFAULT); + KASSERT(rv == KERN_SUCCESS, + ("vm_map_insert(buffer_map) rv %d", rv)); vm_map_unlock(buffer_map); + bp->b_kvabase = (caddr_t)addr; + bp->b_kvasize = maxsize; + atomic_add_long(&bufspace, bp->b_kvasize); + atomic_add_int(&bufreusecnt, 1); } bp->b_saveaddr = bp->b_kvabase; bp->b_data = bp->b_saveaddr; } - return(bp); + return (bp); } /* From owner-svn-src-head@FreeBSD.ORG Mon Dec 10 05:14:35 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 88A5144D; Mon, 10 Dec 2012 05:14:35 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5146A8FC15; Mon, 10 Dec 2012 05:14:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBA5EZeo027336; Mon, 10 Dec 2012 05:14:35 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBA5EZFE027334; Mon, 10 Dec 2012 05:14:35 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201212100514.qBA5EZFE027334@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 10 Dec 2012 05:14:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244077 - head/sys/amd64/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 10 Dec 2012 05:14:35 -0000 Author: kib Date: Mon Dec 10 05:14:34 2012 New Revision: 244077 URL: http://svnweb.freebsd.org/changeset/base/244077 Log: Add amd64-specific ddb command "show pte". The command displays the hierarchy of the page table entries which map the specified address. Reviewed by: alc (previous version) Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Mon Dec 10 05:14:04 2012 (r244076) +++ head/sys/amd64/amd64/pmap.c Mon Dec 10 05:14:34 2012 (r244077) @@ -5446,3 +5446,46 @@ pmap_align_superpage(vm_object_t object, else *addr = ((*addr + PDRMASK) & ~PDRMASK) + superpage_offset; } + +#include "opt_ddb.h" +#ifdef DDB +#include + +DB_SHOW_COMMAND(pte, pmap_print_pte) +{ + pmap_t pmap; + pml4_entry_t *pml4; + pdp_entry_t *pdp; + pd_entry_t *pde; + pt_entry_t *pte; + vm_offset_t va; + + if (have_addr) { + va = (vm_offset_t)addr; + pmap = PCPU_GET(curpmap); /* XXX */ + } else { + db_printf("show pte addr\n"); + return; + } + pml4 = pmap_pml4e(pmap, va); + db_printf("VA %#016lx pml4e %#016lx", va, *pml4); + if ((*pml4 & PG_V) == 0) { + db_printf("\n"); + return; + } + pdp = pmap_pml4e_to_pdpe(pml4, va); + db_printf(" pdpe %#016lx", *pdp); + if ((*pdp & PG_V) == 0 || (*pdp & PG_PS) != 0) { + db_printf("\n"); + return; + } + pde = pmap_pdpe_to_pde(pdp, va); + db_printf(" pde %#016lx", *pde); + if ((*pde & PG_V) == 0 || (*pde & PG_PS) != 0) { + db_printf("\n"); + return; + } + pte = pmap_pde_to_pte(pde, va); + db_printf(" pte %#016lx\n", *pte); +} +#endif From owner-svn-src-head@FreeBSD.ORG Mon Dec 10 07:00:47 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2E106624; Mon, 10 Dec 2012 07:00:47 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 12B8E8FC13; Mon, 10 Dec 2012 07:00:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBA70ke4047080; Mon, 10 Dec 2012 07:00:46 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBA70kO7047079; Mon, 10 Dec 2012 07:00:46 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201212100700.qBA70kO7047079@svn.freebsd.org> From: Adrian Chadd Date: Mon, 10 Dec 2012 07:00:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244078 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 10 Dec 2012 07:00:47 -0000 Author: adrian Date: Mon Dec 10 07:00:46 2012 New Revision: 244078 URL: http://svnweb.freebsd.org/changeset/base/244078 Log: Adjust the channel to correctly setup the HT flags when transitioning an IBSS VAP to RUN. An 11n IBSS was beaconing HTINFO/HTCAP IE's that didn't have any HT information setup (like the HT TX/RX MCS bitmask.) Tested: * AR9280, IBSS - both a statically setup channel and a scanned channel PR: kern/172955 Modified: head/sys/net80211/ieee80211_adhoc.c Modified: head/sys/net80211/ieee80211_adhoc.c ============================================================================== --- head/sys/net80211/ieee80211_adhoc.c Mon Dec 10 05:14:34 2012 (r244077) +++ head/sys/net80211/ieee80211_adhoc.c Mon Dec 10 07:00:46 2012 (r244078) @@ -171,7 +171,9 @@ adhoc_newstate(struct ieee80211vap *vap, * Already have a channel; bypass the * scan and startup immediately. */ - ieee80211_create_ibss(vap, vap->iv_des_chan); + ieee80211_create_ibss(vap, + ieee80211_ht_adjust_channel(ic, + vap->iv_des_chan, vap->iv_flags_ht)); break; } /* From owner-svn-src-head@FreeBSD.ORG Mon Dec 10 08:39:49 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 03059DAB; Mon, 10 Dec 2012 08:39:49 +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 C82D58FC17; Mon, 10 Dec 2012 08:39:48 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id B72A546B35; Mon, 10 Dec 2012 03:39:47 -0500 (EST) Date: Mon, 10 Dec 2012 08:39:47 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Konstantin Belousov Subject: Re: svn commit: r244077 - head/sys/amd64/amd64 In-Reply-To: <201212100514.qBA5EZFE027334@svn.freebsd.org> Message-ID: References: <201212100514.qBA5EZFE027334@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 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 10 Dec 2012 08:39:49 -0000 On Mon, 10 Dec 2012, Konstantin Belousov wrote: > Author: kib > Date: Mon Dec 10 05:14:34 2012 > New Revision: 244077 > URL: http://svnweb.freebsd.org/changeset/base/244077 > > Log: > Add amd64-specific ddb command "show pte". The command displays the > hierarchy of the page table entries which map the specified address. > > Reviewed by: alc (previous version) > Sponsored by: The FreeBSD Foundation > MFC after: 1 week Ah, very nice indeed -- I'd actually like to see similar MD page table dumping routines for other architectures, especially MIPS with its software-defined page tables. Robert From owner-svn-src-head@FreeBSD.ORG Mon Dec 10 09:15:34 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 89294DF2; Mon, 10 Dec 2012 09:15:34 +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 4CCFE8FC12; Mon, 10 Dec 2012 09:15:34 +0000 (UTC) Received: from mh1.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh1.mail.rice.edu (Postfix) with ESMTP id 921E2460147; Mon, 10 Dec 2012 03:15:33 -0600 (CST) Received: from mh1.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh1.mail.rice.edu (Postfix) with ESMTP id 8FFCC46013B; Mon, 10 Dec 2012 03:15:33 -0600 (CST) X-Virus-Scanned: by amavis-2.7.0 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 ThRFQF2CO2kH; Mon, 10 Dec 2012 03:15:33 -0600 (CST) 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 0CEBE46011D; Mon, 10 Dec 2012 03:15:32 -0600 (CST) Message-ID: <50C5A832.2080801@rice.edu> Date: Mon, 10 Dec 2012 03:15:30 -0600 From: Alan Cox User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:16.0) Gecko/20121111 Thunderbird/16.0.2 MIME-Version: 1.0 To: Andre Oppermann Subject: Re: svn commit: r243668 - in head/sys: kern sys References: <201211290730.qAT7Uhkv016745@svn.freebsd.org> <50C4F5F7.7080101@rice.edu> <50C513D4.4000306@freebsd.org> In-Reply-To: <50C513D4.4000306@freebsd.org> 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 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 10 Dec 2012 09:15:34 -0000 On 12/09/2012 16:42, Andre Oppermann wrote: > On 09.12.2012 21:35, Alan Cox wrote: >> Andre, >> >> I believe that this change did not actually correct the overflow >> problem. See below for an explanation. >> >> On 11/29/2012 01:30, Andre Oppermann wrote: >>> Author: andre >>> Date: Thu Nov 29 07:30:42 2012 >>> New Revision: 243668 >>> URL: http://svnweb.freebsd.org/changeset/base/243668 >>> >>> Log: >>> Using a long is the wrong type to represent the realmem and >>> maxmbufmem >>> variable as they may overflow on i386/PAE and i386 with > 2GB RAM. >>> >>> Use 64bit quad_t instead. It has broader kernel infrastructure >>> support >>> with TUNABLE_QUAD_FETCH() and qmin/qmax() than other available >>> types. >>> >>> Pointed out by: alc, bde >>> >>> Modified: >>> head/sys/kern/subr_param.c >>> head/sys/sys/mbuf.h >>> >>> Modified: head/sys/kern/subr_param.c >>> ============================================================================== >>> >>> --- head/sys/kern/subr_param.c Thu Nov 29 06:26:42 2012 (r243667) >>> +++ head/sys/kern/subr_param.c Thu Nov 29 07:30:42 2012 (r243668) >>> @@ -93,7 +93,7 @@ int ncallout; /* maximum # of timer ev >>> int nbuf; >>> int ngroups_max; /* max # groups per process */ >>> int nswbuf; >>> -long maxmbufmem; /* max mbuf memory */ >>> +quad_t maxmbufmem; /* max mbuf memory */ >>> pid_t pid_max = PID_MAX; >>> long maxswzone; /* max swmeta KVA storage */ >>> long maxbcache; /* max buffer cache KVA storage */ >>> @@ -271,7 +271,7 @@ init_param1(void) >>> void >>> init_param2(long physpages) >>> { >>> - long realmem; >>> + quad_t realmem; >>> >>> /* Base parameters */ >>> maxusers = MAXUSERS; >>> @@ -332,10 +332,10 @@ init_param2(long physpages) >>> * available kernel memory (physical or kmem). >>> * At most it can be 3/4 of available kernel memory. >>> */ >>> - realmem = lmin(physpages * PAGE_SIZE, >>> + realmem = qmin(physpages * PAGE_SIZE, >>> VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS); >> >> >> "physpages" is a signed long. Suppose it is 1,000,000. On i386/PAE, >> the product of 1,000,000 and PAGE_SIZE will be a negative number. >> Likewise, quad_t is a signed type. So, the negative product of >> 1,000,000 and PAGE_SIZE will be sign extended to a 64-bit signed value >> when it is passed to qmin(), and qmin() will return a negative number. > > Thank you taking a second look it. > > To be honest I got a bit confused on which automatic type expansion > applies here. > > qmax() is defined as this in libkern.h: > static __inline quad_t qmax(quad_t a, quad_t b) { return (a > b ? a : > b); } > > Wouldn't physpages be expanded to quad_t? Hmm, no, only the result of > the > computation, which happens in long space, is passed on. This is a > function, > not a macro. Dang... > > This change will force the computation to be in quad_t space: > > - realmem = qmin(physpages * PAGE_SIZE, > + realmem = qmin((quad_t)physpages * PAGE_SIZE, > VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS); > > VM_[MAX|MIN]_KERNEL_ADDRESS is safe as it is of the unsigned vm_offset_t > type. > This change looks ok. As Bruce mentioned, can you also change the indentation of the next line to match style(9) before you commit the change? Alan From owner-svn-src-head@FreeBSD.ORG Mon Dec 10 12:19:04 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7FDE8819; Mon, 10 Dec 2012 12:19:04 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6480F8FC12; Mon, 10 Dec 2012 12:19:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBACJ4VB007911; Mon, 10 Dec 2012 12:19:04 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBACJ4v2007910; Mon, 10 Dec 2012 12:19:04 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201212101219.qBACJ4v2007910@svn.freebsd.org> From: Andre Oppermann Date: Mon, 10 Dec 2012 12:19:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244080 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 10 Dec 2012 12:19:04 -0000 Author: andre Date: Mon Dec 10 12:19:03 2012 New Revision: 244080 URL: http://svnweb.freebsd.org/changeset/base/244080 Log: Prevent long type overflow of realmem calculation on ILP32 by forcing calculation to be in quad_t space. Fix style issue with second parameter to qmin(). Reported by: alc Reviewed by: bde, alc Modified: head/sys/kern/subr_param.c Modified: head/sys/kern/subr_param.c ============================================================================== --- head/sys/kern/subr_param.c Mon Dec 10 11:26:18 2012 (r244079) +++ head/sys/kern/subr_param.c Mon Dec 10 12:19:03 2012 (r244080) @@ -332,8 +332,8 @@ init_param2(long physpages) * available kernel memory (physical or kmem). * At most it can be 3/4 of available kernel memory. */ - realmem = qmin(physpages * PAGE_SIZE, - VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS); + realmem = qmin((quad_t)physpages * PAGE_SIZE, + VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS); maxmbufmem = realmem / 2; TUNABLE_QUAD_FETCH("kern.maxmbufmem", &maxmbufmem); if (maxmbufmem > (realmem / 4) * 3) From owner-svn-src-head@FreeBSD.ORG Mon Dec 10 13:08:15 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 66F12E15; Mon, 10 Dec 2012 13:08:15 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 49DB18FC13; Mon, 10 Dec 2012 13:08:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBAD8F9e015189; Mon, 10 Dec 2012 13:08:15 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBAD8FNg015188; Mon, 10 Dec 2012 13:08:15 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201212101308.qBAD8FNg015188@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 10 Dec 2012 13:08:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244082 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 10 Dec 2012 13:08:15 -0000 Author: glebius Date: Mon Dec 10 13:08:14 2012 New Revision: 244082 URL: http://svnweb.freebsd.org/changeset/base/244082 Log: NGM_NETFLOW_SHOW reports IPv6 flows as well. Submitted by: Dmitry Luhtionov Modified: head/share/man/man4/ng_netflow.4 Modified: head/share/man/man4/ng_netflow.4 ============================================================================== --- head/share/man/man4/ng_netflow.4 Mon Dec 10 12:47:33 2012 (r244081) +++ head/share/man/man4/ng_netflow.4 Mon Dec 10 13:08:14 2012 (r244082) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd Nov 2, 2012 +.Dd December 10, 2012 .Dt NG_NETFLOW 4 .Os .Sh NAME @@ -254,9 +254,6 @@ It is called from .Xr flowctl 8 , not directly from .Xr ngctl 8 . -See also -.Sx BUGS -section. .It Dv NGM_NETFLOW_V9INFO Pq Ic v9info Returns some NetFlow v9 related values in a .Bd -literal -offset 4n @@ -349,7 +346,6 @@ written by Cache snapshot obtained via .Dv NGM_NETFLOW_SHOW command may lack some percentage of entries under severe load. -IPv6 flows are not shown. .Pp The .Nm From owner-svn-src-head@FreeBSD.ORG Mon Dec 10 15:29:56 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DEC99CFB; Mon, 10 Dec 2012 15:29:56 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C20018FC0C; Mon, 10 Dec 2012 15:29:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBAFTuDE044743; Mon, 10 Dec 2012 15:29:56 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBAFTuV2044742; Mon, 10 Dec 2012 15:29:56 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201212101529.qBAFTuV2044742@svn.freebsd.org> From: Devin Teske Date: Mon, 10 Dec 2012 15:29:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244089 - head/sys/boot/forth X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 10 Dec 2012 15:29:57 -0000 Author: dteske Date: Mon Dec 10 15:29:56 2012 New Revision: 244089 URL: http://svnweb.freebsd.org/changeset/base/244089 Log: Add support for comma-separated values (whitespace-separated still supported). PR: conf/121064 Submitted by: koitsu Reviewed by: jh Modified: head/sys/boot/forth/support.4th Modified: head/sys/boot/forth/support.4th ============================================================================== --- head/sys/boot/forth/support.4th Mon Dec 10 14:37:18 2012 (r244088) +++ head/sys/boot/forth/support.4th Mon Dec 10 15:29:56 2012 (r244089) @@ -207,20 +207,20 @@ create last_module_option sizeof module. dup 0= if 2drop 2drop false exit then begin begin - swap dup c@ dup 32 = over 9 = or - over 10 = or over 13 = or swap drop + swap dup c@ dup 32 = over 9 = or over 10 = or + over 13 = or over 44 = or swap drop while 1+ swap 1- repeat swap 2 pick 1- over < while 2over 2over drop over compare-insensitive 0= if 2 pick over = if 2drop 2drop true exit then 2 pick tuck - -rot + swap over c@ dup 32 = - over 9 = or over 10 = or over 13 = or + over 9 = or over 10 = or over 13 = or over 44 = or swap drop if 2drop 2drop true exit then then begin - swap dup c@ - dup 32 = over 9 = or over 10 = or over 13 = or - swap drop if false else true then 2 pick 0> and + swap dup c@ dup 32 = over 9 = or over 10 = or + over 13 = or over 44 = or swap drop + if false else true then 2 pick 0> and while 1+ swap 1- repeat swap repeat From owner-svn-src-head@FreeBSD.ORG Mon Dec 10 16:14:45 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 74EAB207; Mon, 10 Dec 2012 16:14:45 +0000 (UTC) (envelope-from ghelmer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 599438FC08; Mon, 10 Dec 2012 16:14:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBAGEjDp053844; Mon, 10 Dec 2012 16:14:45 GMT (envelope-from ghelmer@svn.freebsd.org) Received: (from ghelmer@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBAGEixe053838; Mon, 10 Dec 2012 16:14:44 GMT (envelope-from ghelmer@svn.freebsd.org) Message-Id: <201212101614.qBAGEixe053838@svn.freebsd.org> From: Guy Helmer Date: Mon, 10 Dec 2012 16:14:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244090 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 10 Dec 2012 16:14:45 -0000 Author: ghelmer Date: Mon Dec 10 16:14:44 2012 New Revision: 244090 URL: http://svnweb.freebsd.org/changeset/base/244090 Log: Changes to resolve races in bpfread() and catchpacket() that, at worst, cause kernel panics. Add a flag to the bpf descriptor to indicate whether the hold buffer is in use. In bpfread(), set the "hold buffer in use" flag before dropping the descriptor lock during the call to bpf_uiomove(). Everywhere else the hold buffer is used or changed, wait while the hold buffer is in use by bpfread(). Add a KASSERT in bpfread() after re-acquiring the descriptor lock to assist uncovering any additional hold buffer races. Modified: head/sys/net/bpf.c head/sys/net/bpf.h head/sys/net/bpf_buffer.c head/sys/net/bpfdesc.h Modified: head/sys/net/bpf.c ============================================================================== --- head/sys/net/bpf.c Mon Dec 10 15:29:56 2012 (r244089) +++ head/sys/net/bpf.c Mon Dec 10 16:14:44 2012 (r244090) @@ -819,6 +819,7 @@ bpfopen(struct cdev *dev, int flags, int * particular buffer method. */ bpf_buffer_init(d); + d->bd_hbuf_in_use = 0; d->bd_bufmode = BPF_BUFMODE_BUFFER; d->bd_sig = SIGIO; d->bd_direction = BPF_D_INOUT; @@ -872,6 +873,9 @@ bpfread(struct cdev *dev, struct uio *ui callout_stop(&d->bd_callout); timed_out = (d->bd_state == BPF_TIMED_OUT); d->bd_state = BPF_IDLE; + while (d->bd_hbuf_in_use) + mtx_sleep(&d->bd_hbuf_in_use, &d->bd_lock, + PRINET|PCATCH, "bd_hbuf", 0); /* * If the hold buffer is empty, then do a timed sleep, which * ends when the timeout expires or when enough packets @@ -940,27 +944,27 @@ bpfread(struct cdev *dev, struct uio *ui /* * At this point, we know we have something in the hold slot. */ + d->bd_hbuf_in_use = 1; BPFD_UNLOCK(d); /* * Move data from hold buffer into user space. * We know the entire buffer is transferred since * we checked above that the read buffer is bpf_bufsize bytes. - * - * XXXRW: More synchronization needed here: what if a second thread - * issues a read on the same fd at the same time? Don't want this - * getting invalidated. + * + * We do not have to worry about simultaneous reads because + * we waited for sole access to the hold buffer above. */ error = bpf_uiomove(d, d->bd_hbuf, d->bd_hlen, uio); BPFD_LOCK(d); - if (d->bd_hbuf != NULL) { - /* Free the hold buffer only if it is still valid. */ - d->bd_fbuf = d->bd_hbuf; - d->bd_hbuf = NULL; - d->bd_hlen = 0; - bpf_buf_reclaimed(d); - } + KASSERT(d->bd_hbuf != NULL, ("bpfread: lost bd_hbuf")); + d->bd_fbuf = d->bd_hbuf; + d->bd_hbuf = NULL; + d->bd_hlen = 0; + bpf_buf_reclaimed(d); + d->bd_hbuf_in_use = 0; + wakeup(&d->bd_hbuf_in_use); BPFD_UNLOCK(d); return (error); @@ -1114,6 +1118,9 @@ reset_d(struct bpf_d *d) BPFD_LOCK_ASSERT(d); + while (d->bd_hbuf_in_use) + mtx_sleep(&d->bd_hbuf_in_use, &d->bd_lock, PRINET, + "bd_hbuf", 0); if ((d->bd_hbuf != NULL) && (d->bd_bufmode != BPF_BUFMODE_ZBUF || bpf_canfreebuf(d))) { /* Free the hold buffer. */ @@ -1254,6 +1261,9 @@ bpfioctl(struct cdev *dev, u_long cmd, c BPFD_LOCK(d); n = d->bd_slen; + while (d->bd_hbuf_in_use) + mtx_sleep(&d->bd_hbuf_in_use, &d->bd_lock, + PRINET, "bd_hbuf", 0); if (d->bd_hbuf) n += d->bd_hlen; BPFD_UNLOCK(d); @@ -1967,6 +1977,9 @@ filt_bpfread(struct knote *kn, long hint ready = bpf_ready(d); if (ready) { kn->kn_data = d->bd_slen; + while (d->bd_hbuf_in_use) + mtx_sleep(&d->bd_hbuf_in_use, &d->bd_lock, + PRINET, "bd_hbuf", 0); if (d->bd_hbuf) kn->kn_data += d->bd_hlen; } else if (d->bd_rtout > 0 && d->bd_state == BPF_IDLE) { @@ -2299,6 +2312,9 @@ catchpacket(struct bpf_d *d, u_char *pkt * spot to do it. */ if (d->bd_fbuf == NULL && bpf_canfreebuf(d)) { + while (d->bd_hbuf_in_use) + mtx_sleep(&d->bd_hbuf_in_use, &d->bd_lock, + PRINET, "bd_hbuf", 0); d->bd_fbuf = d->bd_hbuf; d->bd_hbuf = NULL; d->bd_hlen = 0; @@ -2341,6 +2357,9 @@ catchpacket(struct bpf_d *d, u_char *pkt ++d->bd_dcount; return; } + while (d->bd_hbuf_in_use) + mtx_sleep(&d->bd_hbuf_in_use, &d->bd_lock, + PRINET, "bd_hbuf", 0); ROTATE_BUFFERS(d); do_wakeup = 1; curlen = 0; Modified: head/sys/net/bpf.h ============================================================================== --- head/sys/net/bpf.h Mon Dec 10 15:29:56 2012 (r244089) +++ head/sys/net/bpf.h Mon Dec 10 16:14:44 2012 (r244090) @@ -1235,7 +1235,8 @@ SYSCTL_DECL(_net_bpf); /* * Rotate the packet buffers in descriptor d. Move the store buffer into the * hold slot, and the free buffer ino the store slot. Zero the length of the - * new store buffer. Descriptor lock should be held. + * new store buffer. Descriptor lock should be held. Hold buffer must + * not be marked "in use". */ #define ROTATE_BUFFERS(d) do { \ (d)->bd_hbuf = (d)->bd_sbuf; \ Modified: head/sys/net/bpf_buffer.c ============================================================================== --- head/sys/net/bpf_buffer.c Mon Dec 10 15:29:56 2012 (r244089) +++ head/sys/net/bpf_buffer.c Mon Dec 10 16:14:44 2012 (r244090) @@ -79,6 +79,8 @@ __FBSDID("$FreeBSD$"); #include #include +#define PRINET 26 /* interruptible */ + /* * Implement historical kernel memory buffering model for BPF: two malloc(9) * kernel buffers are hung off of the descriptor. The size is fixed prior to @@ -189,6 +191,9 @@ bpf_buffer_ioctl_sblen(struct bpf_d *d, return (EINVAL); } + while (d->bd_hbuf_in_use) + mtx_sleep(&d->bd_hbuf_in_use, &d->bd_lock, + PRINET, "bd_hbuf", 0); /* Free old buffers if set */ if (d->bd_fbuf != NULL) free(d->bd_fbuf, M_BPF); Modified: head/sys/net/bpfdesc.h ============================================================================== --- head/sys/net/bpfdesc.h Mon Dec 10 15:29:56 2012 (r244089) +++ head/sys/net/bpfdesc.h Mon Dec 10 16:14:44 2012 (r244090) @@ -63,6 +63,7 @@ struct bpf_d { caddr_t bd_sbuf; /* store slot */ caddr_t bd_hbuf; /* hold slot */ caddr_t bd_fbuf; /* free slot */ + int bd_hbuf_in_use; /* don't rotate buffers */ int bd_slen; /* current length of store buffer */ int bd_hlen; /* current length of hold buffer */ From owner-svn-src-head@FreeBSD.ORG Mon Dec 10 17:34:34 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 52AF2F39; Mon, 10 Dec 2012 17:34:34 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1CD258FC15; Mon, 10 Dec 2012 17:34:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBAHYXe9069807; Mon, 10 Dec 2012 17:34:33 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBAHYXtR069806; Mon, 10 Dec 2012 17:34:33 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201212101734.qBAHYXtR069806@svn.freebsd.org> From: Brooks Davis Date: Mon, 10 Dec 2012 17:34:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244091 - head/lib/libc/locale X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 10 Dec 2012 17:34:34 -0000 Author: brooks Date: Mon Dec 10 17:34:33 2012 New Revision: 244091 URL: http://svnweb.freebsd.org/changeset/base/244091 Log: Improve style(9) compliance of function declarations. Modified: head/lib/libc/locale/setrunelocale.c Modified: head/lib/libc/locale/setrunelocale.c ============================================================================== --- head/lib/libc/locale/setrunelocale.c Mon Dec 10 16:14:44 2012 (r244090) +++ head/lib/libc/locale/setrunelocale.c Mon Dec 10 17:34:33 2012 (r244091) @@ -73,9 +73,11 @@ static int __setrunelocale(struct xloca #define __collate_chain_pri_table (table->__collate_chain_pri_table) -static void destruct_ctype(void *v) +static void +destruct_ctype(void *v) { struct xlocale_ctype *l = v; + if (strcmp(l->runes->__encoding, "EUC") == 0) free(l->runes->__variable); if (&_DefaultRuneLocale != l->runes) @@ -83,13 +85,17 @@ static void destruct_ctype(void *v) free(l); } -const _RuneLocale *__getCurrentRuneLocale(void) +const _RuneLocale * +__getCurrentRuneLocale(void) { + return XLOCALE_CTYPE(__get_locale())->runes; } -static void free_runes(_RuneLocale *rl) +static void +free_runes(_RuneLocale *rl) { + /* FIXME: The "EUC" check here is a hideous abstraction violation. */ if ((rl != &_DefaultRuneLocale) && (rl)) { if (strcmp(rl->__encoding, "EUC") == 0) { @@ -191,7 +197,8 @@ __wrap_setrunelocale(const char *locale) #ifndef __NO_TLS void -__set_thread_rune_locale(locale_t loc) { +__set_thread_rune_locale(locale_t loc) +{ if (loc == NULL) { _ThreadRuneLocale = &_DefaultRuneLocale; @@ -205,6 +212,7 @@ void * __ctype_load(const char *locale, locale_t unused) { struct xlocale_ctype *l = calloc(sizeof(struct xlocale_ctype), 1); + l->header.header.destructor = destruct_ctype; if (__setrunelocale(l, locale)) { From owner-svn-src-head@FreeBSD.ORG Mon Dec 10 17:56:53 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 483C0918; Mon, 10 Dec 2012 17:56:53 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2DC808FC12; Mon, 10 Dec 2012 17:56:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBAHurdB073913; Mon, 10 Dec 2012 17:56:53 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBAHupqa073901; Mon, 10 Dec 2012 17:56:51 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201212101756.qBAHupqa073901@svn.freebsd.org> From: Jilles Tjoelker Date: Mon, 10 Dec 2012 17:56:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244092 - head/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 10 Dec 2012 17:56:53 -0000 Author: jilles Date: Mon Dec 10 17:56:51 2012 New Revision: 244092 URL: http://svnweb.freebsd.org/changeset/base/244092 Log: libc: Make various internal file descriptors close-on-exec. These are obtained via fopen(). Modified: head/lib/libc/gen/fmtmsg.c head/lib/libc/gen/getcap.c head/lib/libc/gen/getgrent.c head/lib/libc/gen/getnetgrent.c head/lib/libc/gen/getttyent.c head/lib/libc/gen/getusershell.c head/lib/libc/gen/getutxent.c Modified: head/lib/libc/gen/fmtmsg.c ============================================================================== --- head/lib/libc/gen/fmtmsg.c Mon Dec 10 17:34:33 2012 (r244091) +++ head/lib/libc/gen/fmtmsg.c Mon Dec 10 17:56:51 2012 (r244092) @@ -83,7 +83,7 @@ def: if (output == NULL) return (MM_NOCON); if (*output != '\0') { - if ((fp = fopen("/dev/console", "a")) == NULL) { + if ((fp = fopen("/dev/console", "ae")) == NULL) { free(output); return (MM_NOCON); } Modified: head/lib/libc/gen/getcap.c ============================================================================== --- head/lib/libc/gen/getcap.c Mon Dec 10 17:34:33 2012 (r244091) +++ head/lib/libc/gen/getcap.c Mon Dec 10 17:56:51 2012 (r244092) @@ -654,7 +654,7 @@ cgetnext(char **bp, char **db_array) if (dbp == NULL) dbp = db_array; - if (pfp == NULL && (pfp = fopen(*dbp, "r")) == NULL) { + if (pfp == NULL && (pfp = fopen(*dbp, "re")) == NULL) { (void)cgetclose(); return (-1); } @@ -679,7 +679,7 @@ cgetnext(char **bp, char **db_array) (void)cgetclose(); return (0); } else if ((pfp = - fopen(*dbp, "r")) == NULL) { + fopen(*dbp, "re")) == NULL) { (void)cgetclose(); return (-1); } else Modified: head/lib/libc/gen/getgrent.c ============================================================================== --- head/lib/libc/gen/getgrent.c Mon Dec 10 17:34:33 2012 (r244091) +++ head/lib/libc/gen/getgrent.c Mon Dec 10 17:56:51 2012 (r244092) @@ -810,7 +810,7 @@ files_setgrent(void *retval, void *mdata if (st->fp != NULL) rewind(st->fp); else if (stayopen) - st->fp = fopen(_PATH_GROUP, "r"); + st->fp = fopen(_PATH_GROUP, "re"); break; case ENDGRENT: if (st->fp != NULL) { @@ -861,7 +861,7 @@ files_group(void *retval, void *mdata, v if (*errnop != 0) return (NS_UNAVAIL); if (st->fp == NULL && - ((st->fp = fopen(_PATH_GROUP, "r")) == NULL)) { + ((st->fp = fopen(_PATH_GROUP, "re")) == NULL)) { *errnop = errno; return (NS_UNAVAIL); } @@ -1251,7 +1251,7 @@ compat_setgrent(void *retval, void *mdat if (st->fp != NULL) rewind(st->fp); else if (stayopen) - st->fp = fopen(_PATH_GROUP, "r"); + st->fp = fopen(_PATH_GROUP, "re"); set_setent(dtab, mdata); (void)_nsdispatch(NULL, dtab, NSDB_GROUP_COMPAT, "setgrent", compatsrc, 0); @@ -1335,7 +1335,7 @@ compat_group(void *retval, void *mdata, if (*errnop != 0) return (NS_UNAVAIL); if (st->fp == NULL && - ((st->fp = fopen(_PATH_GROUP, "r")) == NULL)) { + ((st->fp = fopen(_PATH_GROUP, "re")) == NULL)) { *errnop = errno; rv = NS_UNAVAIL; goto fin; Modified: head/lib/libc/gen/getnetgrent.c ============================================================================== --- head/lib/libc/gen/getnetgrent.c Mon Dec 10 17:34:33 2012 (r244091) +++ head/lib/libc/gen/getnetgrent.c Mon Dec 10 17:56:51 2012 (r244092) @@ -173,7 +173,7 @@ setnetgrent(const char *group) if (((stat(_PATH_NETGROUP, &_yp_statp) < 0) && errno == ENOENT) || _yp_statp.st_size == 0) _use_only_yp = _netgr_yp_enabled = 1; - if ((netf = fopen(_PATH_NETGROUP,"r")) != NULL ||_use_only_yp){ + if ((netf = fopen(_PATH_NETGROUP,"re")) != NULL ||_use_only_yp){ /* * Icky: grab the first character of the netgroup file * and turn on NIS if it's a '+'. rewind the stream @@ -197,7 +197,7 @@ setnetgrent(const char *group) return; } #else - if ((netf = fopen(_PATH_NETGROUP, "r"))) { + if ((netf = fopen(_PATH_NETGROUP, "re"))) { #endif if (parse_netgrp(group)) endnetgrent(); Modified: head/lib/libc/gen/getttyent.c ============================================================================== --- head/lib/libc/gen/getttyent.c Mon Dec 10 17:34:33 2012 (r244091) +++ head/lib/libc/gen/getttyent.c Mon Dec 10 17:56:51 2012 (r244092) @@ -211,7 +211,7 @@ setttyent(void) if (tf) { rewind(tf); return (1); - } else if ( (tf = fopen(_PATH_TTYS, "r")) ) + } else if ( (tf = fopen(_PATH_TTYS, "re")) ) return (1); return (0); } Modified: head/lib/libc/gen/getusershell.c ============================================================================== --- head/lib/libc/gen/getusershell.c Mon Dec 10 17:34:33 2012 (r244091) +++ head/lib/libc/gen/getusershell.c Mon Dec 10 17:56:51 2012 (r244092) @@ -115,7 +115,7 @@ _local_initshells(rv, cb_data, ap) sl_free(sl, 1); sl = sl_init(); - if ((fp = fopen(_PATH_SHELLS, "r")) == NULL) + if ((fp = fopen(_PATH_SHELLS, "re")) == NULL) return NS_UNAVAIL; cp = line; Modified: head/lib/libc/gen/getutxent.c ============================================================================== --- head/lib/libc/gen/getutxent.c Mon Dec 10 17:34:33 2012 (r244091) +++ head/lib/libc/gen/getutxent.c Mon Dec 10 17:56:51 2012 (r244092) @@ -71,7 +71,7 @@ setutxdb(int db, const char *file) if (uf != NULL) fclose(uf); - uf = fopen(file, "r"); + uf = fopen(file, "re"); if (uf == NULL) return (-1); From owner-svn-src-head@FreeBSD.ORG Mon Dec 10 18:47:51 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 42C61C0D; Mon, 10 Dec 2012 18:47:51 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id 9D52B8FC12; Mon, 10 Dec 2012 18:47:50 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.5/8.14.5) with ESMTP id qBAIlk7H076371; Mon, 10 Dec 2012 20:47:46 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.7.1 kib.kiev.ua qBAIlk7H076371 Received: (from kostik@localhost) by tom.home (8.14.5/8.14.5/Submit) id qBAIlk1X076370; Mon, 10 Dec 2012 20:47:46 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 10 Dec 2012 20:47:46 +0200 From: Konstantin Belousov To: Robert Watson Subject: Re: svn commit: r244077 - head/sys/amd64/amd64 Message-ID: <20121210184746.GT3013@kib.kiev.ua> References: <201212100514.qBA5EZFE027334@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="N+O7Igoq2jFl2p2/" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 10 Dec 2012 18:47:51 -0000 --N+O7Igoq2jFl2p2/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Dec 10, 2012 at 08:39:47AM +0000, Robert Watson wrote: >=20 > On Mon, 10 Dec 2012, Konstantin Belousov wrote: >=20 > > Author: kib > > Date: Mon Dec 10 05:14:34 2012 > > New Revision: 244077 > > URL: http://svnweb.freebsd.org/changeset/base/244077 > > > > Log: > > Add amd64-specific ddb command "show pte". The command displays the > > hierarchy of the page table entries which map the specified address. > > > > Reviewed by: alc (previous version) > > Sponsored by: The FreeBSD Foundation > > MFC after: 1 week >=20 > Ah, very nice indeed -- I'd actually like to see similar MD page table > dumping routines for other architectures, especially MIPS with its > software-defined page tables. The facility is indeed MD, so it is up to the maintainers of the architectures to add this or similar command for their stuff. --N+O7Igoq2jFl2p2/ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQIcBAEBAgAGBQJQxi5QAAoJEJDCuSvBvK1Bjp8QAJoKwIgWhR647t9arrJlRvSN UJ9qe1b9vSosmDcamxaF63ujb2/3XEAjsBCdz+88AAI92cpyvWL9vnWyma9a9FWD 3e3Bf4PzIm7/zBgOy+j6ngrG/o7SXLQljcoNSUswRwqR4RvbIWnLB1b3omVzb8cr PgfbqUKvlKhni5IUP6cs5Eovl04OXIj2goOgz44Q81vTyg3PgCPoGSwfHE3ck9p+ nb9G3UXSKXe2LpQn2GoBc29UH6CZvNtvfwV1LyV0lHJn7ZPWxTeP9lBRUmNUCf9F ZFQhnrNUBQQNfxn2k8I0Z0YMrGMG5ueEMGPP4ZKERsyHoUghijlyVdDNQVe5/kTL Kh+GjHiC4CSLLjquJ2tGQDz/YH6f2+DiAyH1rL3c+4fbra+oqk2bufMHMImy9VVY E2yDojPD8G2VtA2ir3D9E0v6BfH8m8VyZXVLVIkGuLVUpiHLJJMHKH1L+0k+fs2G W2u0n9g/Dx/ncpf3LNbWuCUbHBmm9BltvU8F7pSliYtNKzoRDNHQH3vNfgXxMU4E +zVhb3AWytwBB7Ohb0j0ZjZ8P6HiR/TVNPrnPau73n4iT+har8KfKTFL06xv6Zhx gz2i670Sl6jYaD7tSU+asHe+MnNMPnIVLqzYcaW6Vx+CO8VmgAJEM4ZaBYd875g7 nK/bWvn9+NTjxjd9zfTt =l5rE -----END PGP SIGNATURE----- --N+O7Igoq2jFl2p2/-- From owner-svn-src-head@FreeBSD.ORG Mon Dec 10 20:44:10 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 572B1477; Mon, 10 Dec 2012 20:44:10 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3C9F58FC12; Mon, 10 Dec 2012 20:44:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBAKiAWn009463; Mon, 10 Dec 2012 20:44:10 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBAKiAb1009462; Mon, 10 Dec 2012 20:44:10 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201212102044.qBAKiAb1009462@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 10 Dec 2012 20:44:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244095 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 10 Dec 2012 20:44:10 -0000 Author: kib Date: Mon Dec 10 20:44:09 2012 New Revision: 244095 URL: http://svnweb.freebsd.org/changeset/base/244095 Log: Do not yield while owning a mutex. The Giant reacquire in the kern_yield() is problematic than. The owned mutex is the mount interlock, and it is in fact not needed to guarantee the stability of the mount list of active vnodes, so fix the the issue by only taking the mount interlock for MNT_REF and MNT_REL operations. While there, augment the unconditional yield by some amount of spinning [1]. Reported and tested by: pho Reviewed by: attilio Submitted by: attilio [1] MFC after: 3 days Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Mon Dec 10 20:10:20 2012 (r244094) +++ head/sys/kern/vfs_subr.c Mon Dec 10 20:44:09 2012 (r244095) @@ -4717,9 +4717,8 @@ __mnt_vnode_next_active(struct vnode **m if (should_yield()) kern_yield(PRI_UNCHANGED); - MNT_ILOCK(mp); -restart: mtx_lock(&vnode_free_list_mtx); +restart: KASSERT((*mvp)->v_mount == mp, ("marker vnode mount list mismatch")); vp = TAILQ_NEXT(*mvp, v_actfreelist); while (vp != NULL) { @@ -4728,8 +4727,11 @@ restart: continue; } if (!VI_TRYLOCK(vp)) { - mtx_unlock(&vnode_free_list_mtx); - kern_yield(PRI_UNCHANGED); + if (should_yield()) { + mtx_unlock(&vnode_free_list_mtx); + kern_yield(PRI_UNCHANGED); + mtx_lock(&vnode_free_list_mtx); + } goto restart; } if (vp->v_mount == mp && vp->v_type != VMARKER && @@ -4744,14 +4746,12 @@ restart: if (vp == NULL) { mtx_unlock(&vnode_free_list_mtx); __mnt_vnode_markerfree_active(mvp, mp); - /* MNT_IUNLOCK(mp); -- done in above function */ mtx_assert(MNT_MTX(mp), MA_NOTOWNED); return (NULL); } TAILQ_REMOVE(&mp->mnt_activevnodelist, *mvp, v_actfreelist); TAILQ_INSERT_AFTER(&mp->mnt_activevnodelist, vp, *mvp, v_actfreelist); mtx_unlock(&vnode_free_list_mtx); - MNT_IUNLOCK(mp); ASSERT_VI_LOCKED(vp, "active iter"); KASSERT((vp->v_iflag & VI_ACTIVE) != 0, ("Non-active vp %p", vp)); return (vp); @@ -4765,10 +4765,12 @@ __mnt_vnode_first_active(struct vnode ** *mvp = malloc(sizeof(struct vnode), M_VNODE_MARKER, M_WAITOK | M_ZERO); MNT_ILOCK(mp); MNT_REF(mp); + MNT_IUNLOCK(mp); (*mvp)->v_type = VMARKER; + (*mvp)->v_mount = mp; -restart: mtx_lock(&vnode_free_list_mtx); +restart: vp = TAILQ_FIRST(&mp->mnt_activevnodelist); while (vp != NULL) { if (vp->v_type == VMARKER) { @@ -4776,8 +4778,11 @@ restart: continue; } if (!VI_TRYLOCK(vp)) { - mtx_unlock(&vnode_free_list_mtx); - kern_yield(PRI_UNCHANGED); + if (should_yield()) { + mtx_unlock(&vnode_free_list_mtx); + kern_yield(PRI_UNCHANGED); + mtx_lock(&vnode_free_list_mtx); + } goto restart; } if (vp->v_mount == mp && vp->v_type != VMARKER && @@ -4791,16 +4796,15 @@ restart: /* Check if we are done */ if (vp == NULL) { mtx_unlock(&vnode_free_list_mtx); + MNT_ILOCK(mp); MNT_REL(mp); MNT_IUNLOCK(mp); free(*mvp, M_VNODE_MARKER); *mvp = NULL; return (NULL); } - (*mvp)->v_mount = mp; TAILQ_INSERT_AFTER(&mp->mnt_activevnodelist, vp, *mvp, v_actfreelist); mtx_unlock(&vnode_free_list_mtx); - MNT_IUNLOCK(mp); ASSERT_VI_LOCKED(vp, "active iter first"); KASSERT((vp->v_iflag & VI_ACTIVE) != 0, ("Non-active vp %p", vp)); return (vp); @@ -4810,17 +4814,15 @@ void __mnt_vnode_markerfree_active(struct vnode **mvp, struct mount *mp) { - if (*mvp == NULL) { - MNT_IUNLOCK(mp); + if (*mvp == NULL) return; - } - - mtx_assert(MNT_MTX(mp), MA_OWNED); KASSERT((*mvp)->v_mount == mp, ("marker vnode mount list mismatch")); + mtx_lock(&vnode_free_list_mtx); TAILQ_REMOVE(&mp->mnt_activevnodelist, *mvp, v_actfreelist); mtx_unlock(&vnode_free_list_mtx); + MNT_ILOCK(mp); MNT_REL(mp); MNT_IUNLOCK(mp); free(*mvp, M_VNODE_MARKER); From owner-svn-src-head@FreeBSD.ORG Mon Dec 10 20:52:52 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D6C7D7EE; Mon, 10 Dec 2012 20:52:52 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A395A8FC16; Mon, 10 Dec 2012 20:52:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBAKqqv1011016; Mon, 10 Dec 2012 20:52:52 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBAKqqnY011015; Mon, 10 Dec 2012 20:52:52 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201212102052.qBAKqqnY011015@svn.freebsd.org> From: Xin LI Date: Mon, 10 Dec 2012 20:52:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244096 - head/etc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 10 Dec 2012 20:52:53 -0000 Author: delphij Date: Mon Dec 10 20:52:52 2012 New Revision: 244096 URL: http://svnweb.freebsd.org/changeset/base/244096 Log: Sync pf.os with OpenBSD: add a handful of linux signatures from p0fv2 and some other signatures from observation. MFC after: 2 weeks Modified: head/etc/pf.os Modified: head/etc/pf.os ============================================================================== --- head/etc/pf.os Mon Dec 10 20:44:09 2012 (r244095) +++ head/etc/pf.os Mon Dec 10 20:52:52 2012 (r244096) @@ -1,5 +1,5 @@ # $FreeBSD$ -# $OpenBSD: pf.os,v 1.25 2010/10/18 15:55:27 deraadt Exp $ +# $OpenBSD: pf.os,v 1.26 2012/08/03 12:25:16 jsg Exp $ # passive OS fingerprinting # ------------------------- # @@ -226,7 +226,13 @@ S2:64:1:60:M*,S,T,N,W0: Linux:2.4::Linu S3:64:1:60:M*,S,T,N,W0: Linux:2.4:.18-21:Linux 2.4.18 and newer S4:64:1:60:M*,S,T,N,W0: Linux:2.4::Linux 2.4/2.6 <= 2.6.7 S4:64:1:60:M*,S,T,N,W0: Linux:2.6:.1-7:Linux 2.4/2.6 <= 2.6.7 -S4:64:1:60:M*,S,T,N,W7: Linux:2.6:8:Linux 2.6.8 and newer (?) + +S4:64:1:60:M*,S,T,N,W5: Linux:2.6::Linux 2.6 (newer, 1) +S4:64:1:60:M*,S,T,N,W6: Linux:2.6::Linux 2.6 (newer, 2) +S4:64:1:60:M*,S,T,N,W7: Linux:2.6::Linux 2.6 (newer, 3) +T4:64:1:60:M*,S,T,N,W7: Linux:2.6::Linux 2.6 (newer, 4) + +S10:64:1:60:M*,S,T,N,W4: Linux:3.0::Linux 3.0 S3:64:1:60:M*,S,T,N,W1: Linux:2.5::Linux 2.5 (sometimes 2.4) S4:64:1:60:M*,S,T,N,W1: Linux:2.5-2.6::Linux 2.5/2.6 @@ -429,6 +435,8 @@ S44:128:1:48:M*,N,N,S: Windows:XP:SP1: 32767:128:1:48:M*,N,N,S: Windows:2000:SP4:Windows SP1, 2000 SP4 32767:128:1:48:M*,N,N,S: Windows:XP:SP1:Windows SP1, 2000 SP4 +8192:128:1:52:M*,N,W2,N,N,S: Windows:Vista::Windows Vista/7 + # Odds, ends, mods: S52:128:1:48:M1260,N,N,S: Windows:2000:cisco:Windows XP/2000 via Cisco From owner-svn-src-head@FreeBSD.ORG Mon Dec 10 21:41:40 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 21212790; Mon, 10 Dec 2012 21:41:40 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id E244B8FC0C; Mon, 10 Dec 2012 21:41:39 +0000 (UTC) Received: from pakbsde14.localnet (unknown [38.105.238.108]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 44A8FB94A; Mon, 10 Dec 2012 16:41:39 -0500 (EST) From: John Baldwin To: Carl Delsey Subject: Re: svn commit: r243960 - in head/sys: amd64/include i386/include x86/include Date: Mon, 10 Dec 2012 14:47:09 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p22; KDE/4.5.5; amd64; ; ) References: <201212062233.qB6MXWpP046167@svn.freebsd.org> <201212071208.28158.jhb@freebsd.org> <50C2832C.9080501@intel.com> In-Reply-To: <50C2832C.9080501@intel.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201212101447.09407.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 10 Dec 2012 16:41:39 -0500 (EST) Cc: svn-src-head@freebsd.org, Jim Harris , svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 10 Dec 2012 21:41:40 -0000 On Friday, December 07, 2012 7:00:44 pm Carl Delsey wrote: > On 12/07/12 10:08, John Baldwin wrote: > > On Thursday, December 06, 2012 5:33:32 pm Jim Harris wrote: > >> Author: jimharris > >> Date: Thu Dec 6 22:33:31 2012 > >> New Revision: 243960 > >> URL: http://svnweb.freebsd.org/changeset/base/243960 > >> > >> Log: > >> Add amd64 implementations for 8-byte bus_space routines. > >> > >> Submitted by: Carl Delsey > >> Discussed with: jhb, rwatson > >> Reviewed by: jimharris > >> MFC after: 1 week > >> > >> Modified: > >> head/sys/amd64/include/bus.h > >> head/sys/i386/include/bus.h > >> head/sys/x86/include/bus.h > > Do we still want the link errors on i386? Do you get a compile error now? > > > You get a compile error now, since the function prototypes don't exist > for i386. That was the case in the old code too. The comments about > forcing a link error were incorrect or obsolete. Ok, sounds good to me, thanks! -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Dec 10 23:09:57 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 882B7914; Mon, 10 Dec 2012 23:09:57 +0000 (UTC) (envelope-from alfred@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 688028FC0C; Mon, 10 Dec 2012 23:09:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBAN9v7Y033965; Mon, 10 Dec 2012 23:09:57 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBAN9uCf033959; Mon, 10 Dec 2012 23:09:56 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <201212102309.qBAN9uCf033959@svn.freebsd.org> From: Alfred Perlstein Date: Mon, 10 Dec 2012 23:09:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244098 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 10 Dec 2012 23:09:57 -0000 Author: alfred Date: Mon Dec 10 23:09:55 2012 New Revision: 244098 URL: http://svnweb.freebsd.org/changeset/base/244098 Log: make sysctls kern.{bootfile,conftxt} read-only MFC after: 1 month Modified: head/sys/kern/kern_mib.c Modified: head/sys/kern/kern_mib.c ============================================================================== --- head/sys/kern/kern_mib.c Mon Dec 10 21:18:02 2012 (r244097) +++ head/sys/kern/kern_mib.c Mon Dec 10 23:09:55 2012 (r244098) @@ -141,7 +141,7 @@ SYSCTL_INT(_kern, KERN_SAVED_IDS, saved_ char kernelname[MAXPATHLEN] = "/kernel"; /* XXX bloat */ -SYSCTL_STRING(_kern, KERN_BOOTFILE, bootfile, CTLFLAG_RW, +SYSCTL_STRING(_kern, KERN_BOOTFILE, bootfile, CTLFLAG_RD, kernelname, sizeof kernelname, "Name of kernel file booted"); SYSCTL_INT(_hw, HW_NCPU, ncpu, CTLFLAG_RD|CTLFLAG_CAPRD, @@ -377,15 +377,8 @@ SYSCTL_PROC(_kern, KERN_SECURELVL, secur /* Actual kernel configuration options. */ extern char kernconfstring[]; -static int -sysctl_kern_config(SYSCTL_HANDLER_ARGS) -{ - return (sysctl_handle_string(oidp, kernconfstring, - strlen(kernconfstring), req)); -} - -SYSCTL_PROC(_kern, OID_AUTO, conftxt, CTLTYPE_STRING|CTLFLAG_RW, - 0, 0, sysctl_kern_config, "", "Kernel configuration file"); +SYSCTL_STRING(_kern, OID_AUTO, conftxt, CTLFLAG_RD, kernconfstring, 0, + "Kernel configuration file"); #endif static int From owner-svn-src-head@FreeBSD.ORG Mon Dec 10 23:11:26 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EDC73C54; Mon, 10 Dec 2012 23:11:26 +0000 (UTC) (envelope-from alfred@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D39F78FC0C; Mon, 10 Dec 2012 23:11:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBANBQe1034368; Mon, 10 Dec 2012 23:11:26 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBANBQwt034367; Mon, 10 Dec 2012 23:11:26 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <201212102311.qBANBQwt034367@svn.freebsd.org> From: Alfred Perlstein Date: Mon, 10 Dec 2012 23:11:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244099 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 10 Dec 2012 23:11:27 -0000 Author: alfred Date: Mon Dec 10 23:11:26 2012 New Revision: 244099 URL: http://svnweb.freebsd.org/changeset/base/244099 Log: allow KASSERT to enter KDB. Modified: head/sys/kern/kern_shutdown.c Modified: head/sys/kern/kern_shutdown.c ============================================================================== --- head/sys/kern/kern_shutdown.c Mon Dec 10 23:09:55 2012 (r244098) +++ head/sys/kern/kern_shutdown.c Mon Dec 10 23:11:26 2012 (r244099) @@ -542,6 +542,9 @@ shutdown_reset(void *junk, int howto) #ifdef INVARIANTS static int kassert_warn_only = 0; +#ifdef KDB +static int kassert_do_kdb = 0; +#endif #ifdef KTR static int kassert_do_ktr = 0; #endif @@ -558,6 +561,12 @@ SYSCTL_INT(_debug_kassert, OID_AUTO, war "KASSERT triggers a panic (1) or just a warning (0)"); TUNABLE_INT("debug.kassert.warn_only", &kassert_warn_only); +#ifdef KDB +SYSCTL_INT(_debug_kassert, OID_AUTO, do_kdb, CTLFLAG_RW | CTLFLAG_TUN, + &kassert_do_kdb, 0, "KASSERT will enter the debugger"); +TUNABLE_INT("debug.kassert.do_kdb", &kassert_do_kdb); +#endif + #ifdef KTR SYSCTL_UINT(_debug_kassert, OID_AUTO, do_ktr, CTLFLAG_RW | CTLFLAG_TUN, &kassert_do_ktr, 0, @@ -650,6 +659,11 @@ kassert_panic(const char *fmt, ...) kdb_backtrace(); } } +#ifdef KDB + if (kassert_do_kdb) { + kdb_enter(KDB_WHY_KASSERT, buf); + } +#endif atomic_add_int(&kassert_warnings, 1); } #endif From owner-svn-src-head@FreeBSD.ORG Mon Dec 10 23:12:52 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4874CDF0; Mon, 10 Dec 2012 23:12:52 +0000 (UTC) (envelope-from alfred@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2E3038FC1C; Mon, 10 Dec 2012 23:12:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBANCqwJ034706; Mon, 10 Dec 2012 23:12:52 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBANCq34034705; Mon, 10 Dec 2012 23:12:52 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <201212102312.qBANCq34034705@svn.freebsd.org> From: Alfred Perlstein Date: Mon, 10 Dec 2012 23:12:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244100 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 10 Dec 2012 23:12:52 -0000 Author: alfred Date: Mon Dec 10 23:12:51 2012 New Revision: 244100 URL: http://svnweb.freebsd.org/changeset/base/244100 Log: Add constant missed in r244099 KDB entered due to KASSERT. Modified: head/sys/sys/kdb.h Modified: head/sys/sys/kdb.h ============================================================================== --- head/sys/sys/kdb.h Mon Dec 10 23:11:26 2012 (r244099) +++ head/sys/sys/kdb.h Mon Dec 10 23:12:51 2012 (r244100) @@ -97,6 +97,7 @@ int kdb_trap(int, int, struct trapframe extern const char * volatile kdb_why; #define KDB_WHY_UNSET NULL /* No reason set. */ #define KDB_WHY_PANIC "panic" /* panic() was called. */ +#define KDB_WHY_KASSERT "kassert" /* kassert failed. */ #define KDB_WHY_SYSCTL "sysctl" /* Sysctl entered debugger. */ #define KDB_WHY_BOOTFLAGS "bootflags" /* Boot flags were set. */ #define KDB_WHY_WITNESS "witness" /* Witness entered debugger. */ From owner-svn-src-head@FreeBSD.ORG Mon Dec 10 23:14:53 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7C072F70; Mon, 10 Dec 2012 23:14:53 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id CE3568FC08; Mon, 10 Dec 2012 23:14:52 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.5/8.14.5) with ESMTP id qBANEmro002803; Tue, 11 Dec 2012 01:14:48 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.7.1 kib.kiev.ua qBANEmro002803 Received: (from kostik@localhost) by tom.home (8.14.5/8.14.5/Submit) id qBANEmxp002802; Tue, 11 Dec 2012 01:14:48 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 11 Dec 2012 01:14:48 +0200 From: Konstantin Belousov To: Alfred Perlstein Subject: Re: svn commit: r244098 - head/sys/kern Message-ID: <20121210231448.GX3013@kib.kiev.ua> References: <201212102309.qBAN9uCf033959@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="cMBqRQ/74NaVL1Kq" Content-Disposition: inline In-Reply-To: <201212102309.qBAN9uCf033959@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 10 Dec 2012 23:14:53 -0000 --cMBqRQ/74NaVL1Kq Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Dec 10, 2012 at 11:09:56PM +0000, Alfred Perlstein wrote: > Author: alfred > Date: Mon Dec 10 23:09:55 2012 > New Revision: 244098 > URL: http://svnweb.freebsd.org/changeset/base/244098 >=20 > Log: > make sysctls kern.{bootfile,conftxt} read-only You just break installkernel. --cMBqRQ/74NaVL1Kq Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQIcBAEBAgAGBQJQxmznAAoJEJDCuSvBvK1BeY4P/0KjX5peERIB8I0NYaTPn7jq fdd/kEakvXmK+oy6uSyzLUjqTWAoZlTzk/F0TVF1T+rXXZjIsFjjGOJcUlqSuJcg jBmlDSXuf0Bs2jEQE5XfOHc50YR1CGQOkWk8DT28mOw8p0QtMQQNcBUJqhNFKgAt W9/qu3cHuBMrYf5cJSgE3Up1FTVhdeaIGzjHoeNYW9svgoZVbZ5rEFj+vswzXV1x xaaDdJftM3j8qTPJWXQ/r2aPG3Tq9GrlLRwFFYHpJGJMPcfEN22c0Ct1BkyYAI3D AyrVM1Hw7D43FmNxTQsMHuhTNv6dd8dQDR4Xo77IwUwkE4mJOu8/EuVKnLRWFuMW bs9UTCmFT/pG94cpXVyWEH1Z9uiR5k6pUOGS7kH4domwucWlab5IbcWb8fuHuLt+ VyLqoUfkQ7YjC/L7nYXvn7zxMCIXweeJKvG6tWsRZo3J7yOEOT9zxsmixAga49op tjhNmByIxLs0f3+f8gdQpXSY4tCuRFJ3/Yu7xnkYbyTLOHf9Idf/A2K1CPCgzmJs HQHdYGYn6bdakKnArGvyqKanCYALc0POzK6hGeL+H1ZqaKDgm00P32hyY46kOBUL 1qEW7VCmxQAgc6OxDuQPjr7dV3+oBXrWs1d+bECuTFTGNewEGNcc+kq0OHHu7JhN zwCivCzGlJhOt2D7KimE =Dg9C -----END PGP SIGNATURE----- --cMBqRQ/74NaVL1Kq-- From owner-svn-src-head@FreeBSD.ORG Mon Dec 10 23:17:09 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 87A24258; Mon, 10 Dec 2012 23:17:09 +0000 (UTC) (envelope-from alfred@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6AABA8FC12; Mon, 10 Dec 2012 23:17:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBANH9Lm035653; Mon, 10 Dec 2012 23:17:09 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBANH92o035652; Mon, 10 Dec 2012 23:17:09 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <201212102317.qBANH92o035652@svn.freebsd.org> From: Alfred Perlstein Date: Mon, 10 Dec 2012 23:17:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244101 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 10 Dec 2012 23:17:09 -0000 Author: alfred Date: Mon Dec 10 23:17:08 2012 New Revision: 244101 URL: http://svnweb.freebsd.org/changeset/base/244101 Log: Add CTLFLAG_STATS to sysctl flags In preparation for sysctl(8) growing the ability to only print out boot/run-time tunables we need a way to differentiate between RW sysctl nodes that tune a particular thing, or simply export a stat that we want to allow the sysadmin to reset to 0 (or some other value). To do so, we add the CTLFLAG_STATS which should be OR'd into the CTLFLAGs when exporting a "writable/resettable" statistic node via sysctl. Modified: head/sys/sys/sysctl.h Modified: head/sys/sys/sysctl.h ============================================================================== --- head/sys/sys/sysctl.h Mon Dec 10 23:12:51 2012 (r244100) +++ head/sys/sys/sysctl.h Mon Dec 10 23:17:08 2012 (r244101) @@ -90,6 +90,7 @@ struct ctlname { #define CTLFLAG_DYING 0x00010000 /* oid is being removed */ #define CTLFLAG_CAPRD 0x00008000 /* Can be read in capability mode */ #define CTLFLAG_CAPWR 0x00004000 /* Can be written in capability mode */ +#define CTLFLAG_STATS 0x00002000 /* Statistics, not a tuneable */ #define CTLFLAG_CAPRW (CTLFLAG_CAPRD|CTLFLAG_CAPWR) /* From owner-svn-src-head@FreeBSD.ORG Mon Dec 10 23:20:19 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3C5B2733; Mon, 10 Dec 2012 23:20:19 +0000 (UTC) (envelope-from zeising@freebsd.org) Received: from mail.lysator.liu.se (mail.lysator.liu.se [IPv6:2001:6b0:17:f0a0::3]) by mx1.freebsd.org (Postfix) with ESMTP id A9EB78FC15; Mon, 10 Dec 2012 23:20:18 +0000 (UTC) Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id 0916A40003; Tue, 11 Dec 2012 00:20:18 +0100 (CET) Received: by mail.lysator.liu.se (Postfix, from userid 1004) id F314E40005; Tue, 11 Dec 2012 00:20:17 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bernadotte.lysator.liu.se X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=AWL autolearn=disabled version=3.3.1 X-Spam-Score: 0.0 Received: from mx.daemonic.se (h-45-105.a163.priv.bahnhof.se [94.254.45.105]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.lysator.liu.se (Postfix) with ESMTPSA id 363A140003; Tue, 11 Dec 2012 00:20:17 +0100 (CET) Received: from mailscanner.daemonic.se (mailscanner.daemonic.se [IPv6:2001:470:dca9:0:1::6]) by mx.daemonic.se (Postfix) with ESMTPS id 3YL0cx01Mqz8hVn; Tue, 11 Dec 2012 00:20:17 +0100 (CET) X-Virus-Scanned: amavisd-new at daemonic.se Received: from mx.daemonic.se ([10.1.0.3]) (using TLS with cipher CAMELLIA256-SHA) by mailscanner.daemonic.se (mailscanner.daemonic.se [10.1.0.6]) (amavisd-new, port 10025) with ESMTPS id UyWPydcg3Eqv; Tue, 11 Dec 2012 00:20:14 +0100 (CET) Received: from mail.daemonic.se (mail.daemonic.se [IPv6:2001:470:dca9:0:1::4]) by mx.daemonic.se (Postfix) with ESMTPS id 3YL0ct4M9nz8hVm; Tue, 11 Dec 2012 00:20:14 +0100 (CET) Received: from vivi.daemonic.se (vivi.daemonic.se [IPv6:2001:470:dca9:1::4]) by mail.daemonic.se (Postfix) with ESMTPSA id 3YL0ct41jfz9Ctj; Tue, 11 Dec 2012 00:20:14 +0100 (CET) Message-ID: <50C66E2E.5040302@freebsd.org> Date: Tue, 11 Dec 2012 00:20:14 +0100 From: Niclas Zeising User-Agent: Mutt/1.5.21 MIME-Version: 1.0 To: Jim Harris Subject: Re: svn commit: r243960 - in head/sys: amd64/include i386/include x86/include References: <201212062233.qB6MXWpP046167@svn.freebsd.org> In-Reply-To: <201212062233.qB6MXWpP046167@svn.freebsd.org> X-Enigmail-Version: 1.4.6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 10 Dec 2012 23:20:19 -0000 On 12/06/12 23:33, Jim Harris wrote: > Author: jimharris > Date: Thu Dec 6 22:33:31 2012 > New Revision: 243960 > URL: http://svnweb.freebsd.org/changeset/base/243960 > > Log: > Add amd64 implementations for 8-byte bus_space routines. > > +#include > #include > + > +#define KASSERT_BUS_SPACE_MEM_ONLY(tag) \ > + KASSERT((tag) == X86_BUS_SPACE_MEM, \ > + ("%s: can only handle mem space", __func__)) > + > +static __inline uint64_t > +bus_space_read_8(bus_space_tag_t tag, bus_space_handle_t bsh, > + bus_size_t ofs) > +{ > + > + KASSERT_BUS_SPACE_MEM_ONLY(tag); > + > + return (*(volatile uint64_t *)(bsh + ofs)); > +} Hi! Can the include of and the added KASSERTs please be hidden under #ifdef _KERNEL or something similar? devel/libpciaccess from the experimental xorg-dev tree (http://trillian.chruetertee.ch/ports/browser/trunk/devel/libpciaccess) uses machine/bus.h on amd64 and i386 to be able to read/write to the pci bus, and this change breaks the compile of devel/libpciaccess. It is probably so that libpciaccess is wrong in using but I have no idea how to fix it. If you have a better suggestion on how to fix libpciaccess I am all ears. Regards! -- Niclas Zeising From owner-svn-src-head@FreeBSD.ORG Mon Dec 10 23:33:04 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E9CA0E34; Mon, 10 Dec 2012 23:33:04 +0000 (UTC) (envelope-from carl.r.delsey@intel.com) Received: from mga14.intel.com (mga14.intel.com [143.182.124.37]) by mx1.freebsd.org (Postfix) with ESMTP id 901988FC13; Mon, 10 Dec 2012 23:33:04 +0000 (UTC) Received: from azsmga002.ch.intel.com ([10.2.17.35]) by azsmga102.ch.intel.com with ESMTP; 10 Dec 2012 15:32:58 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.84,254,1355126400"; d="scan'208";a="179153612" Received: from crdelsey-fbsd.ch.intel.com (HELO [10.2.105.127]) ([10.2.105.127]) by AZSMGA002.ch.intel.com with ESMTP; 10 Dec 2012 15:32:57 -0800 Message-ID: <50C67129.6090704@intel.com> Date: Mon, 10 Dec 2012 16:32:57 -0700 From: Carl Delsey User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:13.0) Gecko/20120724 Thunderbird/13.0.1 MIME-Version: 1.0 To: Niclas Zeising Subject: Re: svn commit: r243960 - in head/sys: amd64/include i386/include x86/include References: <201212062233.qB6MXWpP046167@svn.freebsd.org> <50C66E2E.5040302@freebsd.org> In-Reply-To: <50C66E2E.5040302@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, Jim Harris , svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 10 Dec 2012 23:33:05 -0000 On 12/10/12 16:20, Niclas Zeising wrote: > On 12/06/12 23:33, Jim Harris wrote: >> Author: jimharris >> Date: Thu Dec 6 22:33:31 2012 >> New Revision: 243960 >> URL: http://svnweb.freebsd.org/changeset/base/243960 >> >> Log: >> Add amd64 implementations for 8-byte bus_space routines. >> >> +#include >> #include >> + >> +#define KASSERT_BUS_SPACE_MEM_ONLY(tag) \ >> + KASSERT((tag) == X86_BUS_SPACE_MEM, \ >> + ("%s: can only handle mem space", __func__)) >> + >> +static __inline uint64_t >> +bus_space_read_8(bus_space_tag_t tag, bus_space_handle_t bsh, >> + bus_size_t ofs) >> +{ >> + >> + KASSERT_BUS_SPACE_MEM_ONLY(tag); >> + >> + return (*(volatile uint64_t *)(bsh + ofs)); >> +} > Hi! > Can the include of and the added KASSERTs please be hidden > under #ifdef _KERNEL or something similar? devel/libpciaccess from the > experimental xorg-dev tree > (http://trillian.chruetertee.ch/ports/browser/trunk/devel/libpciaccess) > uses machine/bus.h on amd64 and i386 to be able to read/write to the pci > bus, and this change breaks the compile of devel/libpciaccess. > It is probably so that libpciaccess is wrong in using > but I have no idea how to fix it. If you have a better suggestion on > how to fix libpciaccess I am all ears. > Regards! Does libpciaccess make use of the bus_space_read/write_* routines in these files, or does it just use some constants and types from them? From owner-svn-src-head@FreeBSD.ORG Mon Dec 10 23:38:14 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D4198EC; Mon, 10 Dec 2012 23:38:14 +0000 (UTC) (envelope-from bright@mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 81BCF8FC0C; Mon, 10 Dec 2012 23:38:14 +0000 (UTC) Received: from kruse-124.4.ixsystems.com (drawbridge.ixsystems.com [206.40.55.65]) by elvis.mu.org (Postfix) with ESMTPSA id 1565E1A3C1C; Mon, 10 Dec 2012 15:38:14 -0800 (PST) Message-ID: <50C67272.4080008@mu.org> Date: Mon, 10 Dec 2012 15:38:26 -0800 From: Alfred Perlstein User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Konstantin Belousov Subject: Re: svn commit: r244098 - head/sys/kern References: <201212102309.qBAN9uCf033959@svn.freebsd.org> <20121210231448.GX3013@kib.kiev.ua> In-Reply-To: <20121210231448.GX3013@kib.kiev.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, Alfred Perlstein , src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 10 Dec 2012 23:38:14 -0000 On 12/10/12 3:14 PM, Konstantin Belousov wrote: > On Mon, Dec 10, 2012 at 11:09:56PM +0000, Alfred Perlstein wrote: >> Author: alfred >> Date: Mon Dec 10 23:09:55 2012 >> New Revision: 244098 >> URL: http://svnweb.freebsd.org/changeset/base/244098 >> >> Log: >> make sysctls kern.{bootfile,conftxt} read-only > You just break installkernel. My apologies, give me a few moments to double check this and I will back out. -Alfred From owner-svn-src-head@FreeBSD.ORG Mon Dec 10 23:40:22 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0C83D278; Mon, 10 Dec 2012 23:40:22 +0000 (UTC) (envelope-from zeising@freebsd.org) Received: from mail.lysator.liu.se (mail.lysator.liu.se [IPv6:2001:6b0:17:f0a0::3]) by mx1.freebsd.org (Postfix) with ESMTP id 5F7748FC14; Mon, 10 Dec 2012 23:40:21 +0000 (UTC) Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id 4B64F40006; Tue, 11 Dec 2012 00:40:20 +0100 (CET) Received: by mail.lysator.liu.se (Postfix, from userid 1004) id 3B51740005; Tue, 11 Dec 2012 00:40:20 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bernadotte.lysator.liu.se X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=AWL autolearn=disabled version=3.3.1 X-Spam-Score: 0.0 Received: from mx.daemonic.se (mx.daemonic.se [IPv6:2001:470:dca9:0:1::3]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.lysator.liu.se (Postfix) with ESMTPSA id 7DD1B40003; Tue, 11 Dec 2012 00:40:19 +0100 (CET) Received: from mailscanner.daemonic.se (mailscanner.daemonic.se [IPv6:2001:470:dca9:0:1::6]) by mx.daemonic.se (Postfix) with ESMTPS id 3YL143137Kz8hVn; Tue, 11 Dec 2012 00:40:19 +0100 (CET) X-Virus-Scanned: amavisd-new at daemonic.se Received: from mx.daemonic.se ([10.1.0.3]) (using TLS with cipher CAMELLIA256-SHA) by mailscanner.daemonic.se (mailscanner.daemonic.se [10.1.0.6]) (amavisd-new, port 10025) with ESMTPS id CvAV-5ZiHyT3; Tue, 11 Dec 2012 00:40:16 +0100 (CET) Received: from mail.daemonic.se (mail.daemonic.se [10.1.0.4]) by mx.daemonic.se (Postfix) with ESMTPS id 3YL1404N7Gz8hVm; Tue, 11 Dec 2012 00:40:16 +0100 (CET) Received: from vivi.daemonic.se (vivi.daemonic.se [10.32.0.4]) by mail.daemonic.se (Postfix) with ESMTPSA id 3YL1403k25z9Ctj; Tue, 11 Dec 2012 00:40:16 +0100 (CET) Message-ID: <50C672D0.9090908@freebsd.org> Date: Tue, 11 Dec 2012 00:40:00 +0100 From: Niclas Zeising User-Agent: Mutt/1.5.21 MIME-Version: 1.0 To: Carl Delsey Subject: Re: svn commit: r243960 - in head/sys: amd64/include i386/include x86/include References: <201212062233.qB6MXWpP046167@svn.freebsd.org> <50C66E2E.5040302@freebsd.org> <50C67129.6090704@intel.com> In-Reply-To: <50C67129.6090704@intel.com> X-Enigmail-Version: 1.4.6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Virus-Scanned: ClamAV using ClamSMTP Cc: svn-src-head@freebsd.org, Jim Harris , svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 10 Dec 2012 23:40:22 -0000 On 12/11/12 00:32, Carl Delsey wrote: > On 12/10/12 16:20, Niclas Zeising wrote: >> On 12/06/12 23:33, Jim Harris wrote: >>> Author: jimharris >>> Date: Thu Dec 6 22:33:31 2012 >>> New Revision: 243960 >>> URL: http://svnweb.freebsd.org/changeset/base/243960 >>> >>> Log: >>> Add amd64 implementations for 8-byte bus_space routines. >>> +#include >>> #include >>> + >>> +#define KASSERT_BUS_SPACE_MEM_ONLY(tag) \ >>> + KASSERT((tag) == X86_BUS_SPACE_MEM, \ >>> + ("%s: can only handle mem space", __func__)) >>> + >>> +static __inline uint64_t >>> +bus_space_read_8(bus_space_tag_t tag, bus_space_handle_t bsh, >>> + bus_size_t ofs) >>> +{ >>> + >>> + KASSERT_BUS_SPACE_MEM_ONLY(tag); >>> + >>> + return (*(volatile uint64_t *)(bsh + ofs)); >>> +} >> Hi! >> Can the include of and the added KASSERTs please be hidden >> under #ifdef _KERNEL or something similar? devel/libpciaccess from the >> experimental xorg-dev tree >> (http://trillian.chruetertee.ch/ports/browser/trunk/devel/libpciaccess) >> uses machine/bus.h on amd64 and i386 to be able to read/write to the pci >> bus, and this change breaks the compile of devel/libpciaccess. >> It is probably so that libpciaccess is wrong in using >> but I have no idea how to fix it. If you have a better suggestion on >> how to fix libpciaccess I am all ears. >> Regards! > Does libpciaccess make use of the bus_space_read/write_* routines in > these files, or does it just use some constants and types from them? > libpciaccess uses bus_space_[read,write]_[1,2,4], which are defined in x86/bus.h. It does not use the quad functions. Regards! -- Niclas Zeising From owner-svn-src-head@FreeBSD.ORG Mon Dec 10 23:50:57 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0080B672; Mon, 10 Dec 2012 23:50:56 +0000 (UTC) (envelope-from bright@mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 787B68FC0C; Mon, 10 Dec 2012 23:50:56 +0000 (UTC) Received: from kruse-124.4.ixsystems.com (drawbridge.ixsystems.com [206.40.55.65]) by elvis.mu.org (Postfix) with ESMTPSA id 973CB1A3C1B; Mon, 10 Dec 2012 15:50:55 -0800 (PST) Message-ID: <50C6756B.80607@mu.org> Date: Mon, 10 Dec 2012 15:51:07 -0800 From: Alfred Perlstein User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Konstantin Belousov Subject: Re: svn commit: r244098 - head/sys/kern References: <201212102309.qBAN9uCf033959@svn.freebsd.org> <20121210231448.GX3013@kib.kiev.ua> <50C67272.4080008@mu.org> In-Reply-To: <50C67272.4080008@mu.org> 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, Alfred Perlstein , src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 10 Dec 2012 23:50:57 -0000 On 12/10/12 3:38 PM, Alfred Perlstein wrote: > On 12/10/12 3:14 PM, Konstantin Belousov wrote: >> On Mon, Dec 10, 2012 at 11:09:56PM +0000, Alfred Perlstein wrote: >>> Author: alfred >>> Date: Mon Dec 10 23:09:55 2012 >>> New Revision: 244098 >>> URL: http://svnweb.freebsd.org/changeset/base/244098 >>> >>> Log: >>> make sysctls kern.{bootfile,conftxt} read-only >> You just break installkernel. > My apologies, give me a few moments to double check this and I will > back out. So first off "installkernel" was not broken, the error is ignored by make, hence why I didn't see it. Second off, this is pretty broken, the first time you "installkernel" it gets it right, the second time it just seems to set kern.bootfile to /boot/kernel.old/kernel no even though that's not really the boot kernel. I will back out the change, but this just seems off. If we are going to change kern.bootfile, then we ought to detect when it's no longer valid at all and just zero it. or pretty much do something else. -Alfred From owner-svn-src-head@FreeBSD.ORG Mon Dec 10 23:54:56 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1111E94C; Mon, 10 Dec 2012 23:54:56 +0000 (UTC) (envelope-from carl.r.delsey@intel.com) Received: from mga14.intel.com (mga14.intel.com [143.182.124.37]) by mx1.freebsd.org (Postfix) with ESMTP id AE6448FC17; Mon, 10 Dec 2012 23:54:55 +0000 (UTC) Received: from azsmga002.ch.intel.com ([10.2.17.35]) by azsmga102.ch.intel.com with ESMTP; 10 Dec 2012 15:54:54 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.84,254,1355126400"; d="scan'208";a="179160694" Received: from crdelsey-fbsd.ch.intel.com (HELO [10.2.105.127]) ([10.2.105.127]) by AZSMGA002.ch.intel.com with ESMTP; 10 Dec 2012 15:54:54 -0800 Message-ID: <50C6764E.4040804@intel.com> Date: Mon, 10 Dec 2012 16:54:54 -0700 From: Carl Delsey User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:13.0) Gecko/20120724 Thunderbird/13.0.1 MIME-Version: 1.0 To: Niclas Zeising Subject: Re: svn commit: r243960 - in head/sys: amd64/include i386/include x86/include References: <201212062233.qB6MXWpP046167@svn.freebsd.org> <50C66E2E.5040302@freebsd.org> <50C67129.6090704@intel.com> <50C672D0.9090908@freebsd.org> In-Reply-To: <50C672D0.9090908@freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, Jim Harris , svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 10 Dec 2012 23:54:56 -0000 On 12/10/12 16:40, Niclas Zeising wrote: > On 12/11/12 00:32, Carl Delsey wrote: >> On 12/10/12 16:20, Niclas Zeising wrote: >>> On 12/06/12 23:33, Jim Harris wrote: >>>> Author: jimharris >>>> Date: Thu Dec 6 22:33:31 2012 >>>> New Revision: 243960 >>>> URL: http://svnweb.freebsd.org/changeset/base/243960 >>>> >>>> Log: >>>> Add amd64 implementations for 8-byte bus_space routines. >>>> +#include >>>> #include >>>> + >>>> +#define KASSERT_BUS_SPACE_MEM_ONLY(tag) \ >>>> + KASSERT((tag) == X86_BUS_SPACE_MEM, \ >>>> + ("%s: can only handle mem space", __func__)) >>>> + >>>> +static __inline uint64_t >>>> +bus_space_read_8(bus_space_tag_t tag, bus_space_handle_t bsh, >>>> + bus_size_t ofs) >>>> +{ >>>> + >>>> + KASSERT_BUS_SPACE_MEM_ONLY(tag); >>>> + >>>> + return (*(volatile uint64_t *)(bsh + ofs)); >>>> +} >>> Hi! >>> Can the include of and the added KASSERTs please be hidden >>> under #ifdef _KERNEL or something similar? devel/libpciaccess from the >>> experimental xorg-dev tree >>> (http://trillian.chruetertee.ch/ports/browser/trunk/devel/libpciaccess) >>> uses machine/bus.h on amd64 and i386 to be able to read/write to the pci >>> bus, and this change breaks the compile of devel/libpciaccess. >>> It is probably so that libpciaccess is wrong in using >>> but I have no idea how to fix it. If you have a better suggestion on >>> how to fix libpciaccess I am all ears. >>> Regards! >> Does libpciaccess make use of the bus_space_read/write_* routines in >> these files, or does it just use some constants and types from them? >> > libpciaccess uses bus_space_[read,write]_[1,2,4], which are defined in > x86/bus.h. It does not use the quad functions. > Regards! Ok. In that case I won't ifdef out the functions themselves, just the KASSERT in case libpciaccess expands in the future to 8 byte accesses :-) I had another related change in the works. I'll add this change in. Thanks, Carl From owner-svn-src-head@FreeBSD.ORG Tue Dec 11 00:08:29 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AD264DFE; Tue, 11 Dec 2012 00:08:29 +0000 (UTC) (envelope-from bright@mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 614308FC08; Tue, 11 Dec 2012 00:08:29 +0000 (UTC) Received: from kruse-124.4.ixsystems.com (drawbridge.ixsystems.com [206.40.55.65]) by elvis.mu.org (Postfix) with ESMTPSA id 2909B1A3DCA; Mon, 10 Dec 2012 16:08:29 -0800 (PST) Message-ID: <50C67989.7070401@mu.org> Date: Mon, 10 Dec 2012 16:08:41 -0800 From: Alfred Perlstein User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Konstantin Belousov Subject: Re: svn commit: r244098 - head/sys/kern References: <201212102309.qBAN9uCf033959@svn.freebsd.org> <20121210231448.GX3013@kib.kiev.ua> <50C67272.4080008@mu.org> <50C6756B.80607@mu.org> In-Reply-To: <50C6756B.80607@mu.org> 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, Alfred Perlstein , src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 11 Dec 2012 00:08:29 -0000 On 12/10/12 3:51 PM, Alfred Perlstein wrote: > On 12/10/12 3:38 PM, Alfred Perlstein wrote: >> On 12/10/12 3:14 PM, Konstantin Belousov wrote: >>> On Mon, Dec 10, 2012 at 11:09:56PM +0000, Alfred Perlstein wrote: >>>> Author: alfred >>>> Date: Mon Dec 10 23:09:55 2012 >>>> New Revision: 244098 >>>> URL: http://svnweb.freebsd.org/changeset/base/244098 >>>> >>>> Log: >>>> make sysctls kern.{bootfile,conftxt} read-only >>> You just break installkernel. >> My apologies, give me a few moments to double check this and I will >> back out. > > So first off "installkernel" was not broken, the error is ignored by > make, hence why I didn't see it. > > Second off, this is pretty broken, the first time you "installkernel" > it gets it right, the second time it just seems to set kern.bootfile > to /boot/kernel.old/kernel no even though that's not really the boot > kernel. > > I will back out the change, but this just seems off. > > If we are going to change kern.bootfile, then we ought to detect when > it's no longer valid at all and just zero it. or pretty much do > something else. > > -Alfred > and.. derp. Florian explained how this works, how it doesn't rename kern.bootfile after the first rename of the kernel. I'll be backing out the change now and adding some comments to the code shortly. From owner-svn-src-head@FreeBSD.ORG Tue Dec 11 00:10:20 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D4C6EF85; Tue, 11 Dec 2012 00:10:20 +0000 (UTC) (envelope-from alfred@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B92048FC08; Tue, 11 Dec 2012 00:10:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBB0AKK1046469; Tue, 11 Dec 2012 00:10:20 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBB0AKGN046468; Tue, 11 Dec 2012 00:10:20 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <201212110010.qBB0AKGN046468@svn.freebsd.org> From: Alfred Perlstein Date: Tue, 11 Dec 2012 00:10:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244103 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 11 Dec 2012 00:10:20 -0000 Author: alfred Date: Tue Dec 11 00:10:20 2012 New Revision: 244103 URL: http://svnweb.freebsd.org/changeset/base/244103 Log: back out half of 244098. kern.bootfile needs to be rw for installkernel. Pointed out by: kib, flo Modified: head/sys/kern/kern_mib.c Modified: head/sys/kern/kern_mib.c ============================================================================== --- head/sys/kern/kern_mib.c Tue Dec 11 00:07:19 2012 (r244102) +++ head/sys/kern/kern_mib.c Tue Dec 11 00:10:20 2012 (r244103) @@ -141,7 +141,7 @@ SYSCTL_INT(_kern, KERN_SAVED_IDS, saved_ char kernelname[MAXPATHLEN] = "/kernel"; /* XXX bloat */ -SYSCTL_STRING(_kern, KERN_BOOTFILE, bootfile, CTLFLAG_RD, +SYSCTL_STRING(_kern, KERN_BOOTFILE, bootfile, CTLFLAG_RW, kernelname, sizeof kernelname, "Name of kernel file booted"); SYSCTL_INT(_hw, HW_NCPU, ncpu, CTLFLAG_RD|CTLFLAG_CAPRD, From owner-svn-src-head@FreeBSD.ORG Tue Dec 11 00:19:59 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4C6047BA; Tue, 11 Dec 2012 00:19:59 +0000 (UTC) (envelope-from zeising@freebsd.org) Received: from mail.lysator.liu.se (mail.lysator.liu.se [IPv6:2001:6b0:17:f0a0::3]) by mx1.freebsd.org (Postfix) with ESMTP id 9D6938FC14; Tue, 11 Dec 2012 00:19:58 +0000 (UTC) Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id EBBB140003; Tue, 11 Dec 2012 01:19:57 +0100 (CET) Received: by mail.lysator.liu.se (Postfix, from userid 1004) id E06DC40005; Tue, 11 Dec 2012 01:19:57 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bernadotte.lysator.liu.se X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=AWL autolearn=disabled version=3.3.1 X-Spam-Score: 0.0 Received: from mx.daemonic.se (h-45-105.a163.priv.bahnhof.se [94.254.45.105]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.lysator.liu.se (Postfix) with ESMTPSA id 3444D40003; Tue, 11 Dec 2012 01:19:56 +0100 (CET) Received: from mailscanner.daemonic.se (mailscanner.daemonic.se [IPv6:2001:470:dca9:0:1::6]) by mx.daemonic.se (Postfix) with ESMTPS id 3YL1xm07LXz8hVt; Tue, 11 Dec 2012 01:19:56 +0100 (CET) X-Virus-Scanned: amavisd-new at daemonic.se Received: from mx.daemonic.se ([10.1.0.3]) (using TLS with cipher CAMELLIA256-SHA) by mailscanner.daemonic.se (mailscanner.daemonic.se [10.1.0.6]) (amavisd-new, port 10025) with ESMTPS id hMiSGTdE9ni2; Tue, 11 Dec 2012 01:19:53 +0100 (CET) Received: from mail.daemonic.se (mail.daemonic.se [10.1.0.4]) by mx.daemonic.se (Postfix) with ESMTPS id 3YL1xj45N8z8hVm; Tue, 11 Dec 2012 01:19:53 +0100 (CET) Received: from vivi.daemonic.se (vivi.daemonic.se [10.32.0.4]) by mail.daemonic.se (Postfix) with ESMTPSA id 3YL1xj3gjNz9CwY; Tue, 11 Dec 2012 01:19:53 +0100 (CET) Message-ID: <50C67C29.4070408@freebsd.org> Date: Tue, 11 Dec 2012 01:19:53 +0100 From: Niclas Zeising User-Agent: Mutt/1.5.21 MIME-Version: 1.0 To: Carl Delsey Subject: Re: svn commit: r243960 - in head/sys: amd64/include i386/include x86/include References: <201212062233.qB6MXWpP046167@svn.freebsd.org> <50C66E2E.5040302@freebsd.org> <50C67129.6090704@intel.com> <50C672D0.9090908@freebsd.org> <50C6764E.4040804@intel.com> In-Reply-To: <50C6764E.4040804@intel.com> X-Enigmail-Version: 1.4.6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP Cc: svn-src-head@freebsd.org, Jim Harris , svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 11 Dec 2012 00:19:59 -0000 On 12/11/12 00:54, Carl Delsey wrote: > On 12/10/12 16:40, Niclas Zeising wrote: >> On 12/11/12 00:32, Carl Delsey wrote: >>> On 12/10/12 16:20, Niclas Zeising wrote: >>>> On 12/06/12 23:33, Jim Harris wrote: >>>>> Author: jimharris >>>>> Date: Thu Dec 6 22:33:31 2012 >>>>> New Revision: 243960 >>>>> URL: http://svnweb.freebsd.org/changeset/base/243960 >>>>> >>>>> Log: >>>>> Add amd64 implementations for 8-byte bus_space routines. >>>>> +#include >>>>> #include >>>>> + >>>>> +#define KASSERT_BUS_SPACE_MEM_ONLY(tag) \ >>>>> + KASSERT((tag) == X86_BUS_SPACE_MEM, \ >>>>> + ("%s: can only handle mem space", __func__)) >>>>> + >>>>> +static __inline uint64_t >>>>> +bus_space_read_8(bus_space_tag_t tag, bus_space_handle_t bsh, >>>>> + bus_size_t ofs) >>>>> +{ >>>>> + >>>>> + KASSERT_BUS_SPACE_MEM_ONLY(tag); >>>>> + >>>>> + return (*(volatile uint64_t *)(bsh + ofs)); >>>>> +} >>>> Hi! >>>> Can the include of and the added KASSERTs please be >>>> hidden >>>> under #ifdef _KERNEL or something similar? devel/libpciaccess from the >>>> experimental xorg-dev tree >>>> (http://trillian.chruetertee.ch/ports/browser/trunk/devel/libpciaccess) >>>> uses machine/bus.h on amd64 and i386 to be able to read/write to the >>>> pci >>>> bus, and this change breaks the compile of devel/libpciaccess. >>>> It is probably so that libpciaccess is wrong in using >>>> but I have no idea how to fix it. If you have a better suggestion on >>>> how to fix libpciaccess I am all ears. >>>> Regards! >>> Does libpciaccess make use of the bus_space_read/write_* routines in >>> these files, or does it just use some constants and types from them? >>> >> libpciaccess uses bus_space_[read,write]_[1,2,4], which are defined in >> x86/bus.h. It does not use the quad functions. >> Regards! > Ok. In that case I won't ifdef out the functions themselves, just the > KASSERT in case libpciaccess expands in the future to 8 byte accesses > :-) I had another related change in the works. I'll add this change in. Sounds good to me, thank you very much! Don't forget to ifdef the include o as well as the KASSERTs. Regards! -- Niclas Zeising From owner-svn-src-head@FreeBSD.ORG Tue Dec 11 01:12:29 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B7B3E1BC; Tue, 11 Dec 2012 01:12:29 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9BB7C8FC17; Tue, 11 Dec 2012 01:12:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBB1CTvU058444; Tue, 11 Dec 2012 01:12:29 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBB1CTDj058443; Tue, 11 Dec 2012 01:12:29 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201212110112.qBB1CTDj058443@svn.freebsd.org> From: Xin LI Date: Tue, 11 Dec 2012 01:12:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244104 - head/sbin/sysctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 11 Dec 2012 01:12:29 -0000 Author: delphij Date: Tue Dec 11 01:12:29 2012 New Revision: 244104 URL: http://svnweb.freebsd.org/changeset/base/244104 Log: In parse(): - Only operate on copy, don't operate on source. - Eliminate home-rolled strsep(). - Constify the parameter. MFC after: 2 weeks Modified: head/sbin/sysctl/sysctl.c Modified: head/sbin/sysctl/sysctl.c ============================================================================== --- head/sbin/sysctl/sysctl.c Tue Dec 11 00:10:20 2012 (r244103) +++ head/sbin/sysctl/sysctl.c Tue Dec 11 01:12:29 2012 (r244104) @@ -62,7 +62,7 @@ static int aflag, bflag, dflag, eflag, h static int Nflag, nflag, oflag, qflag, xflag, warncount; static int oidfmt(int *, int, char *, u_int *); -static void parse(char *); +static void parse(const char *); static int show_var(int *, int); static int sysctl_all(int *oid, int len); static int name2oid(char *, int *); @@ -161,7 +161,7 @@ main(int argc, char **argv) * Set a new value if requested. */ static void -parse(char *string) +parse(const char *string) { int len, i, j; void *newval = 0; @@ -176,12 +176,11 @@ parse(char *string) char *cp, *bufp, buf[BUFSIZ], *endptr, fmt[BUFSIZ]; u_int kind; - bufp = buf; + cp = buf; if (snprintf(buf, BUFSIZ, "%s", string) >= BUFSIZ) errx(1, "oid too long: '%s'", string); - if ((cp = strchr(string, '=')) != NULL) { - *strchr(buf, '=') = '\0'; - *cp++ = '\0'; + bufp = strsep(&cp, "="); + if (cp != NULL) { while (isspace(*cp)) cp++; newval = cp; From owner-svn-src-head@FreeBSD.ORG Tue Dec 11 01:23:52 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EF8BD4E3; Tue, 11 Dec 2012 01:23:51 +0000 (UTC) (envelope-from alfred@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D27F78FC12; Tue, 11 Dec 2012 01:23:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBB1Np5p060504; Tue, 11 Dec 2012 01:23:51 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBB1NpOV060501; Tue, 11 Dec 2012 01:23:51 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <201212110123.qBB1NpOV060501@svn.freebsd.org> From: Alfred Perlstein Date: Tue, 11 Dec 2012 01:23:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244105 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 11 Dec 2012 01:23:52 -0000 Author: alfred Date: Tue Dec 11 01:23:50 2012 New Revision: 244105 URL: http://svnweb.freebsd.org/changeset/base/244105 Log: Switch the hardwired WITNESS panics to kassert_panic. This is an ongoing effort to provide runtime debug information useful in the field that does not panic existing installations. This gives us the flexibility needed when shipping images to a potentially large audience with WITNESS enabled without worrying about formerly non-fatal LORs hurting a release. Sponsored by: iXsystems Modified: head/sys/kern/kern_shutdown.c head/sys/kern/subr_witness.c head/sys/sys/systm.h Modified: head/sys/kern/kern_shutdown.c ============================================================================== --- head/sys/kern/kern_shutdown.c Tue Dec 11 01:12:29 2012 (r244104) +++ head/sys/kern/kern_shutdown.c Tue Dec 11 01:23:50 2012 (r244105) @@ -540,7 +540,7 @@ shutdown_reset(void *junk, int howto) /* NOTREACHED */ /* assuming reset worked */ } -#ifdef INVARIANTS +#if defined(WITNESS) || defined(INVARIANTS) static int kassert_warn_only = 0; #ifdef KDB static int kassert_do_kdb = 0; Modified: head/sys/kern/subr_witness.c ============================================================================== --- head/sys/kern/subr_witness.c Tue Dec 11 01:12:29 2012 (r244104) +++ head/sys/kern/subr_witness.c Tue Dec 11 01:23:50 2012 (r244105) @@ -822,16 +822,16 @@ witness_init(struct lock_object *lock, c class = LOCK_CLASS(lock); if ((lock->lo_flags & LO_RECURSABLE) != 0 && (class->lc_flags & LC_RECURSABLE) == 0) - panic("%s: lock (%s) %s can not be recursable", __func__, - class->lc_name, lock->lo_name); + kassert_panic("%s: lock (%s) %s can not be recursable", + __func__, class->lc_name, lock->lo_name); if ((lock->lo_flags & LO_SLEEPABLE) != 0 && (class->lc_flags & LC_SLEEPABLE) == 0) - panic("%s: lock (%s) %s can not be sleepable", __func__, - class->lc_name, lock->lo_name); + kassert_panic("%s: lock (%s) %s can not be sleepable", + __func__, class->lc_name, lock->lo_name); if ((lock->lo_flags & LO_UPGRADABLE) != 0 && (class->lc_flags & LC_UPGRADABLE) == 0) - panic("%s: lock (%s) %s can not be upgradable", __func__, - class->lc_name, lock->lo_name); + kassert_panic("%s: lock (%s) %s can not be upgradable", + __func__, class->lc_name, lock->lo_name); /* * If we shouldn't watch this lock, then just clear lo_witness. @@ -847,7 +847,8 @@ witness_init(struct lock_object *lock, c pending_locks[pending_cnt].wh_lock = lock; pending_locks[pending_cnt++].wh_type = type; if (pending_cnt > WITNESS_PENDLIST) - panic("%s: pending locks list is too small, bump it\n", + panic("%s: pending locks list is too small, " + "increase WITNESS_PENDLIST\n", __func__); } else lock->lo_witness = enroll(type, class); @@ -1073,7 +1074,8 @@ witness_checkorder(struct lock_object *l * all spin locks. */ if (td->td_critnest != 0 && !kdb_active) - panic("blockable sleep lock (%s) %s @ %s:%d", + kassert_panic("acquiring blockable sleep lock with " + "spinlock or critical section held (%s) %s @ %s:%d", class->lc_name, lock->lo_name, fixup_filename(file), line); @@ -1117,7 +1119,7 @@ witness_checkorder(struct lock_object *l fixup_filename(file), line); printf("while exclusively locked from %s:%d\n", fixup_filename(lock1->li_file), lock1->li_line); - panic("share->excl"); + kassert_panic("share->excl"); } if ((lock1->li_flags & LI_EXCLUSIVE) == 0 && (flags & LOP_EXCLUSIVE) != 0) { @@ -1126,7 +1128,7 @@ witness_checkorder(struct lock_object *l fixup_filename(file), line); printf("while share locked from %s:%d\n", fixup_filename(lock1->li_file), lock1->li_line); - panic("excl->share"); + kassert_panic("excl->share"); } return; } @@ -1433,26 +1435,30 @@ witness_upgrade(struct lock_object *lock class = LOCK_CLASS(lock); if (witness_watch) { if ((lock->lo_flags & LO_UPGRADABLE) == 0) - panic("upgrade of non-upgradable lock (%s) %s @ %s:%d", + kassert_panic( + "upgrade of non-upgradable lock (%s) %s @ %s:%d", class->lc_name, lock->lo_name, fixup_filename(file), line); if ((class->lc_flags & LC_SLEEPLOCK) == 0) - panic("upgrade of non-sleep lock (%s) %s @ %s:%d", + kassert_panic( + "upgrade of non-sleep lock (%s) %s @ %s:%d", class->lc_name, lock->lo_name, fixup_filename(file), line); } instance = find_instance(curthread->td_sleeplocks, lock); if (instance == NULL) - panic("upgrade of unlocked lock (%s) %s @ %s:%d", + kassert_panic("upgrade of unlocked lock (%s) %s @ %s:%d", class->lc_name, lock->lo_name, fixup_filename(file), line); if (witness_watch) { if ((instance->li_flags & LI_EXCLUSIVE) != 0) - panic("upgrade of exclusive lock (%s) %s @ %s:%d", + kassert_panic( + "upgrade of exclusive lock (%s) %s @ %s:%d", class->lc_name, lock->lo_name, fixup_filename(file), line); if ((instance->li_flags & LI_RECURSEMASK) != 0) - panic("upgrade of recursed lock (%s) %s r=%d @ %s:%d", + kassert_panic( + "upgrade of recursed lock (%s) %s r=%d @ %s:%d", class->lc_name, lock->lo_name, instance->li_flags & LI_RECURSEMASK, fixup_filename(file), line); @@ -1473,26 +1479,30 @@ witness_downgrade(struct lock_object *lo class = LOCK_CLASS(lock); if (witness_watch) { if ((lock->lo_flags & LO_UPGRADABLE) == 0) - panic("downgrade of non-upgradable lock (%s) %s @ %s:%d", + kassert_panic( + "downgrade of non-upgradable lock (%s) %s @ %s:%d", class->lc_name, lock->lo_name, fixup_filename(file), line); if ((class->lc_flags & LC_SLEEPLOCK) == 0) - panic("downgrade of non-sleep lock (%s) %s @ %s:%d", + kassert_panic( + "downgrade of non-sleep lock (%s) %s @ %s:%d", class->lc_name, lock->lo_name, fixup_filename(file), line); } instance = find_instance(curthread->td_sleeplocks, lock); if (instance == NULL) - panic("downgrade of unlocked lock (%s) %s @ %s:%d", + kassert_panic("downgrade of unlocked lock (%s) %s @ %s:%d", class->lc_name, lock->lo_name, fixup_filename(file), line); if (witness_watch) { if ((instance->li_flags & LI_EXCLUSIVE) == 0) - panic("downgrade of shared lock (%s) %s @ %s:%d", + kassert_panic( + "downgrade of shared lock (%s) %s @ %s:%d", class->lc_name, lock->lo_name, fixup_filename(file), line); if ((instance->li_flags & LI_RECURSEMASK) != 0) - panic("downgrade of recursed lock (%s) %s r=%d @ %s:%d", + kassert_panic( + "downgrade of recursed lock (%s) %s r=%d @ %s:%d", class->lc_name, lock->lo_name, instance->li_flags & LI_RECURSEMASK, fixup_filename(file), line); @@ -1535,7 +1545,7 @@ witness_unlock(struct lock_object *lock, * eventual register locks and remove them. */ if (witness_watch > 0) - panic("lock (%s) %s not locked @ %s:%d", class->lc_name, + kassert_panic("lock (%s) %s not locked @ %s:%d", class->lc_name, lock->lo_name, fixup_filename(file), line); else return; @@ -1548,7 +1558,7 @@ found: lock->lo_name, fixup_filename(file), line); printf("while exclusively locked from %s:%d\n", fixup_filename(instance->li_file), instance->li_line); - panic("excl->ushare"); + kassert_panic("excl->ushare"); } if ((instance->li_flags & LI_EXCLUSIVE) == 0 && witness_watch > 0 && (flags & LOP_EXCLUSIVE) != 0) { @@ -1557,7 +1567,7 @@ found: printf("while share locked from %s:%d\n", fixup_filename(instance->li_file), instance->li_line); - panic("share->uexcl"); + kassert_panic("share->uexcl"); } /* If we are recursed, unrecurse. */ if ((instance->li_flags & LI_RECURSEMASK) > 0) { @@ -1571,7 +1581,7 @@ found: if ((instance->li_flags & LI_NORELEASE) != 0 && witness_watch > 0) { printf("forbidden unlock of (%s) %s @ %s:%d\n", class->lc_name, lock->lo_name, fixup_filename(file), line); - panic("lock marked norelease"); + kassert_panic("lock marked norelease"); } /* Otherwise, remove this item from the list. */ @@ -1626,7 +1636,8 @@ witness_thread_exit(struct thread *td) witness_list_lock(&lle->ll_children[i], printf); } - panic("Thread %p cannot exit while holding sleeplocks\n", td); + kassert_panic( + "Thread %p cannot exit while holding sleeplocks\n", td); } witness_lock_list_free(lle); } @@ -1707,7 +1718,7 @@ witness_warn(int flags, struct lock_obje } else sched_unpin(); if (flags & WARN_PANIC && n) - panic("%s", __func__); + kassert_panic("%s", __func__); else witness_debugger(n); return (n); @@ -1753,7 +1764,7 @@ enroll(const char *description, struct l } else if ((lock_class->lc_flags & LC_SLEEPLOCK)) typelist = &w_sleep; else - panic("lock class %s is not sleep or spin", + kassert_panic("lock class %s is not sleep or spin", lock_class->lc_name); mtx_lock_spin(&w_mtx); @@ -1784,7 +1795,7 @@ found: w->w_refcount++; mtx_unlock_spin(&w_mtx); if (lock_class != w->w_class) - panic( + kassert_panic( "lock (%s) %s does not match earlier (%s) lock", description, lock_class->lc_name, w->w_class->lc_name); @@ -1918,7 +1929,8 @@ itismychild(struct witness *parent, stru if (!witness_lock_type_equal(parent, child)) { if (witness_cold == 0) mtx_unlock_spin(&w_mtx); - panic("%s: parent \"%s\" (%s) and child \"%s\" (%s) are not " + kassert_panic( + "%s: parent \"%s\" (%s) and child \"%s\" (%s) are not " "the same lock type", __func__, parent->w_name, parent->w_class->lc_name, child->w_name, child->w_class->lc_name); @@ -2192,7 +2204,7 @@ witness_save(struct lock_object *lock, c } instance = find_instance(lock_list, lock); if (instance == NULL) - panic("%s: lock (%s) %s not locked", __func__, + kassert_panic("%s: lock (%s) %s not locked", __func__, class->lc_name, lock->lo_name); *filep = instance->li_file; *linep = instance->li_line; @@ -2225,7 +2237,7 @@ witness_restore(struct lock_object *lock } instance = find_instance(lock_list, lock); if (instance == NULL) - panic("%s: lock (%s) %s not locked", __func__, + kassert_panic("%s: lock (%s) %s not locked", __func__, class->lc_name, lock->lo_name); lock->lo_witness->w_file = file; lock->lo_witness->w_line = line; @@ -2249,13 +2261,13 @@ witness_assert(const struct lock_object else if ((class->lc_flags & LC_SPINLOCK) != 0) instance = find_instance(PCPU_GET(spinlocks), lock); else { - panic("Lock (%s) %s is not sleep or spin!", + kassert_panic("Lock (%s) %s is not sleep or spin!", class->lc_name, lock->lo_name); } switch (flags) { case LA_UNLOCKED: if (instance != NULL) - panic("Lock (%s) %s locked @ %s:%d.", + kassert_panic("Lock (%s) %s locked @ %s:%d.", class->lc_name, lock->lo_name, fixup_filename(file), line); break; @@ -2269,34 +2281,36 @@ witness_assert(const struct lock_object case LA_XLOCKED | LA_RECURSED: case LA_XLOCKED | LA_NOTRECURSED: if (instance == NULL) { - panic("Lock (%s) %s not locked @ %s:%d.", + kassert_panic("Lock (%s) %s not locked @ %s:%d.", class->lc_name, lock->lo_name, fixup_filename(file), line); break; } if ((flags & LA_XLOCKED) != 0 && (instance->li_flags & LI_EXCLUSIVE) == 0) - panic("Lock (%s) %s not exclusively locked @ %s:%d.", + kassert_panic( + "Lock (%s) %s not exclusively locked @ %s:%d.", class->lc_name, lock->lo_name, fixup_filename(file), line); if ((flags & LA_SLOCKED) != 0 && (instance->li_flags & LI_EXCLUSIVE) != 0) - panic("Lock (%s) %s exclusively locked @ %s:%d.", + kassert_panic( + "Lock (%s) %s exclusively locked @ %s:%d.", class->lc_name, lock->lo_name, fixup_filename(file), line); if ((flags & LA_RECURSED) != 0 && (instance->li_flags & LI_RECURSEMASK) == 0) - panic("Lock (%s) %s not recursed @ %s:%d.", + kassert_panic("Lock (%s) %s not recursed @ %s:%d.", class->lc_name, lock->lo_name, fixup_filename(file), line); if ((flags & LA_NOTRECURSED) != 0 && (instance->li_flags & LI_RECURSEMASK) != 0) - panic("Lock (%s) %s recursed @ %s:%d.", + kassert_panic("Lock (%s) %s recursed @ %s:%d.", class->lc_name, lock->lo_name, fixup_filename(file), line); break; default: - panic("Invalid lock assertion at %s:%d.", + kassert_panic("Invalid lock assertion at %s:%d.", fixup_filename(file), line); } @@ -2322,7 +2336,7 @@ witness_setflag(struct lock_object *lock } instance = find_instance(lock_list, lock); if (instance == NULL) - panic("%s: lock (%s) %s not locked", __func__, + kassert_panic("%s: lock (%s) %s not locked", __func__, class->lc_name, lock->lo_name); if (set) Modified: head/sys/sys/systm.h ============================================================================== --- head/sys/sys/systm.h Tue Dec 11 01:12:29 2012 (r244104) +++ head/sys/sys/systm.h Tue Dec 11 01:23:50 2012 (r244105) @@ -72,9 +72,11 @@ extern int vm_guest; /* Running as virt */ enum VM_GUEST { VM_GUEST_NO = 0, VM_GUEST_VM, VM_GUEST_XEN }; -#ifdef INVARIANTS /* The option is always available */ +#if defined(WITNESS) || defined(INVARIANTS) void kassert_panic(const char *fmt, ...); +#endif +#ifdef INVARIANTS /* The option is always available */ #define KASSERT(exp,msg) do { \ if (__predict_false(!(exp))) \ kassert_panic msg; \ From owner-svn-src-head@FreeBSD.ORG Tue Dec 11 01:28:07 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 81E81695; Tue, 11 Dec 2012 01:28:07 +0000 (UTC) (envelope-from alfred@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 674768FC08; Tue, 11 Dec 2012 01:28:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBB1S7fo061275; Tue, 11 Dec 2012 01:28:07 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBB1S7rh061270; Tue, 11 Dec 2012 01:28:07 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <201212110128.qBB1S7rh061270@svn.freebsd.org> From: Alfred Perlstein Date: Tue, 11 Dec 2012 01:28:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244106 - head/sbin/sysctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 11 Dec 2012 01:28:07 -0000 Author: alfred Date: Tue Dec 11 01:28:06 2012 New Revision: 244106 URL: http://svnweb.freebsd.org/changeset/base/244106 Log: Allow sysctl to filter boot and runtime tunables. Add the following flags to sysctl: -W - show only writable sysctls -T - show only tuneable sysctls This can be used to create a /var/run/sysctl.boot to compare set tunables versus booted tunables. Sponsored by: iXsystems Modified: head/sbin/sysctl/sysctl.8 head/sbin/sysctl/sysctl.c Modified: head/sbin/sysctl/sysctl.8 ============================================================================== --- head/sbin/sysctl/sysctl.8 Tue Dec 11 01:23:50 2012 (r244105) +++ head/sbin/sysctl/sysctl.8 Tue Dec 11 01:28:06 2012 (r244106) @@ -36,11 +36,11 @@ .Nd get or set kernel state .Sh SYNOPSIS .Nm -.Op Fl bdehiNnoqx +.Op Fl bdehiNnoRTqx .Ar name Ns Op = Ns Ar value .Ar ... .Nm -.Op Fl bdehNnoqx +.Op Fl bdehNnoRTqx .Fl a .Sh DESCRIPTION The @@ -121,6 +121,11 @@ sixteen bytes of the value. Suppress some warnings generated by .Nm to standard error. +.It Fl T +Display only variables that are setable via loader (CTLFLAG_TUN). +.It Fl W +Display only wriable variables that are not statistical. +Useful for determining the set of runtime tunable sysctls. .It Fl X Equivalent to .Fl x a Modified: head/sbin/sysctl/sysctl.c ============================================================================== --- head/sbin/sysctl/sysctl.c Tue Dec 11 01:23:50 2012 (r244105) +++ head/sbin/sysctl/sysctl.c Tue Dec 11 01:28:06 2012 (r244106) @@ -59,7 +59,7 @@ static const char rcsid[] = #include static int aflag, bflag, dflag, eflag, hflag, iflag; -static int Nflag, nflag, oflag, qflag, xflag, warncount; +static int Nflag, nflag, oflag, qflag, Tflag, Wflag, xflag, warncount; static int oidfmt(int *, int, char *, u_int *); static void parse(const char *); @@ -74,8 +74,8 @@ usage(void) { (void)fprintf(stderr, "%s\n%s\n", - "usage: sysctl [-bdehiNnoqx] name[=value] ...", - " sysctl [-bdehNnoqx] -a"); + "usage: sysctl [-bdehiNnoqTWx] name[=value] ...", + " sysctl [-bdehNnoqTWx] -a"); exit(1); } @@ -88,7 +88,7 @@ main(int argc, char **argv) setbuf(stdout,0); setbuf(stderr,0); - while ((ch = getopt(argc, argv, "AabdehiNnoqwxX")) != -1) { + while ((ch = getopt(argc, argv, "AabdehiNnoqTwWxX")) != -1) { switch (ch) { case 'A': /* compatibility */ @@ -124,10 +124,16 @@ main(int argc, char **argv) case 'q': qflag = 1; break; + case 'T': + Tflag = 1; + break; case 'w': /* compatibility */ /* ignored */ break; + case 'W': + Wflag = 1; + break; case 'X': /* compatibility */ aflag = xflag = 1; @@ -181,6 +187,11 @@ parse(const char *string) errx(1, "oid too long: '%s'", string); bufp = strsep(&cp, "="); if (cp != NULL) { + /* Tflag just lists tunables, do not allow assignment */ + if (Tflag || Wflag) { + warnx("Can't set variables when using -T or -W"); + usage(); + } while (isspace(*cp)) cp++; newval = cp; @@ -602,6 +613,14 @@ show_var(int *oid, int nlen) sign = ctl_sign[ctltype]; intlen = ctl_size[ctltype]; + /* if Wflag then only list sysctls that are writeable and not stats. */ + if (Wflag && ((kind & CTLFLAG_WR) == 0 || (kind & CTLFLAG_STATS) != 0)) + return 1; + + /* if Tflag then only list sysctls that are tuneables. */ + if (Tflag && (kind & CTLFLAG_TUN) == 0) + return 1; + switch (ctltype) { case CTLTYPE_STRING: if (!nflag) From owner-svn-src-head@FreeBSD.ORG Tue Dec 11 04:12:15 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5ADCCD70; Tue, 11 Dec 2012 04:12:15 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from fallbackmx08.syd.optusnet.com.au (fallbackmx08.syd.optusnet.com.au [211.29.132.10]) by mx1.freebsd.org (Postfix) with ESMTP id D6B1E8FC13; Tue, 11 Dec 2012 04:12:14 +0000 (UTC) Received: from mail36.syd.optusnet.com.au (mail36.syd.optusnet.com.au [211.29.133.76]) by fallbackmx08.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id qBB46jDC007867; Tue, 11 Dec 2012 15:06:45 +1100 Received: from c122-106-175-26.carlnfd1.nsw.optusnet.com.au (c122-106-175-26.carlnfd1.nsw.optusnet.com.au [122.106.175.26]) by mail36.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id qBB46XOC013141 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 11 Dec 2012 15:06:35 +1100 Date: Tue, 11 Dec 2012 15:06:33 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Niclas Zeising Subject: Re: svn commit: r243960 - in head/sys: amd64/include i386/include x86/include In-Reply-To: <50C67C29.4070408@freebsd.org> Message-ID: <20121211144118.L959@besplex.bde.org> References: <201212062233.qB6MXWpP046167@svn.freebsd.org> <50C66E2E.5040302@freebsd.org> <50C67129.6090704@intel.com> <50C672D0.9090908@freebsd.org> <50C6764E.4040804@intel.com> <50C67C29.4070408@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.0 cv=fev1UDsF c=1 sm=1 a=5qa8e7V8SQ0A:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=2DPJxBlv9iIA:10 a=FPw1pQDZFgkkUDttQVMA:9 a=CjuIK1q_8ugA:10 a=bxQHXO5Py4tHmhUgaywp5w==:117 Cc: svn-src-head@FreeBSD.org, Jim Harris , Carl Delsey , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 11 Dec 2012 04:12:15 -0000 On Tue, 11 Dec 2012, Niclas Zeising wrote: > On 12/11/12 00:54, Carl Delsey wrote: >> On 12/10/12 16:40, Niclas Zeising wrote: >>> ... >>> libpciaccess uses bus_space_[read,write]_[1,2,4], which are defined in >>> x86/bus.h. It does not use the quad functions. >>> Regards! >> Ok. In that case I won't ifdef out the functions themselves, just the >> KASSERT in case libpciaccess expands in the future to 8 byte accesses >> :-) I had another related change in the works. I'll add this change in. > > Sounds good to me, thank you very much! > Don't forget to ifdef the include o as well as the KASSERTs. Including it at all is namespace pollution. It is a bug for any kernel .c file to not include always and early in its includes, because other includes may have KASSERT()s in them. Not all includes that uses KASSERT() have the namespace pollution, so adding it to some just breaks detection of the bug in some cases. The folowing headers in have the pollution: libkern.h, mbuf.h, pmckern.h, refcount.h. refcount.h only has the pollution if _KERNEL is defined. It handles the problem of polluting userland (though I think userland should be rewarded by syntax errors if it uses refcount.h or machine/bus.h) by supplying a dummy KASSERT() for the !_KERNEL case. The following headers in use KASSERT(): buf.h, eventhandler.h, lock.h, mbuf.h, mount.h, mutex.h, osd.h, proc.h, random.h, refcount.h. Most of them are missing the pollution. The pollution in libkern.h is circular: libkern.h includes systm.h, and systm.h includes libkern.h. systm.h's include of libkern.h and of many other headers like machine/atomic.h and machine/cpufunc.h is standard pollution -- direct includes of these are style bugs, and not including systm.h always and early is a bug because it may break more than KASSERT() (other headers may also use inlines in libkern.h etc.). The circular pollution in libkern.h is used because most files in libkern don't include systm.h directly; they mostly only include libkern.h directly. This and other pollution in mbuf.h is especially disgusting since mbuf.h is one of few headers that I managed to finish the #include de-pollution of in FreeBSD-3 or 2. Bruce From owner-svn-src-head@FreeBSD.ORG Tue Dec 11 04:19:52 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 35460E0; Tue, 11 Dec 2012 04:19:52 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1AD768FC13; Tue, 11 Dec 2012 04:19:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBB4JpwK094173; Tue, 11 Dec 2012 04:19:51 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBB4JpfZ094171; Tue, 11 Dec 2012 04:19:51 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201212110419.qBB4JpfZ094171@svn.freebsd.org> From: Adrian Chadd Date: Tue, 11 Dec 2012 04:19:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244109 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 11 Dec 2012 04:19:52 -0000 Author: adrian Date: Tue Dec 11 04:19:51 2012 New Revision: 244109 URL: http://svnweb.freebsd.org/changeset/base/244109 Log: There's no need to use a TXQ pointer here; we specifically need the hardware queue ID when queuing to EDMA descriptors. This is a small part of trying to reduce the size of ath_buf entries. Modified: head/sys/dev/ath/if_ath_tx.c head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Tue Dec 11 02:40:01 2012 (r244108) +++ head/sys/dev/ath/if_ath_tx.c Tue Dec 11 04:19:51 2012 (r244109) @@ -372,7 +372,6 @@ ath_tx_chaindesclist(struct ath_softc *s uint32_t segLenList[4]; int numTxMaps = 1; int isFirstDesc = 1; - int qnum; /* * XXX There's txdma and txdma_mgmt; the descriptor @@ -426,18 +425,16 @@ ath_tx_chaindesclist(struct ath_softc *s bf->bf_daddr + dd->dd_descsize * (dsp + 1)); /* - * XXX this assumes that bfs_txq is the actual destination - * hardware queue at this point. It may not have been assigned, - * it may actually be pointing to the multicast software - * TXQ id. These must be fixed! + * XXX This assumes that bfs_txq is the actual destination + * hardware queue at this point. It may not have been + * assigned, it may actually be pointing to the multicast + * software TXQ id. These must be fixed! */ - qnum = bf->bf_state.bfs_txq->axq_qnum; - ath_hal_filltxdesc(ah, (struct ath_desc *) ds , bufAddrList , segLenList , bf->bf_descid /* XXX desc id */ - , qnum + , bf->bf_state.bfs_tx_queue , isFirstDesc /* first segment */ , i == bf->bf_nseg - 1 /* last segment */ , (struct ath_desc *) ds0 /* first descriptor */ @@ -478,7 +475,8 @@ ath_tx_chaindesclist(struct ath_softc *s isFirstDesc = 0; #ifdef ATH_DEBUG if (sc->sc_debug & ATH_DEBUG_XMIT) - ath_printtxbuf(sc, bf, qnum, 0, 0); + ath_printtxbuf(sc, bf, bf->bf_state.bfs_tx_queue, + 0, 0); #endif bf->bf_lastds = (struct ath_desc *) ds; @@ -697,11 +695,11 @@ ath_tx_setds_11n(struct ath_softc *sc, s * during the beacon setup code. * * XXX TODO: since the AR9300 EDMA TX queue support wants the QCU ID - * as part of the TX descriptor, bf_state.bfs_txq must be updated + * as part of the TX descriptor, bf_state.bfs_tx_queue must be updated * with the actual hardware txq, or all of this will fall apart. * * XXX It may not be a bad idea to just stuff the QCU ID into bf_state - * and retire bfs_txq; then make sure the CABQ QCU ID is populated + * and retire bfs_tx_queue; then make sure the CABQ QCU ID is populated * correctly. */ static void @@ -1840,7 +1838,7 @@ ath_tx_start(struct ath_softc *sc, struc /* Set local packet state, used to queue packets to hardware */ bf->bf_state.bfs_tid = tid; - bf->bf_state.bfs_txq = txq; + bf->bf_state.bfs_tx_queue = txq->axq_qnum; bf->bf_state.bfs_pri = pri; /* @@ -1858,7 +1856,7 @@ ath_tx_start(struct ath_softc *sc, struc * queue, so the descriptor setup functions will * correctly initialise the descriptor 'qcuId' field. */ - bf->bf_state.bfs_txq = sc->sc_cabq; + bf->bf_state.bfs_tx_queue = sc->sc_cabq->axq_qnum; } /* Do the generic frame setup */ @@ -2114,7 +2112,7 @@ ath_tx_raw_start(struct ath_softc *sc, s /* Set local packet state, used to queue packets to hardware */ bf->bf_state.bfs_tid = WME_AC_TO_TID(pri); - bf->bf_state.bfs_txq = sc->sc_ac2q[pri]; + bf->bf_state.bfs_tx_queue = sc->sc_ac2q[pri]->axq_qnum; bf->bf_state.bfs_pri = pri; /* XXX this should be done in ath_tx_setrate() */ @@ -2713,16 +2711,8 @@ ath_tx_xmit_aggr(struct ath_softc *sc, s struct ath_txq *txq, struct ath_buf *bf) { struct ath_tid *tid = &an->an_tid[bf->bf_state.bfs_tid]; -// struct ath_txq *txq = bf->bf_state.bfs_txq; struct ieee80211_tx_ampdu *tap; - if (txq != bf->bf_state.bfs_txq) { - device_printf(sc->sc_dev, "%s: txq %d != bfs_txq %d!\n", - __func__, - txq->axq_qnum, - bf->bf_state.bfs_txq->axq_qnum); - } - ATH_TX_LOCK_ASSERT(sc); tap = ath_tx_get_tx_tid(an, tid->tid); @@ -2821,9 +2811,8 @@ ath_tx_swq(struct ath_softc *sc, struct /* Set local packet state, used to queue packets to hardware */ /* XXX potentially duplicate info, re-check */ - /* XXX remember, txq must be the hardware queue, not the av_mcastq */ bf->bf_state.bfs_tid = tid; - bf->bf_state.bfs_txq = txq; + bf->bf_state.bfs_tx_queue = txq->axq_qnum; bf->bf_state.bfs_pri = pri; /* @@ -4869,8 +4858,6 @@ ath_tx_tid_hw_queue_aggr(struct ath_soft } queuepkt: - //txq = bf->bf_state.bfs_txq; - /* Set completion handler, multi-frame aggregate or not */ bf->bf_comp = ath_tx_aggr_comp; @@ -4936,8 +4923,6 @@ ath_tx_tid_hw_queue_norm(struct ath_soft ATH_TID_REMOVE(tid, bf, bf_list); - KASSERT(txq == bf->bf_state.bfs_txq, ("txqs not equal!\n")); - /* Sanity check! */ if (tid->tid != bf->bf_state.bfs_tid) { device_printf(sc->sc_dev, "%s: bfs_tid %d !=" Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Tue Dec 11 02:40:01 2012 (r244108) +++ head/sys/dev/ath/if_athvar.h Tue Dec 11 04:19:51 2012 (r244109) @@ -241,8 +241,7 @@ struct ath_buf { uint8_t bfs_tid; /* packet TID (or TID_MAX for no QoS) */ uint8_t bfs_nframes; /* number of frames in aggregate */ uint8_t bfs_pri; /* packet AC priority */ - - struct ath_txq *bfs_txq; /* eventual dest hardware TXQ */ + uint8_t bfs_tx_queue; /* destination hardware TX queue */ u_int32_t bfs_aggr:1, /* part of aggregate? */ bfs_aggrburst:1, /* part of aggregate burst? */ From owner-svn-src-head@FreeBSD.ORG Tue Dec 11 05:59:16 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C674191D; Tue, 11 Dec 2012 05:59:16 +0000 (UTC) (envelope-from alfred@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id ACAC28FC13; Tue, 11 Dec 2012 05:59:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBB5xGbN012409; Tue, 11 Dec 2012 05:59:16 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBB5xGAB012408; Tue, 11 Dec 2012 05:59:16 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <201212110559.qBB5xGAB012408@svn.freebsd.org> From: Alfred Perlstein Date: Tue, 11 Dec 2012 05:59:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244111 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 11 Dec 2012 05:59:16 -0000 Author: alfred Date: Tue Dec 11 05:59:16 2012 New Revision: 244111 URL: http://svnweb.freebsd.org/changeset/base/244111 Log: Fix WITNESS when INVARIANT_SUPPORT is defined. This fixes tinderbox breakage from r244105. Pointed out by: adrian Modified: head/sys/kern/subr_witness.c Modified: head/sys/kern/subr_witness.c ============================================================================== --- head/sys/kern/subr_witness.c Tue Dec 11 05:11:28 2012 (r244110) +++ head/sys/kern/subr_witness.c Tue Dec 11 05:59:16 2012 (r244111) @@ -2263,6 +2263,7 @@ witness_assert(const struct lock_object else { kassert_panic("Lock (%s) %s is not sleep or spin!", class->lc_name, lock->lo_name); + return; } switch (flags) { case LA_UNLOCKED: From owner-svn-src-head@FreeBSD.ORG Tue Dec 11 06:34:49 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 04B2854F; Tue, 11 Dec 2012 06:34:49 +0000 (UTC) (envelope-from carl.r.delsey@intel.com) Received: from mga14.intel.com (mga14.intel.com [143.182.124.37]) by mx1.freebsd.org (Postfix) with ESMTP id 9DD368FC14; Tue, 11 Dec 2012 06:34:48 +0000 (UTC) Received: from azsmga002.ch.intel.com ([10.2.17.35]) by azsmga102.ch.intel.com with ESMTP; 10 Dec 2012 22:34:47 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.84,256,1355126400"; d="scan'208";a="179264706" Received: from crdelsey-mobl2.amr.corp.intel.com (HELO [10.254.19.32]) ([10.254.19.32]) by AZSMGA002.ch.intel.com with ESMTP; 10 Dec 2012 22:34:34 -0800 Message-ID: <50C6D3FA.6050308@intel.com> Date: Mon, 10 Dec 2012 23:34:34 -0700 From: Carl Delsey User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Bruce Evans Subject: Re: svn commit: r243960 - in head/sys: amd64/include i386/include x86/include References: <201212062233.qB6MXWpP046167@svn.freebsd.org> <50C66E2E.5040302@freebsd.org> <50C67129.6090704@intel.com> <50C672D0.9090908@freebsd.org> <50C6764E.4040804@intel.com> <50C67C29.4070408@freebsd.org> <20121211144118.L959@besplex.bde.org> In-Reply-To: <20121211144118.L959@besplex.bde.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, Jim Harris , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Niclas Zeising X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 11 Dec 2012 06:34:49 -0000 On 12/10/2012 9:06 PM, Bruce Evans wrote: > On Tue, 11 Dec 2012, Niclas Zeising wrote: > >> On 12/11/12 00:54, Carl Delsey wrote: >>> On 12/10/12 16:40, Niclas Zeising wrote: >>>> ... >>>> libpciaccess uses bus_space_[read,write]_[1,2,4], which are defined in >>>> x86/bus.h. It does not use the quad functions. >>>> Regards! >>> Ok. In that case I won't ifdef out the functions themselves, just the >>> KASSERT in case libpciaccess expands in the future to 8 byte accesses >>> :-) I had another related change in the works. I'll add this change >>> in. >> >> Sounds good to me, thank you very much! >> Don't forget to ifdef the include o as well as the >> KASSERTs. > > Including it at all is namespace pollution. > > It is a bug for any kernel .c file to not include always > and early in its includes, because other includes may have KASSERT()s > in them. Not all includes that uses KASSERT() have the namespace > pollution, so adding it to some just breaks detection of the bug in > some cases. > > The folowing headers in have the pollution: libkern.h, mbuf.h, > pmckern.h, refcount.h. refcount.h only has the pollution if _KERNEL is > defined. It handles the problem of polluting userland (though I think > userland should be rewarded by syntax errors if it uses refcount.h or > machine/bus.h) by supplying a dummy KASSERT() for the !_KERNEL case. > > The following headers in use KASSERT(): buf.h, eventhandler.h, > lock.h, mbuf.h, mount.h, mutex.h, osd.h, proc.h, random.h, refcount.h. > Most of them are missing the pollution. > > The pollution in libkern.h is circular: libkern.h includes systm.h, and > systm.h includes libkern.h. systm.h's include of libkern.h and of many > other headers like machine/atomic.h and machine/cpufunc.h is standard > pollution -- direct includes of these are style bugs, and not including > systm.h always and early is a bug because it may break more than > KASSERT() > (other headers may also use inlines in libkern.h etc.). The circular > pollution in libkern.h is used because most files in libkern don't > include > systm.h directly; they mostly only include libkern.h directly. > > This and other pollution in mbuf.h is especially disgusting since > mbuf.h is one of few headers that I managed to finish the #include > de-pollution of in FreeBSD-3 or 2. > > Bruce Thanks Bruce. I'll fix that in my change. It will make the bus.h file a bit cleaner. This information should probably be in style(9). It talks a bit about how to include header files but it doesn't mention any of these details that I noticed. I'll take a stab at adding some of this info if I get a chance in the next few weeks. Carl From owner-svn-src-head@FreeBSD.ORG Tue Dec 11 07:08:14 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D516B2DD; Tue, 11 Dec 2012 07:08:14 +0000 (UTC) (envelope-from alfred@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B059B8FC15; Tue, 11 Dec 2012 07:08:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBB78Ekf025289; Tue, 11 Dec 2012 07:08:14 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBB78EWx025288; Tue, 11 Dec 2012 07:08:14 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <201212110708.qBB78EWx025288@svn.freebsd.org> From: Alfred Perlstein Date: Tue, 11 Dec 2012 07:08:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244112 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 11 Dec 2012 07:08:15 -0000 Author: alfred Date: Tue Dec 11 07:08:14 2012 New Revision: 244112 URL: http://svnweb.freebsd.org/changeset/base/244112 Log: Cleanup more of the kassert_panic. fix compile warnings on !amd64 and NULL derefs that would happen if kassert_panic() would return. Modified: head/sys/kern/subr_witness.c Modified: head/sys/kern/subr_witness.c ============================================================================== --- head/sys/kern/subr_witness.c Tue Dec 11 05:59:16 2012 (r244111) +++ head/sys/kern/subr_witness.c Tue Dec 11 07:08:14 2012 (r244112) @@ -1446,10 +1446,12 @@ witness_upgrade(struct lock_object *lock fixup_filename(file), line); } instance = find_instance(curthread->td_sleeplocks, lock); - if (instance == NULL) + if (instance == NULL) { kassert_panic("upgrade of unlocked lock (%s) %s @ %s:%d", class->lc_name, lock->lo_name, fixup_filename(file), line); + return; + } if (witness_watch) { if ((instance->li_flags & LI_EXCLUSIVE) != 0) kassert_panic( @@ -1490,10 +1492,12 @@ witness_downgrade(struct lock_object *lo fixup_filename(file), line); } instance = find_instance(curthread->td_sleeplocks, lock); - if (instance == NULL) + if (instance == NULL) { kassert_panic("downgrade of unlocked lock (%s) %s @ %s:%d", class->lc_name, lock->lo_name, fixup_filename(file), line); + return; + } if (witness_watch) { if ((instance->li_flags & LI_EXCLUSIVE) == 0) kassert_panic( @@ -1544,11 +1548,13 @@ witness_unlock(struct lock_object *lock, * We have to make sure we flush these queues, so just search for * eventual register locks and remove them. */ - if (witness_watch > 0) + if (witness_watch > 0) { kassert_panic("lock (%s) %s not locked @ %s:%d", class->lc_name, lock->lo_name, fixup_filename(file), line); - else return; + } else { + return; + } found: /* First, check for shared/exclusive mismatches. */ @@ -1761,11 +1767,13 @@ enroll(const char *description, struct l return (NULL); else typelist = &w_spin; - } else if ((lock_class->lc_flags & LC_SLEEPLOCK)) + } else if ((lock_class->lc_flags & LC_SLEEPLOCK)) { typelist = &w_sleep; - else + } else { kassert_panic("lock class %s is not sleep or spin", lock_class->lc_name); + return (NULL); + } mtx_lock_spin(&w_mtx); w = witness_hash_get(description); @@ -1921,19 +1929,26 @@ adopt(struct witness *parent, struct wit static void itismychild(struct witness *parent, struct witness *child) { + int unlocked; MPASS(child != NULL && parent != NULL); if (witness_cold == 0) mtx_assert(&w_mtx, MA_OWNED); if (!witness_lock_type_equal(parent, child)) { - if (witness_cold == 0) + if (witness_cold == 0) { + unlocked = 1; mtx_unlock_spin(&w_mtx); + } else { + unlocked = 0; + } kassert_panic( "%s: parent \"%s\" (%s) and child \"%s\" (%s) are not " "the same lock type", __func__, parent->w_name, parent->w_class->lc_name, child->w_name, child->w_class->lc_name); + if (unlocked) + mtx_lock_spin(&w_mtx); } adopt(parent, child); } @@ -2203,9 +2218,11 @@ witness_save(struct lock_object *lock, c lock_list = PCPU_GET(spinlocks); } instance = find_instance(lock_list, lock); - if (instance == NULL) + if (instance == NULL) { kassert_panic("%s: lock (%s) %s not locked", __func__, class->lc_name, lock->lo_name); + return; + } *filep = instance->li_file; *linep = instance->li_line; } @@ -2241,6 +2258,8 @@ witness_restore(struct lock_object *lock class->lc_name, lock->lo_name); lock->lo_witness->w_file = file; lock->lo_witness->w_line = line; + if (instance == NULL) + return; instance->li_file = file; instance->li_line = line; } @@ -2336,9 +2355,11 @@ witness_setflag(struct lock_object *lock lock_list = PCPU_GET(spinlocks); } instance = find_instance(lock_list, lock); - if (instance == NULL) + if (instance == NULL) { kassert_panic("%s: lock (%s) %s not locked", __func__, class->lc_name, lock->lo_name); + return; + } if (set) instance->li_flags |= flag; From owner-svn-src-head@FreeBSD.ORG Tue Dec 11 08:37:09 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5540BC54; Tue, 11 Dec 2012 08:37:09 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1F9878FC17; Tue, 11 Dec 2012 08:37:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBB8b8YI042269; Tue, 11 Dec 2012 08:37:08 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBB8b8m8042268; Tue, 11 Dec 2012 08:37:08 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201212110837.qBB8b8m8042268@svn.freebsd.org> From: Gleb Smirnoff Date: Tue, 11 Dec 2012 08:37:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244113 - head/sys/netpfil/pf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 11 Dec 2012 08:37:09 -0000 Author: glebius Date: Tue Dec 11 08:37:08 2012 New Revision: 244113 URL: http://svnweb.freebsd.org/changeset/base/244113 Log: Merge 1.127 from OpenBSD, that closes a regression from 1.125 (merged as r242694): do better detection of when we have a better version of the tcp sequence windows than our peer. this resolves the last of the pfsync traffic storm issues ive been able to produce, and therefore makes it possible to do usable active-active statuful firewalls with pf. Modified: head/sys/netpfil/pf/if_pfsync.c Modified: head/sys/netpfil/pf/if_pfsync.c ============================================================================== --- head/sys/netpfil/pf/if_pfsync.c Tue Dec 11 07:08:14 2012 (r244112) +++ head/sys/netpfil/pf/if_pfsync.c Tue Dec 11 08:37:08 2012 (r244113) @@ -47,7 +47,7 @@ * 1.118, 1.124, 1.148, 1.149, 1.151, 1.171 - fixes to bulk updates * 1.120, 1.175 - use monotonic time_uptime * 1.122 - reduce number of updates for non-TCP sessions - * 1.125 - rewrite merge or stale processing + * 1.125, 1.127 - rewrite merge or stale processing * 1.128 - cleanups * 1.146 - bzero() mbuf before sparsely filling it with data * 1.170 - SIOCSIFMTU checks @@ -787,12 +787,15 @@ pfsync_upd_tcp(struct pf_state *st, stru if ((st->src.state > src->state && (st->src.state < PF_TCPS_PROXY_SRC || src->state >= PF_TCPS_PROXY_SRC)) || - SEQ_GT(st->src.seqlo, ntohl(src->seqlo))) + + (st->src.state == src->state && + SEQ_GT(st->src.seqlo, ntohl(src->seqlo)))) sync++; else pf_state_peer_ntoh(src, &st->src); - if (st->dst.state > dst->state || + if ((st->dst.state > dst->state) || + (st->dst.state >= TCPS_SYN_SENT && SEQ_GT(st->dst.seqlo, ntohl(dst->seqlo)))) sync++; From owner-svn-src-head@FreeBSD.ORG Tue Dec 11 08:43:01 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A06C6ECE; Tue, 11 Dec 2012 08:43:01 +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 594EC8FC0C; Tue, 11 Dec 2012 08:43:00 +0000 (UTC) Received: from porto.starpoint.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 KAA22885; Tue, 11 Dec 2012 10:42:59 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1TiLQY-000K4m-JR; Tue, 11 Dec 2012 10:42:58 +0200 Message-ID: <50C6F211.4010701@FreeBSD.org> Date: Tue, 11 Dec 2012 10:42:57 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Alfred Perlstein Subject: Re: svn commit: r244112 - head/sys/kern References: <201212110708.qBB78EWx025288@svn.freebsd.org> In-Reply-To: <201212110708.qBB78EWx025288@svn.freebsd.org> X-Enigmail-Version: 1.4.6 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 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 11 Dec 2012 08:43:01 -0000 on 11/12/2012 09:08 Alfred Perlstein said the following: > Author: alfred > Date: Tue Dec 11 07:08:14 2012 > New Revision: 244112 > URL: http://svnweb.freebsd.org/changeset/base/244112 > > Log: > Cleanup more of the kassert_panic. > > fix compile warnings on !amd64 and NULL derefs that would happen > if kassert_panic() would return. Would it make sense to develop this feature in a branch? Get it compiled, tested and reviewed, and only then merged? Especially given that this is infrastructural code and not an isolated driver. -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Tue Dec 11 09:38:13 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A64368EB; Tue, 11 Dec 2012 09:38:13 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 896CE8FC08; Tue, 11 Dec 2012 09:38:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBB9cDkT053553; Tue, 11 Dec 2012 09:38:13 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBB9cDMr053552; Tue, 11 Dec 2012 09:38:13 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201212110938.qBB9cDMr053552@svn.freebsd.org> From: Baptiste Daroussin Date: Tue, 11 Dec 2012 09:38:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244114 - head/sys/dev/agp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 11 Dec 2012 09:38:13 -0000 Author: bapt Date: Tue Dec 11 09:38:12 2012 New Revision: 244114 URL: http://svnweb.freebsd.org/changeset/base/244114 Log: Add pci id for the xeon hd4000 (IvyBridge server GT2) Submitted by: François Tigeot Obtained from: dragonfly MFC after: 3 days Modified: head/sys/dev/agp/agp_i810.c Modified: head/sys/dev/agp/agp_i810.c ============================================================================== --- head/sys/dev/agp/agp_i810.c Tue Dec 11 08:37:08 2012 (r244113) +++ head/sys/dev/agp/agp_i810.c Tue Dec 11 09:38:12 2012 (r244114) @@ -729,6 +729,11 @@ static const struct agp_i810_match { .driver = &agp_i810_sb_driver }, { + .devid = 0x016a8086, + .name = "IvyBridge server GT2 IG", + .driver = &agp_i810_sb_driver + }, + { .devid = 0, } }; From owner-svn-src-head@FreeBSD.ORG Tue Dec 11 18:39:54 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 83096A5C; Tue, 11 Dec 2012 18:39:54 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4FB3A8FC12; Tue, 11 Dec 2012 18:39:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBBIdsDg061807; Tue, 11 Dec 2012 18:39:54 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBBIdsnR061806; Tue, 11 Dec 2012 18:39:54 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201212111839.qBBIdsnR061806@svn.freebsd.org> From: Eitan Adler Date: Tue, 11 Dec 2012 18:39:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244122 - head/share/examples/etc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 11 Dec 2012 18:39:54 -0000 Author: eadler Date: Tue Dec 11 18:39:53 2012 New Revision: 244122 URL: http://svnweb.freebsd.org/changeset/base/244122 Log: Remove 'dangerous' instructions from the example make.conf. Clarify when and why these might be used and that this isn't a supported configuration. PR: docs/144488 Submitted by: amdmi3 Approved by: cperciva (implicit) MFC after: 2 weeks Modified: head/share/examples/etc/make.conf Modified: head/share/examples/etc/make.conf ============================================================================== --- head/share/examples/etc/make.conf Tue Dec 11 13:51:05 2012 (r244121) +++ head/share/examples/etc/make.conf Tue Dec 11 18:39:53 2012 (r244122) @@ -57,21 +57,20 @@ # CFLAGS controls the compiler settings used when compiling C code. # Note that optimization settings other than -O and -O2 are not recommended # or supported for compiling the world or the kernel - please revert any -# nonstandard optimization settings to "-O" or "-O2 -fno-strict-aliasing" +# nonstandard optimization settings # before submitting bug reports without patches to the developers. # -# Compiling with -fstrict-aliasing optimization breaks some [notable] ports. -# GCC turns on -fstrict-aliasing optimization at all levels above -O[1], so -# explicitly turn it off when using compiling with the -O2 optimization level. -# -#CFLAGS= -O2 -fno-strict-aliasing -pipe -# # CXXFLAGS controls the compiler settings used when compiling C++ code. # Note that CXXFLAGS is initially set to the value of CFLAGS. If you wish # to add to CXXFLAGS value, "+=" must be used rather than "=". Using "=" # alone will remove the often needed contents of CFLAGS from CXXFLAGS. # -#CXXFLAGS+= -fconserve-space +# Additional compiler flags can be specified that extend or override +# default ones. However, neither the base system nor ports are guaranteed +# to build and function without problems with non-default settings. +# +# CFLAGS+= -msse3 +# CXXFLAGS+= -msse3 # # MAKE_SHELL controls the shell used internally by make(1) to process the # command scripts in makefiles. Three shells are supported, sh, ksh, and From owner-svn-src-head@FreeBSD.ORG Tue Dec 11 19:54:36 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7154DB37; Tue, 11 Dec 2012 19:54:36 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 558468FC1E; Tue, 11 Dec 2012 19:54:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBBJsaI7076108; Tue, 11 Dec 2012 19:54:36 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBBJsaAL076107; Tue, 11 Dec 2012 19:54:36 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201212111954.qBBJsaAL076107@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Tue, 11 Dec 2012 19:54:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244123 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 11 Dec 2012 19:54:36 -0000 Author: pjd Date: Tue Dec 11 19:54:35 2012 New Revision: 244123 URL: http://svnweb.freebsd.org/changeset/base/244123 Log: Similar to CTLFLAG_RDTUN, provide CTLFLAG_RWTUN that defines writable sysctl that can also be modified by loader tunable. Modified: head/sys/sys/sysctl.h Modified: head/sys/sys/sysctl.h ============================================================================== --- head/sys/sys/sysctl.h Tue Dec 11 18:39:53 2012 (r244122) +++ head/sys/sys/sysctl.h Tue Dec 11 19:54:35 2012 (r244123) @@ -84,9 +84,10 @@ struct ctlname { #define CTLFLAG_SKIP 0x01000000 /* Skip this sysctl when listing */ #define CTLMASK_SECURE 0x00F00000 /* Secure level */ #define CTLFLAG_TUN 0x00080000 /* Tunable variable */ +#define CTLFLAG_RDTUN (CTLFLAG_RD|CTLFLAG_TUN) +#define CTLFLAG_RWTUN (CTLFLAG_RW|CTLFLAG_TUN) #define CTLFLAG_MPSAFE 0x00040000 /* Handler is MP safe */ #define CTLFLAG_VNET 0x00020000 /* Prisons with vnet can fiddle */ -#define CTLFLAG_RDTUN (CTLFLAG_RD|CTLFLAG_TUN) #define CTLFLAG_DYING 0x00010000 /* oid is being removed */ #define CTLFLAG_CAPRD 0x00008000 /* Can be read in capability mode */ #define CTLFLAG_CAPWR 0x00004000 /* Can be written in capability mode */ From owner-svn-src-head@FreeBSD.ORG Tue Dec 11 19:54:51 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AE66CCA4; Tue, 11 Dec 2012 19:54:51 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (garage.dawidek.net [91.121.88.72]) by mx1.freebsd.org (Postfix) with ESMTP id BBD4E8FC14; Tue, 11 Dec 2012 19:54:50 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id 3964ADA3; Tue, 11 Dec 2012 20:52:43 +0100 (CET) Date: Tue, 11 Dec 2012 20:56:19 +0100 From: Pawel Jakub Dawidek To: Alfred Perlstein Subject: Re: svn commit: r244106 - head/sbin/sysctl Message-ID: <20121211195618.GA1381@garage.freebsd.pl> References: <201212110128.qBB1S7rh061270@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="1yeeQ81UyVL57Vl7" Content-Disposition: inline In-Reply-To: <201212110128.qBB1S7rh061270@svn.freebsd.org> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 11 Dec 2012 19:54:51 -0000 --1yeeQ81UyVL57Vl7 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Dec 11, 2012 at 01:28:07AM +0000, Alfred Perlstein wrote: > Author: alfred > Date: Tue Dec 11 01:28:06 2012 > New Revision: 244106 > URL: http://svnweb.freebsd.org/changeset/base/244106 >=20 > Log: > Allow sysctl to filter boot and runtime tunables. > =20 > Add the following flags to sysctl: > -W - show only writable sysctls > -T - show only tuneable sysctls [...] > +.It Fl T > +Display only variables that are setable via loader (CTLFLAG_TUN). To this point CTLFLAG_TUN was only important for read-only sysctls to give user a hint that the given sysctl can be changed via loader tunable on boot only (or on module load via kenv(1)). Your change makes it useful to also mark read-write sysctls as tunables and I suspect there is huge number of such sysctls that have no CTLFLAG_TUN flag. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --1yeeQ81UyVL57Vl7 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlDHj+IACgkQForvXbEpPzReCQCg73fsiVxfpf1HKyHC6dkBageP HWUAoJN4GNZ3Pm0DE+bnWZxZxB9Du7Qa =wEM+ -----END PGP SIGNATURE----- --1yeeQ81UyVL57Vl7-- From owner-svn-src-head@FreeBSD.ORG Tue Dec 11 20:08:58 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 205D368A; Tue, 11 Dec 2012 20:08:58 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 067878FC14; Tue, 11 Dec 2012 20:08:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBBK8vbf079522; Tue, 11 Dec 2012 20:08:57 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBBK8vpD079521; Tue, 11 Dec 2012 20:08:57 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201212112008.qBBK8vpD079521@svn.freebsd.org> From: Dimitry Andric Date: Tue, 11 Dec 2012 20:08:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244124 - head/lib/clang X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 11 Dec 2012 20:08:58 -0000 Author: dim Date: Tue Dec 11 20:08:57 2012 New Revision: 244124 URL: http://svnweb.freebsd.org/changeset/base/244124 Log: Cleanup a few duplicate llvm libs that snuck in with the recent update. Noticed by: rdivacky Modified: head/lib/clang/Makefile Modified: head/lib/clang/Makefile ============================================================================== --- head/lib/clang/Makefile Tue Dec 11 19:54:35 2012 (r244123) +++ head/lib/clang/Makefile Tue Dec 11 20:08:57 2012 (r244124) @@ -71,15 +71,12 @@ SUBDIR= libclanganalysis \ libllvmx86utils .if ${MK_CLANG_EXTRAS} != "no" -SUBDIR+=libllvmarchive \ - libllvmdebuginfo \ +SUBDIR+=libllvmdebuginfo \ libllvmexecutionengine \ libllvminterpreter \ libllvmjit \ - libllvmlinker \ libllvmmcdisassembler \ libllvmmcjit \ - libllvmobject \ libllvmruntimedyld .endif .endif From owner-svn-src-head@FreeBSD.ORG Tue Dec 11 22:52:57 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 83AD22F4; Tue, 11 Dec 2012 22:52:57 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 678848FC08; Tue, 11 Dec 2012 22:52:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBBMqvN9011179; Tue, 11 Dec 2012 22:52:57 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBBMqvH9011176; Tue, 11 Dec 2012 22:52:57 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201212112252.qBBMqvH9011176@svn.freebsd.org> From: Jilles Tjoelker Date: Tue, 11 Dec 2012 22:52:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244126 - head/lib/libc/locale X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 11 Dec 2012 22:52:57 -0000 Author: jilles Date: Tue Dec 11 22:52:56 2012 New Revision: 244126 URL: http://svnweb.freebsd.org/changeset/base/244126 Log: libc: Make various internal file descriptors close-on-exec. These are obtained via fopen(). Modified: head/lib/libc/locale/collate.c head/lib/libc/locale/setrunelocale.c Modified: head/lib/libc/locale/collate.c ============================================================================== --- head/lib/libc/locale/collate.c Tue Dec 11 20:38:53 2012 (r244125) +++ head/lib/libc/locale/collate.c Tue Dec 11 22:52:56 2012 (r244126) @@ -135,7 +135,7 @@ __collate_load_tables_l(const char *enco (void)strcat(buf, "/"); (void)strcat(buf, encoding); (void)strcat(buf, "/LC_COLLATE"); - if ((fp = fopen(buf, "r")) == NULL) + if ((fp = fopen(buf, "re")) == NULL) return (_LDP_ERROR); if (fread(strbuf, sizeof(strbuf), 1, fp) != 1) { Modified: head/lib/libc/locale/setrunelocale.c ============================================================================== --- head/lib/libc/locale/setrunelocale.c Tue Dec 11 20:38:53 2012 (r244125) +++ head/lib/libc/locale/setrunelocale.c Tue Dec 11 22:52:56 2012 (r244126) @@ -129,7 +129,7 @@ __setrunelocale(struct xlocale_ctype *l, (void) strcat(name, encoding); (void) strcat(name, "/LC_CTYPE"); - if ((fp = fopen(name, "r")) == NULL) + if ((fp = fopen(name, "re")) == NULL) return (errno == 0 ? ENOENT : errno); if ((rl = _Read_RuneMagi(fp)) == NULL) { From owner-svn-src-head@FreeBSD.ORG Wed Dec 12 01:50:59 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0D11DE3E; Wed, 12 Dec 2012 01:50:59 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E65918FC08; Wed, 12 Dec 2012 01:50:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBC1owhq036377; Wed, 12 Dec 2012 01:50:58 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBC1owJt036375; Wed, 12 Dec 2012 01:50:58 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201212120150.qBC1owJt036375@svn.freebsd.org> From: Xin LI Date: Wed, 12 Dec 2012 01:50:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244132 - head/usr.sbin/service X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 12 Dec 2012 01:50:59 -0000 Author: delphij Date: Wed Dec 12 01:50:58 2012 New Revision: 244132 URL: http://svnweb.freebsd.org/changeset/base/244132 Log: Add -R, an option to restart all enabled "local" services. Discussed on: -rc@ (in September) MFC after: 2 months Modified: head/usr.sbin/service/service.8 head/usr.sbin/service/service.sh Modified: head/usr.sbin/service/service.8 ============================================================================== --- head/usr.sbin/service/service.8 Wed Dec 12 01:05:19 2012 (r244131) +++ head/usr.sbin/service/service.8 Wed Dec 12 01:50:58 2012 (r244132) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 26, 2009 +.Dd December 11, 2012 .Dt SERVICE 8 .Os .Sh NAME @@ -34,6 +34,8 @@ .Nm .Fl e .Nm +.Fl R +.Nm .Op Fl v .Fl l | r .Nm @@ -62,6 +64,8 @@ then that list of scripts is checked for .Qq rcvar assignment. If present the script is checked to see if it is enabled. +.It Fl R +Restart all enabled local services. .It Fl l List all files in .Pa /etc/rc.d Modified: head/usr.sbin/service/service.sh ============================================================================== --- head/usr.sbin/service/service.sh Wed Dec 12 01:05:19 2012 (r244131) +++ head/usr.sbin/service/service.sh Wed Dec 12 01:50:58 2012 (r244132) @@ -33,29 +33,58 @@ usage () { echo '' echo 'Usage:' echo "${0##*/} -e" + echo "${0##*/} -R" echo "${0##*/} [-v] -l | -r" echo "${0##*/} [-v] start|stop|etc." echo "${0##*/} -h" echo '' echo '-e Show services that are enabled' + echo "-R Stop and start enabled $local_startup services" echo "-l List all scripts in /etc/rc.d and $local_startup" echo '-r Show the results of boot time rcorder' echo '-v Verbose' echo '' } -while getopts 'ehlrv' COMMAND_LINE_ARGUMENT ; do +while getopts 'ehlrRv' COMMAND_LINE_ARGUMENT ; do case "${COMMAND_LINE_ARGUMENT}" in e) ENABLED=eopt ;; h) usage ; exit 0 ;; l) LIST=lopt ;; r) RCORDER=ropt ;; + R) RESTART=Ropt ;; v) VERBOSE=vopt ;; *) usage ; exit 1 ;; esac done shift $(( $OPTIND - 1 )) +if [ -n "$RESTART" ]; then + skip="-s nostart" + if [ `/sbin/sysctl -n security.jail.jailed` -eq 1 ]; then + skip="$skip -s nojail" + fi + [ -n "$local_startup" ] && find_local_scripts_new + files=`rcorder ${skip} ${local_rc} 2>/dev/null` + + for file in `reverse_list ${files}`; do + if grep -q ^rcvar $file; then + eval `grep ^name= $file` + eval `grep ^rcvar $file` + checkyesno $rcvar 2>/dev/null && run_rc_script ${file} stop + fi + done + for file in $files; do + if grep -q ^rcvar $file; then + eval `grep ^name= $file` + eval `grep ^rcvar $file` + checkyesno $rcvar 2>/dev/null && run_rc_script ${file} start + fi + done + + exit 0 +fi + if [ -n "$ENABLED" -o -n "$RCORDER" ]; then # Copied from /etc/rc skip="-s nostart" From owner-svn-src-head@FreeBSD.ORG Wed Dec 12 02:55:41 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7EC9EDAB; Wed, 12 Dec 2012 02:55:41 +0000 (UTC) (envelope-from alfred@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 49B228FC0C; Wed, 12 Dec 2012 02:55:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBC2tfrL045785; Wed, 12 Dec 2012 02:55:41 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBC2tfj2045784; Wed, 12 Dec 2012 02:55:41 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <201212120255.qBC2tfj2045784@svn.freebsd.org> From: Alfred Perlstein Date: Wed, 12 Dec 2012 02:55:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244133 - head/sbin/sysctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 12 Dec 2012 02:55:41 -0000 Author: alfred Date: Wed Dec 12 02:55:40 2012 New Revision: 244133 URL: http://svnweb.freebsd.org/changeset/base/244133 Log: Make Tflag and Wflag filters work for more sysctl options. To do this move the Tflag and Wflag checks earlier in show_var() so we bail earlier for variables not matching our query. Modified: head/sbin/sysctl/sysctl.c Modified: head/sbin/sysctl/sysctl.c ============================================================================== --- head/sbin/sysctl/sysctl.c Wed Dec 12 01:50:58 2012 (r244132) +++ head/sbin/sysctl/sysctl.c Wed Dec 12 02:55:40 2012 (r244133) @@ -539,7 +539,7 @@ static int show_var(int *oid, int nlen) { u_char buf[BUFSIZ], *val, *oval, *p; - char name[BUFSIZ], *fmt; + char name[BUFSIZ], fmt[BUFSIZ]; const char *sep, *sep1; int qoid[CTL_MAXNAME+2]; uintmax_t umv; @@ -554,6 +554,7 @@ show_var(int *oid, int nlen) umv = mv = intlen = 0; bzero(buf, BUFSIZ); + bzero(fmt, BUFSIZ); bzero(name, BUFSIZ); qoid[0] = 0; memcpy(qoid + 2, oid, nlen * sizeof(int)); @@ -564,6 +565,15 @@ show_var(int *oid, int nlen) if (i || !j) err(1, "sysctl name %d %zu %d", i, j, errno); + oidfmt(oid, nlen, fmt, &kind); + /* if Wflag then only list sysctls that are writeable and not stats. */ + if (Wflag && ((kind & CTLFLAG_WR) == 0 || (kind & CTLFLAG_STATS) != 0)) + return 1; + + /* if Tflag then only list sysctls that are tuneables. */ + if (Tflag && (kind & CTLFLAG_TUN) == 0) + return 1; + if (Nflag) { printf("%s", name); return (0); @@ -606,21 +616,11 @@ show_var(int *oid, int nlen) return (0); } val[len] = '\0'; - fmt = buf; - oidfmt(oid, nlen, fmt, &kind); p = val; ctltype = (kind & CTLTYPE); sign = ctl_sign[ctltype]; intlen = ctl_size[ctltype]; - /* if Wflag then only list sysctls that are writeable and not stats. */ - if (Wflag && ((kind & CTLFLAG_WR) == 0 || (kind & CTLFLAG_STATS) != 0)) - return 1; - - /* if Tflag then only list sysctls that are tuneables. */ - if (Tflag && (kind & CTLFLAG_TUN) == 0) - return 1; - switch (ctltype) { case CTLTYPE_STRING: if (!nflag) From owner-svn-src-head@FreeBSD.ORG Wed Dec 12 04:18:26 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 60C06A97; Wed, 12 Dec 2012 04:18:26 +0000 (UTC) (envelope-from grog@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 450E78FC13; Wed, 12 Dec 2012 04:18:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBC4IQ2h057873; Wed, 12 Dec 2012 04:18:26 GMT (envelope-from grog@svn.freebsd.org) Received: (from grog@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBC4IQGu057871; Wed, 12 Dec 2012 04:18:26 GMT (envelope-from grog@svn.freebsd.org) Message-Id: <201212120418.qBC4IQGu057871@svn.freebsd.org> From: Greg Lehey Date: Wed, 12 Dec 2012 04:18:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244134 - head/bin/df X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 12 Dec 2012 04:18:26 -0000 Author: grog Date: Wed Dec 12 04:18:25 2012 New Revision: 244134 URL: http://svnweb.freebsd.org/changeset/base/244134 Log: Handle large negative block counts correctly. MFC after: 2 weeks Modified: head/bin/df/df.c Modified: head/bin/df/df.c ============================================================================== --- head/bin/df/df.c Wed Dec 12 02:55:40 2012 (r244133) +++ head/bin/df/df.c Wed Dec 12 04:18:25 2012 (r244134) @@ -397,7 +397,7 @@ prthumanvalinode(int64_t bytes) static intmax_t fsbtoblk(int64_t num, uint64_t fsbs, u_long bs) { - return (num * (intmax_t) fsbs / bs); + return (num * (intmax_t) fsbs / (int64_t) bs); } /* From owner-svn-src-head@FreeBSD.ORG Wed Dec 12 05:01:01 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C7808434; Wed, 12 Dec 2012 05:01:01 +0000 (UTC) (envelope-from bryanv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AD9BB8FC0C; Wed, 12 Dec 2012 05:01:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBC511mS065259; Wed, 12 Dec 2012 05:01:01 GMT (envelope-from bryanv@svn.freebsd.org) Received: (from bryanv@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBC511rK065258; Wed, 12 Dec 2012 05:01:01 GMT (envelope-from bryanv@svn.freebsd.org) Message-Id: <201212120501.qBC511rK065258@svn.freebsd.org> From: Bryan Venteicher Date: Wed, 12 Dec 2012 05:01:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244136 - head/sys/dev/virtio/scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 12 Dec 2012 05:01:01 -0000 Author: bryanv Date: Wed Dec 12 05:01:01 2012 New Revision: 244136 URL: http://svnweb.freebsd.org/changeset/base/244136 Log: virtio_scsi: Remove duplicated lines These must have been accidently copied from the if statement a few lines later. Also remove parameter name from function prototype. Approved by: grehan (mentor) Modified: head/sys/dev/virtio/scsi/virtio_scsi.c Modified: head/sys/dev/virtio/scsi/virtio_scsi.c ============================================================================== --- head/sys/dev/virtio/scsi/virtio_scsi.c Wed Dec 12 05:00:26 2012 (r244135) +++ head/sys/dev/virtio/scsi/virtio_scsi.c Wed Dec 12 05:01:01 2012 (r244136) @@ -129,7 +129,7 @@ static int vtscsi_execute_abort_task_cm static int vtscsi_execute_reset_dev_cmd(struct vtscsi_softc *, struct vtscsi_request *); -static void vtscsi_get_request_lun(uint8_t lun[], target_id_t *, lun_id_t *); +static void vtscsi_get_request_lun(uint8_t [], target_id_t *, lun_id_t *); static void vtscsi_set_request_lun(struct ccb_hdr *, uint8_t []); static void vtscsi_init_scsi_cmd_req(struct ccb_scsiio *, struct virtio_scsi_cmd_req *); @@ -1673,9 +1673,6 @@ vtscsi_announce(struct vtscsi_softc *sc, { struct cam_path *path; - xpt_async(ac_code, sc->vtscsi_path, NULL); - return; - /* Use the wildcard path from our softc for bus announcements. */ if (target_id == CAM_TARGET_WILDCARD && lun_id == CAM_LUN_WILDCARD) { xpt_async(ac_code, sc->vtscsi_path, NULL); From owner-svn-src-head@FreeBSD.ORG Wed Dec 12 08:35:33 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6A96A58B; Wed, 12 Dec 2012 08:35:33 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4F1B88FC0A; Wed, 12 Dec 2012 08:35:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBC8ZXD2000249; Wed, 12 Dec 2012 08:35:33 GMT (envelope-from grehan@svn.freebsd.org) Received: (from grehan@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBC8ZWeL000247; Wed, 12 Dec 2012 08:35:32 GMT (envelope-from grehan@svn.freebsd.org) Message-Id: <201212120835.qBC8ZWeL000247@svn.freebsd.org> From: Peter Grehan Date: Wed, 12 Dec 2012 08:35:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244144 - in head/sys/amd64: amd64 include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 12 Dec 2012 08:35:33 -0000 Author: grehan Date: Wed Dec 12 08:35:32 2012 New Revision: 244144 URL: http://svnweb.freebsd.org/changeset/base/244144 Log: Implement an API to allow a hypervisor to save/restore guest floating point state without having to know the size of floating-point state. Unstaticize fpurestore to allow the hypervisor to save/restore guest state using fpusave/fpurestore on the allocated FPU state area. Reviewed by: kib Obtained from: NetApp/bhyve MFC after: 1 week Modified: head/sys/amd64/amd64/fpu.c head/sys/amd64/include/fpu.h Modified: head/sys/amd64/amd64/fpu.c ============================================================================== --- head/sys/amd64/amd64/fpu.c Wed Dec 12 07:29:38 2012 (r244143) +++ head/sys/amd64/amd64/fpu.c Wed Dec 12 08:35:32 2012 (r244144) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -134,6 +135,7 @@ SYSCTL_INT(_hw, HW_FLOATINGPT, floatingp static int use_xsaveopt; int use_xsave; /* non-static for cpu_switch.S */ uint64_t xsave_mask; /* the same */ +static uma_zone_t fpu_save_area_zone; static struct savefpu *fpu_initialstate; struct xsave_area_elm_descr { @@ -151,7 +153,7 @@ fpusave(void *addr) fxsave((char *)addr); } -static void +void fpurestore(void *addr) { @@ -312,6 +314,10 @@ fpuinitstate(void *arg __unused) } } + fpu_save_area_zone = uma_zcreate("FPU_save_area", + cpu_max_ext_state_size, NULL, NULL, NULL, NULL, + XSAVE_AREA_ALIGN - 1, 0); + start_emulating(); intr_restore(saveintr); } @@ -980,3 +986,27 @@ is_fpu_kern_thread(u_int flags) return (0); return ((curpcb->pcb_flags & PCB_KERNFPU) != 0); } + +/* + * FPU save area alloc/free/init utility routines + */ +struct savefpu * +fpu_save_area_alloc(void) +{ + + return (uma_zalloc(fpu_save_area_zone, 0)); +} + +void +fpu_save_area_free(struct savefpu *fsa) +{ + + uma_zfree(fpu_save_area_zone, fsa); +} + +void +fpu_save_area_reset(struct savefpu *fsa) +{ + + bcopy(fpu_initialstate, fsa, cpu_max_ext_state_size); +} Modified: head/sys/amd64/include/fpu.h ============================================================================== --- head/sys/amd64/include/fpu.h Wed Dec 12 07:29:38 2012 (r244143) +++ head/sys/amd64/include/fpu.h Wed Dec 12 08:35:32 2012 (r244144) @@ -57,6 +57,7 @@ void fpuexit(struct thread *td); int fpuformat(void); int fpugetregs(struct thread *td); void fpuinit(void); +void fpurestore(void *addr); void fpusave(void *addr); int fpusetregs(struct thread *td, struct savefpu *addr, char *xfpustate, size_t xfpustate_size); @@ -73,6 +74,10 @@ int fpu_kern_leave(struct thread *td, st int fpu_kern_thread(u_int flags); int is_fpu_kern_thread(u_int flags); +struct savefpu *fpu_save_area_alloc(void); +void fpu_save_area_free(struct savefpu *fsa); +void fpu_save_area_reset(struct savefpu *fsa); + /* * Flags for fpu_kern_alloc_ctx(), fpu_kern_enter() and fpu_kern_thread(). */ From owner-svn-src-head@FreeBSD.ORG Wed Dec 12 11:44:21 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 990AB305; Wed, 12 Dec 2012 11:44:21 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7CDBB8FC14; Wed, 12 Dec 2012 11:44:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBCBiL41036514; Wed, 12 Dec 2012 11:44:21 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBCBiLt3036512; Wed, 12 Dec 2012 11:44:21 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201212121144.qBCBiLt3036512@svn.freebsd.org> From: Alexander Motin Date: Wed, 12 Dec 2012 11:44:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244145 - head/sys/dev/sound/pci/hda X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 12 Dec 2012 11:44:21 -0000 Author: mav Date: Wed Dec 12 11:44:20 2012 New Revision: 244145 URL: http://svnweb.freebsd.org/changeset/base/244145 Log: Add quirks for AD1984A codec and Lenovo X300 laptop. PR: kern/148741 MFC after: 2 weeks Modified: head/sys/dev/sound/pci/hda/hdaa_patches.c head/sys/dev/sound/pci/hda/hdac.h Modified: head/sys/dev/sound/pci/hda/hdaa_patches.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdaa_patches.c Wed Dec 12 08:35:32 2012 (r244144) +++ head/sys/dev/sound/pci/hda/hdaa_patches.c Wed Dec 12 11:44:20 2012 (r244145) @@ -271,7 +271,17 @@ hdac_pin_patch(struct hdaa_widget *w) } /* New patches */ - if (id == HDA_CODEC_AD1986A && + if (id == HDA_CODEC_AD1984A && + subid == LENOVO_X300_SUBVENDOR) { + switch (nid) { + case 17: /* Headphones with redirection */ + patch = "as=1 seq=15"; + break; + case 20: /* Two mics together */ + patch = "as=2 seq=15"; + break; + } + } else if (id == HDA_CODEC_AD1986A && (subid == ASUS_M2NPVMX_SUBVENDOR || subid == ASUS_A8NVMCSM_SUBVENDOR || subid == ASUS_P5PL2_SUBVENDOR)) { @@ -372,6 +382,13 @@ hdaa_widget_patch(struct hdaa_widget *w) HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_SHIFT; w->waspin = 1; } + /* + * Clear "digital" flag from digital mic input, as its signal then goes + * to "analog" mixer and this separation just limits functionaity. + */ + if (hdaa_codec_id(devinfo) == HDA_CODEC_AD1984A && + w->nid == 23) + w->param.widget_cap &= ~HDA_PARAM_AUDIO_WIDGET_CAP_DIGITAL_MASK; HDA_BOOTVERBOSE( if (w->param.widget_cap != orig) { device_printf(w->devinfo->dev, Modified: head/sys/dev/sound/pci/hda/hdac.h ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.h Wed Dec 12 08:35:32 2012 (r244144) +++ head/sys/dev/sound/pci/hda/hdac.h Wed Dec 12 11:44:20 2012 (r244145) @@ -218,6 +218,7 @@ #define LENOVO_3KN200_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x384e) #define LENOVO_B450_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x3a0d) #define LENOVO_TCA55_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x1015) +#define LENOVO_X300_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x20ac) #define LENOVO_ALL_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0xffff) /* Samsung */ From owner-svn-src-head@FreeBSD.ORG Wed Dec 12 11:53:16 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1F73F5C3; Wed, 12 Dec 2012 11:53:16 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 00FD58FC08; Wed, 12 Dec 2012 11:53:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBCBrF43038129; Wed, 12 Dec 2012 11:53:15 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBCBrFjI038125; Wed, 12 Dec 2012 11:53:15 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201212121153.qBCBrFjI038125@svn.freebsd.org> From: Alexander Motin Date: Wed, 12 Dec 2012 11:53:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244146 - in head/sys/dev: ahci ata ata/chipsets X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 12 Dec 2012 11:53:16 -0000 Author: mav Date: Wed Dec 12 11:53:15 2012 New Revision: 244146 URL: http://svnweb.freebsd.org/changeset/base/244146 Log: Add IDs for SATA controllers on AMD Hudson-2 series chipsets. I am not exactly sure about the naming due to lack of specs on AMD site, but it is better to have some identification then none at all. MFC after: 1 month Modified: head/sys/dev/ahci/ahci.c head/sys/dev/ata/ata-pci.h head/sys/dev/ata/chipsets/ata-ati.c Modified: head/sys/dev/ahci/ahci.c ============================================================================== --- head/sys/dev/ahci/ahci.c Wed Dec 12 11:44:20 2012 (r244145) +++ head/sys/dev/ahci/ahci.c Wed Dec 12 11:53:15 2012 (r244146) @@ -122,6 +122,11 @@ static struct { {0x43931002, 0x00, "ATI IXP700", 0}, {0x43941002, 0x00, "ATI IXP800", 0}, {0x43951002, 0x00, "ATI IXP800", 0}, + {0x78001022, 0x00, "AMD Hudson-2", 0}, + {0x78011022, 0x00, "AMD Hudson-2", 0}, + {0x78021022, 0x00, "AMD Hudson-2", 0}, + {0x78031022, 0x00, "AMD Hudson-2", 0}, + {0x78041022, 0x00, "AMD Hudson-2", 0}, {0x06121b21, 0x00, "ASMedia ASM1061", 0}, {0x26528086, 0x00, "Intel ICH6", AHCI_Q_NOFORCE}, {0x26538086, 0x00, "Intel ICH6M", AHCI_Q_NOFORCE}, Modified: head/sys/dev/ata/ata-pci.h ============================================================================== --- head/sys/dev/ata/ata-pci.h Wed Dec 12 11:44:20 2012 (r244145) +++ head/sys/dev/ata/ata-pci.h Wed Dec 12 11:53:15 2012 (r244146) @@ -101,6 +101,12 @@ struct ata_pci_controller { #define ATA_AMD768 0x74411022 #define ATA_AMD8111 0x74691022 #define ATA_AMD5536 0x209a1022 +#define ATA_AMD_HUDSON2_S1 0x78001022 +#define ATA_AMD_HUDSON2_S2 0x78011022 +#define ATA_AMD_HUDSON2_S3 0x78021022 +#define ATA_AMD_HUDSON2_S4 0x78031022 +#define ATA_AMD_HUDSON2_S5 0x78041022 +#define ATA_AMD_HUDSON2 0x780c1022 #define ATA_ADAPTEC_ID 0x9005 #define ATA_ADAPTEC_1420 0x02419005 Modified: head/sys/dev/ata/chipsets/ata-ati.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-ati.c Wed Dec 12 11:44:20 2012 (r244145) +++ head/sys/dev/ata/chipsets/ata-ati.c Wed Dec 12 11:53:15 2012 (r244146) @@ -91,6 +91,12 @@ ata_ati_probe(device_t dev) { ATA_ATI_IXP700_S4, 0x00, ATI_AHCI, 0, ATA_SA300, "IXP700/800" }, { ATA_ATI_IXP800_S1, 0x00, ATI_AHCI, 0, ATA_SA300, "IXP800" }, { ATA_ATI_IXP800_S2, 0x00, ATI_AHCI, 0, ATA_SA300, "IXP800" }, + { ATA_AMD_HUDSON2, 0x00, ATI_PATA, 0, ATA_UDMA6, "Hudson-2" }, + { ATA_AMD_HUDSON2_S1, 0x00, ATI_AHCI, 0, ATA_SA300, "Hudson-2" }, + { ATA_AMD_HUDSON2_S2, 0x00, ATI_AHCI, 0, ATA_SA300, "Hudson-2" }, + { ATA_AMD_HUDSON2_S3, 0x00, ATI_AHCI, 0, ATA_SA300, "Hudson-2" }, + { ATA_AMD_HUDSON2_S4, 0x00, ATI_AHCI, 0, ATA_SA300, "Hudson-2" }, + { ATA_AMD_HUDSON2_S5, 0x00, ATI_AHCI, 0, ATA_SA300, "Hudson-2" }, { 0, 0, 0, 0, 0, 0}}; if (pci_get_vendor(dev) != ATA_ATI_ID) From owner-svn-src-head@FreeBSD.ORG Wed Dec 12 15:27:34 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 58C6FDDD; Wed, 12 Dec 2012 15:27:34 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3C1AD8FC18; Wed, 12 Dec 2012 15:27:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBCFRYmT083335; Wed, 12 Dec 2012 15:27:34 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBCFRY2F083334; Wed, 12 Dec 2012 15:27:34 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201212121527.qBCFRY2F083334@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 12 Dec 2012 15:27:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244153 - head/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 12 Dec 2012 15:27:34 -0000 Author: pjd Date: Wed Dec 12 15:27:33 2012 New Revision: 244153 URL: http://svnweb.freebsd.org/changeset/base/244153 Log: Eliminate redundant variable. Modified: head/lib/libc/gen/sysctlbyname.c Modified: head/lib/libc/gen/sysctlbyname.c ============================================================================== --- head/lib/libc/gen/sysctlbyname.c Wed Dec 12 13:33:11 2012 (r244152) +++ head/lib/libc/gen/sysctlbyname.c Wed Dec 12 15:27:33 2012 (r244153) @@ -19,13 +19,10 @@ sysctlbyname(const char *name, void *old const void *newp, size_t newlen) { int real_oid[CTL_MAXNAME+2]; - int error; size_t oidlen; oidlen = sizeof(real_oid) / sizeof(int); - error = sysctlnametomib(name, real_oid, &oidlen); - if (error < 0) - return (error); - error = sysctl(real_oid, oidlen, oldp, oldlenp, newp, newlen); - return (error); + if (sysctlnametomib(name, real_oid, &oidlen) < 0) + return (-1); + return (sysctl(real_oid, oidlen, oldp, oldlenp, newp, newlen)); } From owner-svn-src-head@FreeBSD.ORG Wed Dec 12 15:45:04 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BB4746BA; Wed, 12 Dec 2012 15:45:04 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 85C468FC08; Wed, 12 Dec 2012 15:45:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBCFj4hS086445; Wed, 12 Dec 2012 15:45:04 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBCFj4Hl086444; Wed, 12 Dec 2012 15:45:04 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201212121545.qBCFj4Hl086444@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 12 Dec 2012 15:45:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244154 - head/bin/ps X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 12 Dec 2012 15:45:04 -0000 Author: pjd Date: Wed Dec 12 15:45:03 2012 New Revision: 244154 URL: http://svnweb.freebsd.org/changeset/base/244154 Log: Use kern.max_pid sysctl to obtain maximum PID number instead of using local define. Reviewed by: jhb Modified: head/bin/ps/ps.c Modified: head/bin/ps/ps.c ============================================================================== --- head/bin/ps/ps.c Wed Dec 12 15:27:33 2012 (r244153) +++ head/bin/ps/ps.c Wed Dec 12 15:45:03 2012 (r244154) @@ -109,6 +109,7 @@ static int needcomm; /* -o "command" */ static int needenv; /* -e */ static int needuser; /* -o "user" */ static int optfatal; /* Fatal error parsing some list-option. */ +static int pid_max; /* kern.max_pid */ static enum sort { DEFAULT, SORTMEM, SORTCPU } sortby = DEFAULT; @@ -148,6 +149,7 @@ static int pscomp(const void *, const v static void saveuser(KINFO *); static void scanvars(void); static void sizevars(void); +static void pidmax_init(void); static void usage(void); static char dfmt[] = "pid,tt,state,time,command"; @@ -200,6 +202,8 @@ main(int argc, char *argv[]) if (argc > 1) argv[1] = kludge_oldps_options(PS_ARGS, argv[1], argv[2]); + pidmax_init(); + all = descendancy = _fmt = nselectors = optfatal = 0; prtheader = showthreads = wflag = xkeep_implied = 0; xkeep = -1; /* Neither -x nor -X. */ @@ -722,7 +726,6 @@ addelem_gid(struct listinfo *inf, const return (1); } -#define BSD_PID_MAX 99999 /* Copy of PID_MAX from sys/proc.h. */ static int addelem_pid(struct listinfo *inf, const char *elem) { @@ -740,7 +743,7 @@ addelem_pid(struct listinfo *inf, const if (*endp != '\0' || tempid < 0 || elem == endp) { warnx("Invalid %s: %s", inf->lname, elem); errno = ERANGE; - } else if (errno != 0 || tempid > BSD_PID_MAX) { + } else if (errno != 0 || tempid > pid_max) { warnx("%s too large: %s", inf->lname, elem); errno = ERANGE; } @@ -753,7 +756,6 @@ addelem_pid(struct listinfo *inf, const inf->l.pids[(inf->count)++] = tempid; return (1); } -#undef BSD_PID_MAX /*- * The user can specify a device via one of three formats: @@ -1352,6 +1354,18 @@ kludge_oldps_options(const char *optlist } static void +pidmax_init(void) +{ + size_t intsize; + + intsize = sizeof(pid_max); + if (sysctlbyname("kern.pid_max", &pid_max, &intsize, NULL, 0) < 0) { + warn("unable to read kern.pid_max"); + pid_max = 99999; + } +} + +static void usage(void) { #define SINGLE_OPTS "[-aCcde" OPT_LAZY_f "HhjlmrSTuvwXxZ]" From owner-svn-src-head@FreeBSD.ORG Wed Dec 12 15:51:25 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 174A19B1; Wed, 12 Dec 2012 15:51:25 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id D55E68FC15; Wed, 12 Dec 2012 15:51:24 +0000 (UTC) Received: from pakbsde14.localnet (unknown [38.105.238.108]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 49CCDB9A9; Wed, 12 Dec 2012 10:51:24 -0500 (EST) From: John Baldwin To: Alfred Perlstein Subject: Re: svn commit: r244105 - in head/sys: kern sys Date: Wed, 12 Dec 2012 10:42:50 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p22; KDE/4.5.5; amd64; ; ) References: <201212110123.qBB1NpOV060501@svn.freebsd.org> In-Reply-To: <201212110123.qBB1NpOV060501@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201212121042.51362.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 12 Dec 2012 10:51:24 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 12 Dec 2012 15:51:25 -0000 On Monday, December 10, 2012 8:23:51 pm Alfred Perlstein wrote: > Author: alfred > Date: Tue Dec 11 01:23:50 2012 > New Revision: 244105 > URL: http://svnweb.freebsd.org/changeset/base/244105 > > Log: > Switch the hardwired WITNESS panics to kassert_panic. > > This is an ongoing effort to provide runtime debug information > useful in the field that does not panic existing installations. > > This gives us the flexibility needed when shipping images to a > potentially large audience with WITNESS enabled without worrying > about formerly non-fatal LORs hurting a release. > > Sponsored by: iXsystems Witness doesn't panic on LORs. These are all bigger violations for things like doing sx_sunlock() on a exclusively locked sx lock. That is not safe and is merely going to result in data corruption and other unpleasantness. This sounds like a very bad idea. Did you talk about this anywhere (I have not caught up on various lists yet, so apologies if this has been discussed.) -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Wed Dec 12 15:51:37 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id ECA56B14; Wed, 12 Dec 2012 15:51:37 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id BD9B78FC12; Wed, 12 Dec 2012 15:51:37 +0000 (UTC) Received: from pakbsde14.localnet (unknown [38.105.238.108]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 0F39FB924; Wed, 12 Dec 2012 10:51:37 -0500 (EST) From: John Baldwin To: Alfred Perlstein Subject: Re: svn commit: r244112 - head/sys/kern Date: Wed, 12 Dec 2012 10:46:43 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p22; KDE/4.5.5; amd64; ; ) References: <201212110708.qBB78EWx025288@svn.freebsd.org> In-Reply-To: <201212110708.qBB78EWx025288@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201212121046.43706.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 12 Dec 2012 10:51:37 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 12 Dec 2012 15:51:38 -0000 On Tuesday, December 11, 2012 2:08:14 am Alfred Perlstein wrote: > Author: alfred > Date: Tue Dec 11 07:08:14 2012 > New Revision: 244112 > URL: http://svnweb.freebsd.org/changeset/base/244112 > > Log: > Cleanup more of the kassert_panic. > > fix compile warnings on !amd64 and NULL derefs that would happen > if kassert_panic() would return. This is one reason why having kassert not panic is such a bad idea. There are tons of places where the compiler knows that panic() is __dead2, and there is no cleanup code to handle what happens when an invariant is violated. This is not safe to run in the field unless your customers do not care about their data. If you are interested in doing regression tests, I am using a very different approach for some locking regression tests I am working on in p4 that allow you to use a wrapper around setjmp/longjmp to "catch" panics somewhat like exception handling in C++/Java (though much cruder). However, evne that is only intended for testing, not for production cases where production data is at stake. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Wed Dec 12 16:14:15 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D3536471; Wed, 12 Dec 2012 16:14:15 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id ADDF28FC1A; Wed, 12 Dec 2012 16:14:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBCGEFk5092340; Wed, 12 Dec 2012 16:14:15 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBCGEELG092334; Wed, 12 Dec 2012 16:14:14 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201212121614.qBCGEELG092334@svn.freebsd.org> From: Steven Hartland Date: Wed, 12 Dec 2012 16:14:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244155 - in head/sys/cddl: compat/opensolaris/kern compat/opensolaris/sys contrib/opensolaris/uts/common/fs/zfs contrib/opensolaris/uts/common/fs/zfs/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 12 Dec 2012 16:14:15 -0000 Author: smh Date: Wed Dec 12 16:14:14 2012 New Revision: 244155 URL: http://svnweb.freebsd.org/changeset/base/244155 Log: Renamed zfs trim stats removing duplicate zio_trim identifier from the name Added description option to kstats. Added descriptions for zio_trim kstats PR: kern/173113 Submitted by: Steven Hartland Reviewed by: pjd Approved by: pjd MFC after: 2 weeks Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_kstat.c head/sys/cddl/compat/opensolaris/sys/kstat.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_kstat.c ============================================================================== --- head/sys/cddl/compat/opensolaris/kern/opensolaris_kstat.c Wed Dec 12 15:45:03 2012 (r244154) +++ head/sys/cddl/compat/opensolaris/kern/opensolaris_kstat.c Wed Dec 12 16:14:14 2012 (r244155) @@ -118,7 +118,7 @@ kstat_install(kstat_t *ksp) SYSCTL_ADD_PROC(&ksp->ks_sysctl_ctx, SYSCTL_CHILDREN(ksp->ks_sysctl_root), OID_AUTO, ksent->name, CTLTYPE_U64 | CTLFLAG_RD, ksent, sizeof(*ksent), - kstat_sysctl, "QU", ""); + kstat_sysctl, "QU", ksent->desc); } } Modified: head/sys/cddl/compat/opensolaris/sys/kstat.h ============================================================================== --- head/sys/cddl/compat/opensolaris/sys/kstat.h Wed Dec 12 15:45:03 2012 (r244154) +++ head/sys/cddl/compat/opensolaris/sys/kstat.h Wed Dec 12 16:14:14 2012 (r244155) @@ -53,6 +53,8 @@ typedef struct kstat_named { #define KSTAT_DATA_INT64 3 #define KSTAT_DATA_UINT64 4 uchar_t data_type; +#define KSTAT_DESCLEN 128 + char desc[KSTAT_DESCLEN]; union { uint64_t ui64; } value; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Wed Dec 12 15:45:03 2012 (r244154) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Wed Dec 12 16:14:14 2012 (r244155) @@ -372,23 +372,23 @@ typedef struct zio_trim_stats { /* * Number of bytes successfully TRIMmed. */ - kstat_named_t zio_trim_bytes; + kstat_named_t bytes; /* * Number of successful TRIM requests. */ - kstat_named_t zio_trim_success; + kstat_named_t success; /* * Number of TRIM requests that failed because TRIM is not * supported. */ - kstat_named_t zio_trim_unsupported; + kstat_named_t unsupported; /* * Number of TRIM requests that failed for other reasons. */ - kstat_named_t zio_trim_failed; + kstat_named_t failed; } zio_trim_stats_t; extern zio_trim_stats_t zio_trim_stats; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Wed Dec 12 15:45:03 2012 (r244154) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Wed Dec 12 16:14:14 2012 (r244155) @@ -48,14 +48,15 @@ TUNABLE_INT("vfs.zfs.zio.exclude_metadat SYSCTL_INT(_vfs_zfs_zio, OID_AUTO, exclude_metadata, CTLFLAG_RDTUN, &zio_exclude_metadata, 0, "Exclude metadata buffers from dumps as well"); -/* - * See zio.h for more information about these fields. - */ zio_trim_stats_t zio_trim_stats = { - { "zio_trim_bytes", KSTAT_DATA_UINT64 }, - { "zio_trim_success", KSTAT_DATA_UINT64 }, - { "zio_trim_unsupported", KSTAT_DATA_UINT64 }, - { "zio_trim_failed", KSTAT_DATA_UINT64 }, + { "bytes", KSTAT_DATA_UINT64, + "Number of bytes successfully TRIMmed" }, + { "success", KSTAT_DATA_UINT64, + "Number of successful TRIM requests" }, + { "unsupported", KSTAT_DATA_UINT64, + "Number of TRIM requests that failed because TRIM is not supported" }, + { "failed", KSTAT_DATA_UINT64, + "Number of TRIM requests that failed for reasons other than not supported" }, }; static kstat_t *zio_trim_ksp; @@ -2660,14 +2661,14 @@ zio_vdev_io_assess(zio_t *zio) if (zio->io_type == ZIO_TYPE_IOCTL && zio->io_cmd == DKIOCTRIM) switch (zio->io_error) { case 0: - ZIO_TRIM_STAT_INCR(zio_trim_bytes, zio->io_size); - ZIO_TRIM_STAT_BUMP(zio_trim_success); + ZIO_TRIM_STAT_INCR(bytes, zio->io_size); + ZIO_TRIM_STAT_BUMP(success); break; case EOPNOTSUPP: - ZIO_TRIM_STAT_BUMP(zio_trim_unsupported); + ZIO_TRIM_STAT_BUMP(unsupported); break; default: - ZIO_TRIM_STAT_BUMP(zio_trim_failed); + ZIO_TRIM_STAT_BUMP(failed); break; } From owner-svn-src-head@FreeBSD.ORG Wed Dec 12 16:37:33 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6DEE2D64 for ; Wed, 12 Dec 2012 16:37:33 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id D15698FC17 for ; Wed, 12 Dec 2012 16:37:32 +0000 (UTC) Received: by mail-la0-f54.google.com with SMTP id j13so835884lah.13 for ; Wed, 12 Dec 2012 08:37:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=a5pbNXR7ru8n1jQ+nKPJcuH14SZdn7PHtMD5frdtGZ8=; b=uael4KACIzpTUxl3LGE5WReOstV8iCVqDHpQ2v0P5wY+6SXMT6nt2Yqp//xS8pmvKG ADK/K9hlKsFL83mTTwAhf/JHZgieOJubTN5luEOVATjc1Y+MMBMEbMBA2/89ZNm44KNX 8TgMwm5xLIRbzB8AWOo+Xzm5d++K4HtalkhAo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :x-gm-message-state; bh=a5pbNXR7ru8n1jQ+nKPJcuH14SZdn7PHtMD5frdtGZ8=; b=BZUSjH077xnW8vzqN5HqOxeYsQNW3bmg0PuxJsw0vyafSrsS4+jKJoaqoepd+4GwhF osSafHI6yF3NzVc0IJdpHJOQ96N7lwt/kSfoSS8/50M1ieZNH8MZK2Wtg008bBL0xi4A rYuLc1cIm4FlNvBabN0Brf8N1n2yDPL8FhpXeDCbZkBZyBSZeYnvJvoYaHtmTxE07yzu HqytYdarxhSRIup3TAlrmmwRSLjI/z5JcQ/2IlrbPkrjR4VOoV/B1C/kMFWdmR6/byei 53p/tJMiIE8EWnt5k5ERU0Fd+KdWqFmVyDzE68eD8phS/meubPInL04qKLcCWkUnaI2+ I1gA== Received: by 10.152.111.166 with SMTP id ij6mr1678126lab.47.1355330251738; Wed, 12 Dec 2012 08:37:31 -0800 (PST) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.112.149.225 with HTTP; Wed, 12 Dec 2012 08:37:00 -0800 (PST) In-Reply-To: <201212121545.qBCFj4Hl086444@svn.freebsd.org> References: <201212121545.qBCFj4Hl086444@svn.freebsd.org> From: Eitan Adler Date: Wed, 12 Dec 2012 11:37:00 -0500 X-Google-Sender-Auth: 5W4TbFRrUr37T9YCQKiT9BaRPRM Message-ID: Subject: Re: svn commit: r244154 - head/bin/ps To: Pawel Jakub Dawidek Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQmsBp9bJKV/WDZvBn/XojM80J9VfJ7q90f0KEFz42qgD5xn9vdlvE+qbdadIsJmcDYpXUK9 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 12 Dec 2012 16:37:33 -0000 On 12 December 2012 10:45, Pawel Jakub Dawidek wrote: > + if (sysctlbyname("kern.pid_max", &pid_max, &intsize, NULL, 0) < 0) { > + warn("unable to read kern.pid_max"); Silly question, when could this fail and not be fatal? > + pid_max = 99999; Why not use PID_MAX from sys/proc.h? -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-head@FreeBSD.ORG Wed Dec 12 16:42:31 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C7690F9E; Wed, 12 Dec 2012 16:42:31 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (garage.dawidek.net [91.121.88.72]) by mx1.freebsd.org (Postfix) with ESMTP id C59E88FC17; Wed, 12 Dec 2012 16:42:30 +0000 (UTC) Received: from localhost (58.wheelsystems.com [83.12.187.58]) by mail.dawidek.net (Postfix) with ESMTPSA id DAAEFC0; Wed, 12 Dec 2012 17:40:27 +0100 (CET) Date: Wed, 12 Dec 2012 17:44:04 +0100 From: Pawel Jakub Dawidek To: Eitan Adler Subject: Re: svn commit: r244154 - head/bin/ps Message-ID: <20121212164403.GE1381@garage.freebsd.pl> References: <201212121545.qBCFj4Hl086444@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="84ND8YJRMFlzkrP4" Content-Disposition: inline In-Reply-To: X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 12 Dec 2012 16:42:31 -0000 --84ND8YJRMFlzkrP4 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Dec 12, 2012 at 11:37:00AM -0500, Eitan Adler wrote: > On 12 December 2012 10:45, Pawel Jakub Dawidek wrote: >=20 > > + if (sysctlbyname("kern.pid_max", &pid_max, &intsize, NULL, 0) <= 0) { > > + warn("unable to read kern.pid_max"); >=20 > Silly question, when could this fail and not be fatal? It isn't fatal, we can easly make some assumptions instead of turning ps(1) unusable. Currently it will be hard to make it fail, which doesn't mean we shouldn't handle this case. Some day it might fail for some reason (someone changed sysctl name?). > > + pid_max =3D 99999; >=20 > Why not use PID_MAX from sys/proc.h? Because we are in userland and PID_MAX is only defined for the kernel. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --84ND8YJRMFlzkrP4 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlDItFMACgkQForvXbEpPzTPzQCgx1koy5dhIl3zhl6y6lfH7i5w Jt8AoOVpPZEYYTwn8bZKqTit8pv3F9jg =spSU -----END PGP SIGNATURE----- --84ND8YJRMFlzkrP4-- From owner-svn-src-head@FreeBSD.ORG Wed Dec 12 16:59:08 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5389290E; Wed, 12 Dec 2012 16:59:08 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 382768FC15; Wed, 12 Dec 2012 16:59:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBCGx8XL000364; Wed, 12 Dec 2012 16:59:08 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBCGx8OF000363; Wed, 12 Dec 2012 16:59:08 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201212121659.qBCGx8OF000363@svn.freebsd.org> From: Steven Hartland Date: Wed, 12 Dec 2012 16:59:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244156 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 12 Dec 2012 16:59:08 -0000 Author: smh Date: Wed Dec 12 16:59:07 2012 New Revision: 244156 URL: http://svnweb.freebsd.org/changeset/base/244156 Log: Add myself as a new src committer Approved by: pjd (mentor) Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Wed Dec 12 16:14:14 2012 (r244155) +++ head/share/misc/committers-src.dot Wed Dec 12 16:59:07 2012 (r244156) @@ -249,6 +249,7 @@ sephe [label="Sepherosa Ziehau\nsephe@Fr sepotvin [label="Stephane E. Potvin\nsepotvin@FreeBSD.org\n2007/02/15"] simon [label="Simon L. Nielsen\nsimon@FreeBSD.org\n2006/03/07"] sjg [label="Simon J. Gerraty\nsjg@FreeBSD.org\n2012/10/23"] +smh [label="Steven Hartland\smh@FreeBSD.org\n2012/11/12"] sobomax [label="Maxim Sobolev\nsobomax@FreeBSD.org\n2001/07/25"] sos [label="Soren Schmidt\nsos@FreeBSD.org\n????/??/??"] sson [label="Stacey Son\nsson@FreeBSD.org\n2008/07/08"] @@ -307,6 +308,7 @@ anholt -> jkim avg -> art avg -> pluknet +avg -> smh benno -> grehan @@ -555,6 +557,7 @@ philip -> uqs pjd -> kib pjd -> lulf +pjd -> smh pjd -> trociny rgrimes -> markm From owner-svn-src-head@FreeBSD.ORG Wed Dec 12 17:06:24 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0DA609E; Wed, 12 Dec 2012 17:06:24 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-we0-f182.google.com (mail-we0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id E84E08FC12; Wed, 12 Dec 2012 17:06:22 +0000 (UTC) Received: by mail-we0-f182.google.com with SMTP id u54so418831wey.13 for ; Wed, 12 Dec 2012 09:06:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=DAhzWk/fjvbloefMjql2Ti8WiDIoJV+ieMomQOcBr8U=; b=Kd4gZT7TjTQ9641DmYl1uGs9N6cdKwP56bBjLw5uWuHxCkveZ3rEp7GI4BG/1JoEoG 5CE6QWW4WvYwzKbYQyMhj1xjrq+p8YIUnzoZYuGvKGOm+ly/eSAppB7rlXTDmCgQots9 vKwhJ2rNuvC6XmK0zsO2Ue+Jmbx9DxrTJvaIeXZAMVR1WBiYWyrg2aQPrI1YhD2u55UK ItxobgJJYgIhV9C4u+S2N1CgsqyTsvKb3a+3yWI1yFA3bufgnVIIGzzDdiodGAbQ+niD NOjOaGxtwFiZ4vEyQQfc37b0VO86VxnbvtXEeNjlUJxTOkt67KEbXRrT88HqF8hcKVTS WSyg== MIME-Version: 1.0 Received: by 10.180.104.69 with SMTP id gc5mr24094269wib.13.1355331982184; Wed, 12 Dec 2012 09:06:22 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.217.57.9 with HTTP; Wed, 12 Dec 2012 09:06:22 -0800 (PST) In-Reply-To: <201212121046.43706.jhb@freebsd.org> References: <201212110708.qBB78EWx025288@svn.freebsd.org> <201212121046.43706.jhb@freebsd.org> Date: Wed, 12 Dec 2012 09:06:22 -0800 X-Google-Sender-Auth: uJqPpGQklYocA9GEPmvBMd8ljMc Message-ID: Subject: Re: svn commit: r244112 - head/sys/kern From: Adrian Chadd To: John Baldwin Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Alfred Perlstein , src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 12 Dec 2012 17:06:24 -0000 kassert()s are already optional. Ie, you can choose to not compile them in. So the __dead2() code path bit for doing KASSERT() -> kassert_panic() at compile time isn't a problem. The problem is where you do panic() -> kassert_panic() (eg in the Witness code) which is what Alfred discovered shortly after doing up his initial patch. Anything which is a KASSERT() can and should be treated as a run-time warning just as much as a run-time "crash here so I can figure out what broke." Having the warning in a production box is going to be helpful for developers. Adrian On 12 December 2012 07:46, John Baldwin wrote: > On Tuesday, December 11, 2012 2:08:14 am Alfred Perlstein wrote: >> Author: alfred >> Date: Tue Dec 11 07:08:14 2012 >> New Revision: 244112 >> URL: http://svnweb.freebsd.org/changeset/base/244112 >> >> Log: >> Cleanup more of the kassert_panic. >> >> fix compile warnings on !amd64 and NULL derefs that would happen >> if kassert_panic() would return. > > This is one reason why having kassert not panic is such a bad idea. There are > tons of places where the compiler knows that panic() is __dead2, and there is > no cleanup code to handle what happens when an invariant is violated. This is > not safe to run in the field unless your customers do not care about their > data. If you are interested in doing regression tests, I am using a very > different approach for some locking regression tests I am working on in p4 > that allow you to use a wrapper around setjmp/longjmp to "catch" panics > somewhat like exception handling in C++/Java (though much cruder). However, > evne that is only intended for testing, not for production cases where > production data is at stake. > > -- > John Baldwin From owner-svn-src-head@FreeBSD.ORG Wed Dec 12 17:41:22 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8F616C9C; Wed, 12 Dec 2012 17:41:22 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7360A8FC13; Wed, 12 Dec 2012 17:41:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBCHfM6N008490; Wed, 12 Dec 2012 17:41:22 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBCHfM6Q008489; Wed, 12 Dec 2012 17:41:22 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201212121741.qBCHfM6Q008489@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 12 Dec 2012 17:41:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244157 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 12 Dec 2012 17:41:22 -0000 Author: glebius Date: Wed Dec 12 17:41:21 2012 New Revision: 244157 URL: http://svnweb.freebsd.org/changeset/base/244157 Log: Fix a crash in tcp_input(), that happens when mbuf has a fwd_tag on it, but later after processing and freeing the tag, we need to jump back again to the findpcb label. Since the fwd_tag pointer wasn't NULL we tried to process and free the tag for second time. Reported & tested by: Pawel Tyll MFC after: 3 days Modified: head/sys/netinet/tcp_input.c Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Wed Dec 12 16:59:07 2012 (r244156) +++ head/sys/netinet/tcp_input.c Wed Dec 12 17:41:21 2012 (r244157) @@ -810,6 +810,7 @@ findpcb: /* Remove the tag from the packet. We don't need it anymore. */ m_tag_delete(m, fwd_tag); m->m_flags &= ~M_IP_NEXTHOP; + fwd_tag = NULL; } else if (isipv6) { inp = in6_pcblookup_mbuf(&V_tcbinfo, &ip6->ip6_src, th->th_sport, &ip6->ip6_dst, th->th_dport, @@ -847,6 +848,7 @@ findpcb: /* Remove the tag from the packet. We don't need it anymore. */ m_tag_delete(m, fwd_tag); m->m_flags &= ~M_IP_NEXTHOP; + fwd_tag = NULL; } else inp = in_pcblookup_mbuf(&V_tcbinfo, ip->ip_src, th->th_sport, ip->ip_dst, th->th_dport, From owner-svn-src-head@FreeBSD.ORG Wed Dec 12 17:49:03 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 46942FFF; Wed, 12 Dec 2012 17:49:03 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 26A028FC13; Wed, 12 Dec 2012 17:49:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBCHn3nJ009920; Wed, 12 Dec 2012 17:49:03 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBCHn24Y009912; Wed, 12 Dec 2012 17:49:02 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201212121749.qBCHn24Y009912@svn.freebsd.org> From: Devin Teske Date: Wed, 12 Dec 2012 17:49:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244158 - head/sys/boot/forth X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 12 Dec 2012 17:49:03 -0000 Author: dteske Date: Wed Dec 12 17:49:01 2012 New Revision: 244158 URL: http://svnweb.freebsd.org/changeset/base/244158 Log: Fix a regression caused by SVN r222417. Prior to r222417, setting `password' in loader.conf(5) did not prevent boot but instead only prevented changes to boot options by prompting for password if autoboot failed or the user interrupted the countdown sequence. After r222417 the same machine with `password' set in loader.conf(5) would no longer boot without _always_ entering the password. This patch restores the old (8.x and older) functionality for password in loader.conf(5) while adding a new bootlock_password feature to replace the edge-case should anybody desire the regressed functionality (HINT: great for PXE servers and/or private distributions). loader.conf(5) was updated to be more clear with-respect to password setting (previous text was misleading). Documentation (loader.conf(5) and check-password.4th(8)) has been updated to include notes on the new bootlock_password setting. Special thanks to Alex Verbod for bringing this to my attention and helping to refine the loader.conf(5) text. PR: conf/170110 Submitted by: Vitaly Zakharov Reviewed by: Alexander Verbod Modified: head/sys/boot/forth/beastie.4th.8 head/sys/boot/forth/check-password.4th head/sys/boot/forth/check-password.4th.8 head/sys/boot/forth/loader.4th.8 head/sys/boot/forth/loader.conf.5 head/sys/boot/forth/menu.4th.8 Modified: head/sys/boot/forth/beastie.4th.8 ============================================================================== --- head/sys/boot/forth/beastie.4th.8 Wed Dec 12 17:41:21 2012 (r244157) +++ head/sys/boot/forth/beastie.4th.8 Wed Dec 12 17:49:01 2012 (r244158) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2011 Devin Teske +.\" Copyright (c) 2011-2012 Devin Teske .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -94,8 +94,9 @@ The variable can be configured in .Xr loader.conf 5 to the number of seconds you would like to delay loading the boot menu. -During the delay the user can press Ctrl-C to fall back to autoboot or ENTER -to proceed. +During the delay the user can press Ctrl-C to fall back to +.Ic autoboot +or ENTER to proceed. The default behavior is to not delay. .El .Pp Modified: head/sys/boot/forth/check-password.4th ============================================================================== --- head/sys/boot/forth/check-password.4th Wed Dec 12 17:41:21 2012 (r244157) +++ head/sys/boot/forth/check-password.4th Wed Dec 12 17:49:01 2012 (r244158) @@ -1,4 +1,4 @@ -\ Copyright (c) 2006-2011 Devin Teske +\ Copyright (c) 2006-2012 Devin Teske \ All rights reserved. \ \ Redistribution and use in source and binary forms, with or without @@ -74,7 +74,7 @@ variable readlen \ input length again ; -: read ( -- String prompt ) +: read ( String prompt -- ) 0 25 at-xy \ Move the cursor to the bottom-left dup 1+ read-start ! \ Store X offset after the prompt @@ -134,23 +134,37 @@ variable readlen \ input length : check-password ( -- ) - \ Exit if a password was not set - s" password" getenv dup -1 = if - drop exit + \ Do not allow the user to proceed beyond this point if a boot-lock + \ password has been set (preventing even boot from proceeding) + s" bootlock_password" getenv dup -1 <> if + begin + s" Boot Password: " read ( prompt -- ) + 2dup readval readlen @ compare 0<> + while + 3000 ms ." loader: incorrect password" 10 emit + repeat + 2drop ( c-addr/u ) + else + drop ( -1 ) \ getenv cruft then - begin \ Loop as long as it takes to get the right password + \ Exit if a password was not set + s" password" getenv -1 = if exit else drop then + + \ We should prevent the user from visiting the menu or dropping to the + \ interactive loader(8) prompt, but still allow the machine to boot... - s" Password: " \ Output a prompt for a password - read \ Read the user's input until Enter + 0 autoboot + \ Only reached if autoboot fails for any reason (including if/when + \ the user aborts/escapes the countdown sequence leading to boot). + + s" password" getenv + begin + s" Password: " read ( prompt -- ) 2dup readval readlen @ compare 0= if 2drop exit \ Correct password then - - \ Bad Password - 3000 ms - ." loader: incorrect password" 10 emit - - again \ Not the right password; repeat + 3000 ms ." loader: incorrect password" 10 emit + again ; Modified: head/sys/boot/forth/check-password.4th.8 ============================================================================== --- head/sys/boot/forth/check-password.4th.8 Wed Dec 12 17:41:21 2012 (r244157) +++ head/sys/boot/forth/check-password.4th.8 Wed Dec 12 17:49:01 2012 (r244158) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2011 Devin Teske +.\" Copyright (c) 2011-2012 Devin Teske .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 18, 2011 +.Dd December 10, 2012 .Dt CHECK-PASSWORD.4TH 8 .Os .Sh NAME @@ -33,7 +33,8 @@ .Sh DESCRIPTION The file that goes by the name of .Nm -is a set of commands designed to prevent booting without the proper password. +is a set of commands designed to either prevent booting or prevent modification +of boot options without an appropriately configured password. The commands of .Nm by themselves are not enough for most uses. @@ -57,30 +58,36 @@ The commands provided by it are: .Pp .Bl -tag -width disable-module_module -compact -offset indent .It Ic check-password -Once called, the user cannot continue until the correct password is entered. -If the user enters the correct password the function returns. +Dual-purpose function that can either protect the interactive boot menu or +prevent boot without password (separately). .Pp -The password that is required is configured by setting the -.Ic password -variable in -.Xr loader.conf 5 . -.Pp -Subsequent calls after a successful password -has been entered will not cause reprompting -\(em the function will silently return. +First checks +.Va bootlock_password +and if-set, the user cannot continue until the correct password is entered. +.Pp +Next checks +.Va password +and if-set, tries to +.Ic autoboot +and only prompts for password on failure or user-interrupt. +See +.Xr loader.conf 5 +for additional information. .El .Pp The environment variables that effect its behavior are: -.Bl -tag -width bootfile -offset indent +.Bl -tag -width bootlock_password -offset indent +.It Va bootlock_password +Sets the bootlock password (up to 16 characters long) that is required by +.Ic check-password +to be entered before the system is allowed to boot. .It Va password Sets the password (up to 16 characters long) that is required by .Ic check-password -to be entered before the system is allowed to boot. If unset (default) or NULL, -.Ic check-password -will silently abort. +before the user is allowed to visit the boot menu. .El .Sh FILES -.Bl -tag -width /boot/loader.4th -compact +.Bl -tag -width /boot/check-password.4th -compact .It Pa /boot/loader The .Xr loader 8 . @@ -101,11 +108,20 @@ check-password .Ed .Pp Set a password in -.Xr loader.conf 5 : +.Xr loader.conf 5 +to prevent modification of boot options: .Pp .Bd -literal -offset indent -compact password="abc123" .Ed +.Pp +Set a password in +.Xr loader.conf 5 +to prevent booting without password: +.Pp +.Bd -literal -offset indent -compact +bootlock_password="boot" +.Ed .Sh SEE ALSO .Xr loader.conf 5 , .Xr loader 8 , Modified: head/sys/boot/forth/loader.4th.8 ============================================================================== --- head/sys/boot/forth/loader.4th.8 Wed Dec 12 17:41:21 2012 (r244157) +++ head/sys/boot/forth/loader.4th.8 Wed Dec 12 17:49:01 2012 (r244158) @@ -99,7 +99,7 @@ This is the command used in the default .Pa /boot/loader.rc file, and it uses the -.Pa autoboot +.Ic autoboot command (see .Xr loader 8 ) , so it can be stopped for further interaction with Modified: head/sys/boot/forth/loader.conf.5 ============================================================================== --- head/sys/boot/forth/loader.conf.5 Wed Dec 12 17:41:21 2012 (r244157) +++ head/sys/boot/forth/loader.conf.5 Wed Dec 12 17:49:01 2012 (r244158) @@ -23,7 +23,7 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd July 20, 2011 +.Dd December 10, 2012 .Dt LOADER.CONF 5 .Os .Sh NAME @@ -113,8 +113,23 @@ that contains a kernel. .It Ar kernel_options Flags to be passed to the kernel. .It Ar password +Protect boot menu with a password without interrupting +.Ic autoboot +process. +The password should be in clear text format. +If a password is set, boot menu will not appear until any key is pressed during +countdown period specified by +.Va autoboot_delay +variable or +.Ic autoboot +process fails. +In both cases user should provide specified password to be able to access boot +menu. +.It Ar bootlock_password Provides a password to be required by check-password before execution is allowed to continue. +The password should be in clear text format. +If a password is set, the user must provide specified password to boot. .It Ar verbose_loading If set to .Dq YES , Modified: head/sys/boot/forth/menu.4th.8 ============================================================================== --- head/sys/boot/forth/menu.4th.8 Wed Dec 12 17:41:21 2012 (r244157) +++ head/sys/boot/forth/menu.4th.8 Wed Dec 12 17:49:01 2012 (r244158) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2011 Devin Teske +.\" Copyright (c) 2011-2012 Devin Teske .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -108,8 +108,9 @@ will wait for user input and never execu If set to .Dq Li -1 , .Ic menu-display -will boot immediately, preventing both interruption of the autoboot process and -escaping to the loader prompt. +will boot immediately, preventing both interruption of the +.Ic autoboot +process and escaping to the loader prompt. Default is .Dq Li 10 . See From owner-svn-src-head@FreeBSD.ORG Wed Dec 12 18:47:25 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C949765A; Wed, 12 Dec 2012 18:47:25 +0000 (UTC) (envelope-from bright@mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 7E6AF8FC0A; Wed, 12 Dec 2012 18:47:25 +0000 (UTC) Received: from Alfreds-MacBook-Pro-6.local (c-67-180-208-218.hsd1.ca.comcast.net [67.180.208.218]) by elvis.mu.org (Postfix) with ESMTPSA id 3EEF51A3CC0; Wed, 12 Dec 2012 10:47:25 -0800 (PST) Message-ID: <50C8D13C.6070107@mu.org> Date: Wed, 12 Dec 2012 10:47:24 -0800 From: Alfred Perlstein User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: John Baldwin Subject: Re: svn commit: r244112 - head/sys/kern References: <201212110708.qBB78EWx025288@svn.freebsd.org> <201212121046.43706.jhb@freebsd.org> In-Reply-To: <201212121046.43706.jhb@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, Alfred Perlstein , src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 12 Dec 2012 18:47:25 -0000 to all: I am trying to take this offline with John so that we can discuss the reasoning behind the change and come to an agreement on how it is implemented, or if not to remove it. -Alfred On 12/12/12 7:46 AM, John Baldwin wrote: > On Tuesday, December 11, 2012 2:08:14 am Alfred Perlstein wrote: >> Author: alfred >> Date: Tue Dec 11 07:08:14 2012 >> New Revision: 244112 >> URL: http://svnweb.freebsd.org/changeset/base/244112 >> >> Log: >> Cleanup more of the kassert_panic. >> >> fix compile warnings on !amd64 and NULL derefs that would happen >> if kassert_panic() would return. > This is one reason why having kassert not panic is such a bad idea. There are > tons of places where the compiler knows that panic() is __dead2, and there is > no cleanup code to handle what happens when an invariant is violated. This is > not safe to run in the field unless your customers do not care about their > data. If you are interested in doing regression tests, I am using a very > different approach for some locking regression tests I am working on in p4 > that allow you to use a wrapper around setjmp/longjmp to "catch" panics > somewhat like exception handling in C++/Java (though much cruder). However, > evne that is only intended for testing, not for production cases where > production data is at stake. > From owner-svn-src-head@FreeBSD.ORG Wed Dec 12 21:07:05 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7693782E; Wed, 12 Dec 2012 21:07:05 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id CEB198FC0C; Wed, 12 Dec 2012 21:07:04 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.5/8.14.5) with ESMTP id qBCL6rsU047192; Wed, 12 Dec 2012 23:06:53 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.7.1 kib.kiev.ua qBCL6rsU047192 Received: (from kostik@localhost) by tom.home (8.14.5/8.14.5/Submit) id qBCL6rKk047191; Wed, 12 Dec 2012 23:06:53 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 12 Dec 2012 23:06:52 +0200 From: Konstantin Belousov To: Pawel Jakub Dawidek Subject: Re: svn commit: r244154 - head/bin/ps Message-ID: <20121212210652.GO3013@kib.kiev.ua> References: <201212121545.qBCFj4Hl086444@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="2suWxhRNFFJI65F9" Content-Disposition: inline In-Reply-To: <201212121545.qBCFj4Hl086444@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 12 Dec 2012 21:07:05 -0000 --2suWxhRNFFJI65F9 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Dec 12, 2012 at 03:45:04PM +0000, Pawel Jakub Dawidek wrote: > Author: pjd > Date: Wed Dec 12 15:45:03 2012 > New Revision: 244154 > URL: http://svnweb.freebsd.org/changeset/base/244154 >=20 > Log: > Use kern.max_pid sysctl to obtain maximum PID number instead of using l= ocal > define. It is pid_max, not max_pid. But the change is wrong. The kern.pid_max only limits newly allocated pids, it does not magically moves existing pids, which are out of range, to the limited region. See the corresponding commit log for the description. It was added to make it easier to run FreeBSD 1.x binaries on the modern kernels. --2suWxhRNFFJI65F9 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQIcBAEBAgAGBQJQyPHsAAoJEJDCuSvBvK1B+UsP/1f1QyH8x9QbF4XiwZp5G1nh ftyQ98ufISWu9+oorG2eQvWKXh5nue19oOneNNcKmxEk28tdZBJ1PO79zstqmHBq 0byXnn+iVM98dQsWkem7YO4fVfROm3gHg/Mkf0tiKJQKJLJKyqW/mIY8k3G/WEcg D9ccDOhep++fdLbxY4EA0h6AasTa23iJ3XolKKr1QQ6a+NboRxQhePtg7y5rGbwe 5rxoU6u51h6TUHEzM3aafzlFhBE/iH8SB3wJCIL+s9RlibknM2LccknFYQrAS+Ib Jrgk7hh/FeEX53zWPp/xVZI8nta4NWqHbIYGx/L3uEcgJzF4dAtz5ho7x8Wd77QS y8uYLL9VeKnehGoMwNyZltfvUoHlDU7eCIz1bxHni7WutHJIVhm/y/Ifj+5BwDYX xxe4fm5l/5VgH3nIaVy3hQVUzD32XezzN1YEODkbq9LfLzP+PWzgEEM60kzvL9Fb Wj/SQO3ssGAcuBj1cqkYJijwC0U7aZqffpxg1c0SQLQ9UDRUBhkIiEvpGRh5Xn2/ G7YtqPKxRjjSI0N71p4vEhmWomc7xAqSRFthPLeCKWkr274HoyCFraYK8s5ikkm+ 95KsanLbIiul2zi3xnOk3AMHsmLAnHWWvbmxF62I/rQyUGdBAhBAQtXO6F/VKZpP x7uVF6Pw0PmM5BrZWhQd =zrG7 -----END PGP SIGNATURE----- --2suWxhRNFFJI65F9-- From owner-svn-src-head@FreeBSD.ORG Wed Dec 12 22:01:11 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 645497A2; Wed, 12 Dec 2012 22:01:11 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 436DC8FC14; Wed, 12 Dec 2012 22:01:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBCM1Bi4059807; Wed, 12 Dec 2012 22:01:11 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBCM1Aeh059801; Wed, 12 Dec 2012 22:01:10 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201212122201.qBCM1Aeh059801@svn.freebsd.org> From: Jilles Tjoelker Date: Wed, 12 Dec 2012 22:01:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244162 - in head: bin/sh tools/regression/bin/sh/errors X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 12 Dec 2012 22:01:11 -0000 Author: jilles Date: Wed Dec 12 22:01:10 2012 New Revision: 244162 URL: http://svnweb.freebsd.org/changeset/base/244162 Log: sh: Detect and flag write errors on stdout in builtins. If there is a write error on stdout, a message will be printed (to stderr) and the exit status will be changed to 2 if it would have been 0 or 1. PR: bin/158206 Added: head/tools/regression/bin/sh/errors/write-error1.0 (contents, props changed) Modified: head/bin/sh/eval.c head/bin/sh/output.c head/bin/sh/output.h Modified: head/bin/sh/eval.c ============================================================================== --- head/bin/sh/eval.c Wed Dec 12 20:55:30 2012 (r244161) +++ head/bin/sh/eval.c Wed Dec 12 22:01:10 2012 (r244162) @@ -1070,6 +1070,7 @@ evalcommand(union node *cmd, int flags, } handler = &jmploc; redirect(cmd->ncmd.redirect, mode); + outclearerror(out1); /* * If there is no command word, redirection errors should * not be fatal but assignment errors should. @@ -1085,6 +1086,11 @@ evalcommand(union node *cmd, int flags, builtin_flags = flags; exitstatus = (*builtinfunc[cmdentry.u.index])(argc, argv); flushall(); + if (outiserror(out1)) { + warning("write error on stdout"); + if (exitstatus == 0 || exitstatus == 1) + exitstatus = 2; + } cmddone: if (argc > 0) bltinunsetlocale(); Modified: head/bin/sh/output.c ============================================================================== --- head/bin/sh/output.c Wed Dec 12 20:55:30 2012 (r244161) +++ head/bin/sh/output.c Wed Dec 12 22:01:10 2012 (r244162) @@ -239,6 +239,20 @@ freestdout(void) } +int +outiserror(struct output *file) +{ + return (file->flags & OUTPUT_ERR); +} + + +void +outclearerror(struct output *file) +{ + file->flags &= ~OUTPUT_ERR; +} + + void outfmt(struct output *file, const char *fmt, ...) { Modified: head/bin/sh/output.h ============================================================================== --- head/bin/sh/output.h Wed Dec 12 20:55:30 2012 (r244161) +++ head/bin/sh/output.h Wed Dec 12 22:01:10 2012 (r244162) @@ -66,6 +66,8 @@ void emptyoutbuf(struct output *); void flushall(void); void flushout(struct output *); void freestdout(void); +int outiserror(struct output *); +void outclearerror(struct output *); void outfmt(struct output *, const char *, ...) __printflike(2, 3); void out1fmt(const char *, ...) __printflike(1, 2); void out2fmt_flush(const char *, ...) __printflike(1, 2); Added: head/tools/regression/bin/sh/errors/write-error1.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/errors/write-error1.0 Wed Dec 12 22:01:10 2012 (r244162) @@ -0,0 +1,3 @@ +# $FreeBSD$ + +! echo >&- 2>/dev/null From owner-svn-src-head@FreeBSD.ORG Wed Dec 12 22:11:20 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3458ABF9; Wed, 12 Dec 2012 22:11:20 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 021088FC14; Wed, 12 Dec 2012 22:11:20 +0000 (UTC) Received: from pakbsde14.localnet (unknown [38.105.238.108]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 60E24B91E; Wed, 12 Dec 2012 17:11:19 -0500 (EST) From: John Baldwin To: Adrian Chadd Subject: Re: svn commit: r244112 - head/sys/kern Date: Wed, 12 Dec 2012 16:58:48 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p22; KDE/4.5.5; amd64; ; ) References: <201212110708.qBB78EWx025288@svn.freebsd.org> <201212121046.43706.jhb@freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201212121658.49048.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 12 Dec 2012 17:11:19 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Alfred Perlstein , src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 12 Dec 2012 22:11:20 -0000 On Wednesday, December 12, 2012 12:06:22 pm Adrian Chadd wrote: > kassert()s are already optional. Ie, you can choose to not compile them in. > > So the __dead2() code path bit for doing KASSERT() -> kassert_panic() > at compile time isn't a problem. > > The problem is where you do panic() -> kassert_panic() (eg in the > Witness code) which is what Alfred discovered shortly after doing up > his initial patch. > > Anything which is a KASSERT() can and should be treated as a run-time > warning just as much as a run-time "crash here so I can figure out > what broke." Having the warning in a production box is going to be > helpful for developers. Hmmm, I'll have to chew on this. Adding lots of returns because panic's are now no longer dead2 was why I ended up backing the removal of the RESTARTABLE_PANICS option. I'm inclined to say that it's really bad to let a kernel known to be in a bad state continue, and that if someone has asked for the slowdown of all the extra checks INVARIANTS adds, they might as well minimize the chance for data corruption by having the kernel stop as soon as a problem is detected. (Note that the primary reason I know for people not running with INVARIANTS enabled is not that they don't want panics, but that they don't want the performance hit.) -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Wed Dec 12 22:15:26 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3700CF32; Wed, 12 Dec 2012 22:15:26 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-we0-f182.google.com (mail-we0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id C83198FC0A; Wed, 12 Dec 2012 22:15:24 +0000 (UTC) Received: by mail-we0-f182.google.com with SMTP id u54so567903wey.13 for ; Wed, 12 Dec 2012 14:15:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=yyijKWTqY9HV2HPXTuWRcDOzCeE5SiZxLBLqf52XBYs=; b=lY3jTF1QE86nEZunYmsRf0/evGIqJZo+XKbZlmuPG9zF+QVEfdnEMtgPSkvjpI1ibF nSXEyshFQ/haK9ltPwrw891RBCuqS45mPYexWGmjz0/PrmyKZVtmeZ6mYEtoVVzRzGtt SH0GX37SMgJ5p9kFrrI+CDijuW8n4OXaoWvW3EiNiaVKXhWVeZnH3WdKw3Yc1yS4xw4j MGdQ8Sk796ih1MCLEB7135O48ZabXGI68m4W1yjRhbuLd7Hbg7qbVwxhyrkxk11nwE9o F6ZtpTT8RaBz6/nohTy5kn6MwbntG6mtpDDJ185npirrqbAyoQfgUpPz9ydjwCv1wA/z Kkww== MIME-Version: 1.0 Received: by 10.180.24.4 with SMTP id q4mr25293854wif.19.1355350523804; Wed, 12 Dec 2012 14:15:23 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.217.57.9 with HTTP; Wed, 12 Dec 2012 14:15:23 -0800 (PST) In-Reply-To: <201212121658.49048.jhb@freebsd.org> References: <201212110708.qBB78EWx025288@svn.freebsd.org> <201212121046.43706.jhb@freebsd.org> <201212121658.49048.jhb@freebsd.org> Date: Wed, 12 Dec 2012 14:15:23 -0800 X-Google-Sender-Auth: 2JhGvDMng89EICCqRRmX8fv5n38 Message-ID: Subject: Re: svn commit: r244112 - head/sys/kern From: Adrian Chadd To: John Baldwin Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Alfred Perlstein , src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 12 Dec 2012 22:15:26 -0000 On 12 December 2012 13:58, John Baldwin wrote: >> Anything which is a KASSERT() can and should be treated as a run-time >> warning just as much as a run-time "crash here so I can figure out >> what broke." Having the warning in a production box is going to be >> helpful for developers. > > Hmmm, I'll have to chew on this. Adding lots of returns because panic's are > now no longer dead2 was why I ended up backing the removal of the > RESTARTABLE_PANICS option. Yes, for panic() as it stands it should just do that - panic. We should likely go over the panic()s and replace them with kassert+handle gracefully wherever its appropriate (there are a few places in net80211 for example that I'd like to do this.) But you're right. For panic(), the rest of the code likely doesn't handle or continue gracefully, so we shouldn't automatically disable them. But this is about KASSERT(). Alfred mixed this in with witness "non panic" mode, which I think is what's confusing people. > I'm inclined to say that it's really bad to let a kernel known to be in a > bad state continue, and that if someone has asked for the slowdown of all > the extra checks INVARIANTS adds, they might as well minimize the chance for > data corruption by having the kernel stop as soon as a problem is detected. Right, but that should be an option. It'd be nice if we were able to dump out some system state when an invariant condition or witness issue was hit (like a mini scripted ddb dump - say, log things like the current lock state) but then continue. > (Note that the primary reason I know for people not running with INVARIANTS > enabled is not that they don't want panics, but that they don't want the > performance hit.) Well, it would be nice to be able to enable invariants on some shipping "debug" versions of images in order to gather more data without crashing the kernel. Adrian From owner-svn-src-head@FreeBSD.ORG Wed Dec 12 22:25:32 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7406758E; Wed, 12 Dec 2012 22:25:32 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 56B0F8FC16; Wed, 12 Dec 2012 22:25:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBCMPWg5065218; Wed, 12 Dec 2012 22:25:32 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBCMPWwr065217; Wed, 12 Dec 2012 22:25:32 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201212122225.qBCMPWwr065217@svn.freebsd.org> From: Jim Harris Date: Wed, 12 Dec 2012 22:25:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244163 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 12 Dec 2012 22:25:32 -0000 Author: jimharris Date: Wed Dec 12 22:25:31 2012 New Revision: 244163 URL: http://svnweb.freebsd.org/changeset/base/244163 Log: Add my ex-mentors. Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Wed Dec 12 22:01:10 2012 (r244162) +++ head/share/misc/committers-src.dot Wed Dec 12 22:25:31 2012 (r244163) @@ -241,6 +241,7 @@ rstone [label="Ryan Stone\nrstone@FreeBS ru [label="Ruslan Ermilov\nru@FreeBSD.org\n1999/05/27"] rwatson [label="Robert N. M. Watson\nrwatson@FreeBSD.org\n1999/12/16"] sam [label="Sam Leffler\nsam@FreeBSD.org\n2002/07/02"] +sbruno [label="Sean Bruno\nsbruno@FreeBSD.org\n????/??/??"] sanpei [label="MIHIRA Sanpei Yoshiro\nsanpei@FreeBSD.org\n2000/06/19"] scf [label="Sean C. Farley\nscf@FreeBSD.org\n2007/06/24"] schweikh [label="Jens Schweikhardt\nschweikh@FreeBSD.org\n2001/04/06"] @@ -602,8 +603,11 @@ sam -> andre sam -> benjsc sam -> sephe +sbruno -> jimharris + schweikh -> dds +scottl -> jimharris scottl -> pjd scottl -> sah scottl -> yongari From owner-svn-src-head@FreeBSD.ORG Wed Dec 12 22:27:05 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5EA2A7F1; Wed, 12 Dec 2012 22:27:05 +0000 (UTC) (envelope-from bright@mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 392BC8FC0C; Wed, 12 Dec 2012 22:27:05 +0000 (UTC) Received: from Alfreds-MacBook-Pro-6.local (c-67-180-208-218.hsd1.ca.comcast.net [67.180.208.218]) by elvis.mu.org (Postfix) with ESMTPSA id BB61B1A3C1B; Wed, 12 Dec 2012 14:27:04 -0800 (PST) Message-ID: <50C904B8.6000502@mu.org> Date: Wed, 12 Dec 2012 14:27:04 -0800 From: Alfred Perlstein User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Adrian Chadd Subject: Re: svn commit: r244112 - head/sys/kern References: <201212110708.qBB78EWx025288@svn.freebsd.org> <201212121046.43706.jhb@freebsd.org> <201212121658.49048.jhb@freebsd.org> In-Reply-To: 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, Alfred Perlstein , src-committers@freebsd.org, John Baldwin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 12 Dec 2012 22:27:05 -0000 On 12/12/12 2:15 PM, Adrian Chadd wrote: > On 12 December 2012 13:58, John Baldwin wrote: > > >> (Note that the primary reason I know for people not running with INVARIANTS >> enabled is not that they don't want panics, but that they don't want the >> performance hit.) > Well, it would be nice to be able to enable invariants on some > shipping "debug" versions of images in order to gather more data > without crashing the kernel. Yes, two of my employers were more of "we want to get more debug metrics, we have the spare cycles, but we can't deal with superfluous panics". It also allows us "non-architects" to slip in a debug image when we have spare cpu without getting yelled at for "crashing the $foo". -Alfred From owner-svn-src-head@FreeBSD.ORG Wed Dec 12 22:30:12 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 320BDA9E; Wed, 12 Dec 2012 22:30:12 +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 7DB908FC14; Wed, 12 Dec 2012 22:30:10 +0000 (UTC) Received: from porto.starpoint.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 AAA07250; Thu, 13 Dec 2012 00:30:02 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1TiuoT-000MQv-Sv; Thu, 13 Dec 2012 00:30:01 +0200 Message-ID: <50C90567.8080406@FreeBSD.org> Date: Thu, 13 Dec 2012 00:29:59 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: John Baldwin , Adrian Chadd , Alfred Perlstein Subject: Re: svn commit: r244112 - head/sys/kern References: <201212110708.qBB78EWx025288@svn.freebsd.org> <201212121046.43706.jhb@freebsd.org> <201212121658.49048.jhb@freebsd.org> In-Reply-To: <201212121658.49048.jhb@freebsd.org> X-Enigmail-Version: 1.4.6 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 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 12 Dec 2012 22:30:12 -0000 on 12/12/2012 23:58 John Baldwin said the following: > Hmmm, I'll have to chew on this. Adding lots of returns because panic's are > now no longer dead2 was why I ended up backing the removal of the > RESTARTABLE_PANICS option. > > I'm inclined to say that it's really bad to let a kernel known to be in a > bad state continue, and that if someone has asked for the slowdown of all > the extra checks INVARIANTS adds, they might as well minimize the chance for > data corruption by having the kernel stop as soon as a problem is detected. > > (Note that the primary reason I know for people not running with INVARIANTS > enabled is not that they don't want panics, but that they don't want the > performance hit.) Previously we had two alternatives: - use INVARIANTS and be sure that the kernel is in sane state, that any bugs are caught early, no corruptions / insanity is propagated to the point where valuable data can be hurt; the price is lower (possibly much lower) performance because of all other checks; - do not use INVARIANTS and risk that some error would not be caught early and would cause greater harm; the upside is better performance; So people used (use) INVARIANTS to extensively test any new code/environments, but then prefer to run production systems without INVARIANTS. Now we get a new middle-ground: get both worse performance (because KASSERTs are compiled in) and a risk of harming your data (because KASSERTs no longer panic). The upside: there is no panic! There's just a log message (or etc). and chance to get more log messages because the insanity propagates. And a chance to lose your data (your customer's) - but I've already mentioned this. I am not sure that I like this kind of middle-ground. -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Wed Dec 12 22:33:44 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EEC0BC60; Wed, 12 Dec 2012 22:33:43 +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 48C6C8FC12; Wed, 12 Dec 2012 22:33:42 +0000 (UTC) Received: from porto.starpoint.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 AAA07296; Thu, 13 Dec 2012 00:33:38 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1Tiury-000MRH-7Y; Thu, 13 Dec 2012 00:33:38 +0200 Message-ID: <50C90641.4030000@FreeBSD.org> Date: Thu, 13 Dec 2012 00:33:37 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Alfred Perlstein Subject: Re: svn commit: r244112 - head/sys/kern References: <201212110708.qBB78EWx025288@svn.freebsd.org> <201212121046.43706.jhb@freebsd.org> <201212121658.49048.jhb@freebsd.org> <50C904B8.6000502@mu.org> In-Reply-To: <50C904B8.6000502@mu.org> X-Enigmail-Version: 1.4.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Adrian Chadd , src-committers@FreeBSD.org, John Baldwin , svn-src-all@FreeBSD.org, Alfred Perlstein , svn-src-head@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 12 Dec 2012 22:33:44 -0000 on 13/12/2012 00:27 Alfred Perlstein said the following: > On 12/12/12 2:15 PM, Adrian Chadd wrote: >> On 12 December 2012 13:58, John Baldwin wrote: >> >> >>> (Note that the primary reason I know for people not running with INVARIANTS >>> enabled is not that they don't want panics, but that they don't want the >>> performance hit.) >> Well, it would be nice to be able to enable invariants on some >> shipping "debug" versions of images in order to gather more data >> without crashing the kernel. > Yes, two of my employers were more of "we want to get more debug metrics, we > have the spare cycles, but we can't deal with superfluous panics". > > It also allows us "non-architects" to slip in a debug image when we have spare > cpu without getting yelled at for "crashing the $foo". There is clearly something wrong with this sort of mentality. If you find instances where a developer put panic(9) (or KASSERT or etc) to mean "maybe here is a bug, let's just panic", then let's get those things fixed. But most of assertions in our code that are know to me really mean that a real bug has already occurred, that portions of kernel state are corrupted and there is no going back to a sane state, only going forward to corrupting more and more. -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Wed Dec 12 22:37:35 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6F415E7D; Wed, 12 Dec 2012 22:37:35 +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 AE2408FC0A; Wed, 12 Dec 2012 22:37:33 +0000 (UTC) Received: from porto.starpoint.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 AAA07324; Thu, 13 Dec 2012 00:37:32 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1Tiuvj-000MRZ-Ns; Thu, 13 Dec 2012 00:37:31 +0200 Message-ID: <50C9072A.6040605@FreeBSD.org> Date: Thu, 13 Dec 2012 00:37:30 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Adrian Chadd Subject: Re: svn commit: r244112 - head/sys/kern References: <201212110708.qBB78EWx025288@svn.freebsd.org> <201212121046.43706.jhb@freebsd.org> In-Reply-To: X-Enigmail-Version: 1.4.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, Alfred Perlstein , src-committers@FreeBSD.org, John Baldwin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 12 Dec 2012 22:37:35 -0000 on 12/12/2012 19:06 Adrian Chadd said the following: > kassert()s are already optional. Ie, you can choose to not compile them in. > > So the __dead2() code path bit for doing KASSERT() -> kassert_panic() > at compile time isn't a problem. > > The problem is where you do panic() -> kassert_panic() (eg in the > Witness code) which is what Alfred discovered shortly after doing up > his initial patch. > > Anything which is a KASSERT() can and should be treated as a run-time > warning just as much as a run-time "crash here so I can figure out > what broke." Having the warning in a production box is going to be > helpful for developers. I have a quite different view on purpose and costs of KASSERTs. Specifically referring to r243980 I do not think that "non-fatal asserts" should really exist (or do exist). I wish all this muddying of KASSERT meaning would get reverted. These quite sensitive changes were rushed in, IMO. > On 12 December 2012 07:46, John Baldwin wrote: >> On Tuesday, December 11, 2012 2:08:14 am Alfred Perlstein wrote: >>> Author: alfred >>> Date: Tue Dec 11 07:08:14 2012 >>> New Revision: 244112 >>> URL: http://svnweb.freebsd.org/changeset/base/244112 >>> >>> Log: >>> Cleanup more of the kassert_panic. >>> >>> fix compile warnings on !amd64 and NULL derefs that would happen >>> if kassert_panic() would return. >> >> This is one reason why having kassert not panic is such a bad idea. There are >> tons of places where the compiler knows that panic() is __dead2, and there is >> no cleanup code to handle what happens when an invariant is violated. This is >> not safe to run in the field unless your customers do not care about their >> data. If you are interested in doing regression tests, I am using a very >> different approach for some locking regression tests I am working on in p4 >> that allow you to use a wrapper around setjmp/longjmp to "catch" panics >> somewhat like exception handling in C++/Java (though much cruder). However, >> evne that is only intended for testing, not for production cases where >> production data is at stake. >> >> -- >> John Baldwin -- Andriy Gapon -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Wed Dec 12 22:38:26 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 19E5069; Wed, 12 Dec 2012 22:38:26 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wi0-f170.google.com (mail-wi0-f170.google.com [209.85.212.170]) by mx1.freebsd.org (Postfix) with ESMTP id A6E488FC08; Wed, 12 Dec 2012 22:38:24 +0000 (UTC) Received: by mail-wi0-f170.google.com with SMTP id hq7so3633813wib.1 for ; Wed, 12 Dec 2012 14:38:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=/MfOXlFcUv2fotprf/gWSXH9zuWKhhyH1ywbr+IQe/M=; b=lzppjTdzgSGZ5OXZlqPgMKDU82G8jUAjbAkjCAte2jluL7fAtW9VDqWZN8JlOUEFZ4 ehjT6guFs8yOAqZ4AH7tuH9XsviaLRuBz9zTN3i7kLlCkPIMLtCZ7fzRM2+gq3QiJ0il a4nYDp/lxWrQ693b4Gjl2T+ksVdRUex5mIGUFMnL5MmCL0BOMfOaWvNPCuzD0J1kDWfB iNTV+J8HNAv/xLhNvAuIc2A/EcGj/RUdN9GnKIfn1cje7naSgiJaI7fZWREMXmOJa4R2 pAMCfLXEuXPG4jx9pty0qUMDJHEobwIb4hoQE6htu2pItIQ9Jl+984PyIr1fFL3acaEB 7D8g== MIME-Version: 1.0 Received: by 10.194.179.34 with SMTP id dd2mr4578225wjc.1.1355351903711; Wed, 12 Dec 2012 14:38:23 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.217.57.9 with HTTP; Wed, 12 Dec 2012 14:38:23 -0800 (PST) In-Reply-To: <50C90567.8080406@FreeBSD.org> References: <201212110708.qBB78EWx025288@svn.freebsd.org> <201212121046.43706.jhb@freebsd.org> <201212121658.49048.jhb@freebsd.org> <50C90567.8080406@FreeBSD.org> Date: Wed, 12 Dec 2012 14:38:23 -0800 X-Google-Sender-Auth: Rxvk9D1QatkccT8hXviMMQFbcgk Message-ID: Subject: Re: svn commit: r244112 - head/sys/kern From: Adrian Chadd To: Andriy Gapon Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Alfred Perlstein , src-committers@freebsd.org, John Baldwin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 12 Dec 2012 22:38:26 -0000 There are two parts to this; * don't compile in invariants. Panics panic. Invariant conditions aren't checked. You end up with data corruption still if there are bugs. * compile in invariants. Panics panic. Invariant conditions are checked and immediately panic. You can't run this in production to get debugging info because our debugging info is "create a crash dump and reboot." Now, the crash dump is great for us developers. But crap for say, a file server. If it's some very subtle issue that only occasionally pops up once a week and doesn't obviously screw with your data: * you can enable invariants and get a crash dump each time - then us developers get lots of information, but the user experiences outages once a week; * they just give the hell up, disable invariants in production and occasionally hit odd issues they can't explain. So now there's a third option: * enable invariants, get told when you hit that condition, and continue running. Now, we ship _right now_ generic with INVARIANTS disabled, because in theory the releases are supposed to be stable enough for us not to need the extra debugging information. That means that for those very occasional, very subtle bugs that invariants may catch, we don't have any way of getting told about them. Now, enabling some alternative to panic() is a different story and not what's being addressed here. HTH, Adrian From owner-svn-src-head@FreeBSD.ORG Wed Dec 12 22:43:13 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AA317447; Wed, 12 Dec 2012 22:43:13 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-we0-f182.google.com (mail-we0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id E015C8FC0C; Wed, 12 Dec 2012 22:43:11 +0000 (UTC) Received: by mail-we0-f182.google.com with SMTP id u54so578499wey.13 for ; Wed, 12 Dec 2012 14:43:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=i8/YdtaWV3nVoVYlmSxfzubqgWOsi68FmtFxykYi5Fg=; b=vjuTA8U9DX/9dpUkwFt1uzRGjC77TpqKr8pLrYCn3RnYxONXoHVK3yYOJ4fXkRw90i VZgmbhoHIBkVt9FwTGTwcJzWyU134pkJC+tYb6EkhpRseoohJh0q4BXDmg3CdqTfMWdN XhLIRsMi4MKoCUqhHbVNgeLN2kGvuX7G4KykbxnbcAUS1qIquFC/CSMWfzisuUnBKBSf aIYDLZkfgxjuRf89oV7E6ddWcHWGE1J8QxXgcEyty/iiqbQl5hPGWYOsyt+JZu9LVB6g rxH2QLK4TBOxS/zf+zLNygW7Opg2M/+dJrIKoRpeKAbtgby2wt0kC773HS7vyoMuJ/3M ZZcw== MIME-Version: 1.0 Received: by 10.194.179.34 with SMTP id dd2mr4591109wjc.1.1355352191136; Wed, 12 Dec 2012 14:43:11 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.217.57.9 with HTTP; Wed, 12 Dec 2012 14:43:11 -0800 (PST) In-Reply-To: <50C90641.4030000@FreeBSD.org> References: <201212110708.qBB78EWx025288@svn.freebsd.org> <201212121046.43706.jhb@freebsd.org> <201212121658.49048.jhb@freebsd.org> <50C904B8.6000502@mu.org> <50C90641.4030000@FreeBSD.org> Date: Wed, 12 Dec 2012 14:43:11 -0800 X-Google-Sender-Auth: 07h6SMbpxIUcj-Aiz7i3W_Pg7sE Message-ID: Subject: Re: svn commit: r244112 - head/sys/kern From: Adrian Chadd To: Andriy Gapon Content-Type: text/plain; charset=ISO-8859-1 Cc: Alfred Perlstein , John Baldwin , svn-src-all@freebsd.org, Alfred Perlstein , src-committers@freebsd.org, svn-src-head@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 12 Dec 2012 22:43:13 -0000 On 12 December 2012 14:33, Andriy Gapon wrote: >> Yes, two of my employers were more of "we want to get more debug metrics, we >> have the spare cycles, but we can't deal with superfluous panics". >> >> It also allows us "non-architects" to slip in a debug image when we have spare >> cpu without getting yelled at for "crashing the $foo". > > There is clearly something wrong with this sort of mentality. > > If you find instances where a developer put panic(9) (or KASSERT or etc) to mean > "maybe here is a bug, let's just panic", then let's get those things fixed. > > But most of assertions in our code that are know to me really mean that a real > bug has already occurred, that portions of kernel state are corrupted and there > is no going back to a sane state, only going forward to corrupting more and more. Dude, if you're running -STABLE right now, you don't have invariants enabled and you aren't checking for them. So right now, as it stands, large swaths of our kernel code are falling afoul of what you're calling Alfred out on. Before you all reply, please review and understand the difference between "panic()" and "KASSERT()". panic() is not being changed here. KASSERT() is what's being changed here. panic() is not optional. KASSERT() is. With a non-INVARIANTS kernel, we _are not checking invariants_ and we are continuing to run _after_ said non-compiled-in invariants. With this in mind, please re-review this. :-) Adrian From owner-svn-src-head@FreeBSD.ORG Wed Dec 12 22:48:30 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CF450710; Wed, 12 Dec 2012 22:48:30 +0000 (UTC) (envelope-from bright@mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id AAFC08FC0A; Wed, 12 Dec 2012 22:48:30 +0000 (UTC) Received: from Alfreds-MacBook-Pro-6.local (c-67-180-208-218.hsd1.ca.comcast.net [67.180.208.218]) by elvis.mu.org (Postfix) with ESMTPSA id C863B1A3C33; Wed, 12 Dec 2012 14:48:29 -0800 (PST) Message-ID: <50C909BD.9090709@mu.org> Date: Wed, 12 Dec 2012 14:48:29 -0800 From: Alfred Perlstein User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Andriy Gapon Subject: Re: svn commit: r244112 - head/sys/kern References: <201212110708.qBB78EWx025288@svn.freebsd.org> <201212121046.43706.jhb@freebsd.org> <201212121658.49048.jhb@freebsd.org> <50C90567.8080406@FreeBSD.org> In-Reply-To: <50C90567.8080406@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Adrian Chadd , src-committers@FreeBSD.org, John Baldwin , svn-src-all@FreeBSD.org, Alfred Perlstein , svn-src-head@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 12 Dec 2012 22:48:30 -0000 On 12/12/12 2:29 PM, Andriy Gapon wrote: > Now we get a new middle-ground: get both worse performance (because > KASSERTs are compiled in) and a risk of harming your data (because > KASSERTs no longer panic). The upside: there is no panic! There's just > a log message (or etc). and chance to get more log messages because > the insanity propagates. And a chance to lose your data (your > customer's) - but I've already mentioned this. I am not sure that I > like this kind of middle-ground. I have a number of points here: The most important one being: 1) without kassert you would still have the bug, just that it would be unreported. The upside: there is no panic! There's **NO** log message (or etc). and chance to get more log messages because the insanity propagates. Terrible! Let me explain that again: If you don't compile in KASSERT, then it's not like the condition is never going to happen. Instead it will just be unreported. So to put it in your own words, *without* KASSERT you get: The upside: there is no panic! There's **NO** log message (or etc). and chance to get more log messages because the insanity propagates. Now let's get to the other points: 2) Since this is not the default, then I do not understand why you are so concerned. 3) Can you explain to me why it is so upsetting to you that someone might be able to use this functionality? 4) *puts on flame retardant suit* ... Linux has had this for over a decade and it's allowed them to find bugs in different ways. Mind you, in Linux it was the default. 5) Adrian and I have both stated that we need this sort of functionality to avoid superfluous panics in our work environments while still getting bug feedback. Can we now please stop arguing over a non-default option that will help some vendors report bugs to the project? Thank you, -Alfred From owner-svn-src-head@FreeBSD.ORG Wed Dec 12 22:49:44 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A995C88D; Wed, 12 Dec 2012 22:49:44 +0000 (UTC) (envelope-from bright@mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 81AD28FC0A; Wed, 12 Dec 2012 22:49:44 +0000 (UTC) Received: from Alfreds-MacBook-Pro-6.local (c-67-180-208-218.hsd1.ca.comcast.net [67.180.208.218]) by elvis.mu.org (Postfix) with ESMTPSA id 2F5E71A3C20; Wed, 12 Dec 2012 14:49:44 -0800 (PST) Message-ID: <50C90A07.5030501@mu.org> Date: Wed, 12 Dec 2012 14:49:43 -0800 From: Alfred Perlstein User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Adrian Chadd Subject: Re: svn commit: r244112 - head/sys/kern References: <201212110708.qBB78EWx025288@svn.freebsd.org> <201212121046.43706.jhb@freebsd.org> <201212121658.49048.jhb@freebsd.org> <50C90567.8080406@FreeBSD.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: src-committers@freebsd.org, John Baldwin , svn-src-all@freebsd.org, Alfred Perlstein , Andriy Gapon , svn-src-head@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 12 Dec 2012 22:49:44 -0000 On 12/12/12 2:38 PM, Adrian Chadd wrote: > There are two parts to this; > > * don't compile in invariants. Panics panic. Invariant conditions > aren't checked. You end up with data corruption still if there are > bugs. > * compile in invariants. Panics panic. Invariant conditions are > checked and immediately panic. You can't run this in production to get > debugging info because our debugging info is "create a crash dump and > reboot." > > Now, the crash dump is great for us developers. But crap for say, a > file server. If it's some very subtle issue that only occasionally > pops up once a week and doesn't obviously screw with your data: > > * you can enable invariants and get a crash dump each time - then us > developers get lots of information, but the user experiences outages > once a week; > * they just give the hell up, disable invariants in production and > occasionally hit odd issues they can't explain. > > So now there's a third option: > > * enable invariants, get told when you hit that condition, and continue running. > > Now, we ship _right now_ generic with INVARIANTS disabled, because in > theory the releases are supposed to be stable enough for us not to > need the extra debugging information. That means that for those very > occasional, very subtle bugs that invariants may catch, we don't have > any way of getting told about them. > > Now, enabling some alternative to panic() is a different story and not > what's being addressed here. > > HTH, > Yes. -Alfred From owner-svn-src-head@FreeBSD.ORG Thu Dec 13 00:03:02 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0A794DEF; Thu, 13 Dec 2012 00:03:02 +0000 (UTC) (envelope-from nparhar@gmail.com) Received: from mail-pb0-f54.google.com (mail-pb0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id 9ECF88FC0C; Thu, 13 Dec 2012 00:03:01 +0000 (UTC) Received: by mail-pb0-f54.google.com with SMTP id wz12so956853pbc.13 for ; Wed, 12 Dec 2012 16:03:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=rUkkDS+u9T7qLpp5uJ5SoOT/90sisZr58CIKe88eUbw=; b=Hd3O7Psay78hbAr1h7RcqT/kDV4pQ3vzCp/C65onL3sGr99TZxc7rT8iQwhl0pxhkK ZiLL7lXY+bmT3zRr6OoNko76J74V3o/3Orhbjq20gF6h1KKpIelfyYiBFVYafrNiA566 y7vLqIoAZyjsc0m3PCeWkpcS5Upy45XOjy8NbLJvp5bAMfWgfXTiG50VGD+dZycqVny4 6nadsgp+bMKggdamZSrgixJGXbksHg333C6shIAx6h4/urzTv1KExmY93u9mLdqZ4DBT vRxjpgQbtTC3gEcxkqSnDnVQHgA9d9Cga+TacZHIJu9U990bdTEfCVvMxmqkPTad9ls2 dwNg== Received: by 10.66.82.230 with SMTP id l6mr1009565pay.12.1355356980857; Wed, 12 Dec 2012 16:03:00 -0800 (PST) Received: from [10.192.166.0] (stargate.chelsio.com. [67.207.112.58]) by mx.google.com with ESMTPS id l5sm102578paz.14.2012.12.12.16.02.59 (version=SSLv3 cipher=OTHER); Wed, 12 Dec 2012 16:03:00 -0800 (PST) Sender: Navdeep Parhar Message-ID: <50C91B32.4080904@FreeBSD.org> Date: Wed, 12 Dec 2012 16:02:58 -0800 From: Navdeep Parhar User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Alfred Perlstein Subject: Re: svn commit: r244112 - head/sys/kern References: <201212110708.qBB78EWx025288@svn.freebsd.org> <201212121046.43706.jhb@freebsd.org> <201212121658.49048.jhb@freebsd.org> <50C90567.8080406@FreeBSD.org> <50C909BD.9090709@mu.org> In-Reply-To: <50C909BD.9090709@mu.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Adrian Chadd , src-committers@FreeBSD.org, John Baldwin , svn-src-all@FreeBSD.org, Alfred Perlstein , Andriy Gapon , svn-src-head@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 13 Dec 2012 00:03:02 -0000 On 12/12/12 14:48, Alfred Perlstein wrote: > On 12/12/12 2:29 PM, Andriy Gapon wrote: >> Now we get a new middle-ground: get both worse performance (because >> KASSERTs are compiled in) and a risk of harming your data (because >> KASSERTs no longer panic). The upside: there is no panic! There's just >> a log message (or etc). and chance to get more log messages because >> the insanity propagates. And a chance to lose your data (your >> customer's) - but I've already mentioned this. I am not sure that I >> like this kind of middle-ground. > I have a number of points here: > > The most important one being: > 1) without kassert you would still have the bug, just that it would be > unreported. > The upside: there is no panic! There's **NO** log message (or etc). > and chance to get more log messages because the insanity propagates. > > Terrible! > > Let me explain that again: > If you don't compile in KASSERT, then it's not like the condition is > never going to happen. Instead it will just be unreported. A KASSERT() really is for a condition that should never happen. It is primarily useful during development and testing (and when the code is reworked or redesigned). I agree with Andriy here -- a non-fatal assert shouldn't really exist. Why not add a new facility (a "if (!foo) kdb_backtrace()" or similar), call it what you want to, enable it (or not) even in release builds if you want to, use it wherever you want to, but let KASSERT be just the way it is? Adding a global knob that changes the way KASSERT behaves risks tripping others up. Personally, in a debug kernel I _really_ want the kernel to stop right away if any KASSERT in my code goes off so that its state is as close as possible to what it was at the time the problem occurred. In a release kernel I _really_ do not want the overhead of the KASSERT at all. If it was a check for a condition I wasn't sure about then I wouldn't have written it as a KASSERT. That's my 2 cents in case you plan to revisit your changes and were looking around for inputs... ;-) Regards, Navdeep > > So to put it in your own words, *without* KASSERT you get: > > The upside: there is no panic! There's **NO** log message (or etc). > and chance to get more log messages because the insanity propagates. > > > > Now let's get to the other points: > > 2) Since this is not the default, then I do not understand why you are > so concerned. > > 3) Can you explain to me why it is so upsetting to you that someone > might be able to use this functionality? > > 4) *puts on flame retardant suit* ... Linux has had this for over a > decade and it's allowed them to find bugs in different ways. Mind you, > in Linux it was the default. > > 5) Adrian and I have both stated that we need this sort of functionality > to avoid superfluous panics in our work environments while still getting > bug feedback. > > Can we now please stop arguing over a non-default option that will help > some vendors report bugs to the project? > > Thank you, > -Alfred > From owner-svn-src-head@FreeBSD.ORG Thu Dec 13 00:09:56 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 49AF51C2; Thu, 13 Dec 2012 00:09:56 +0000 (UTC) (envelope-from bright@mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 23EC28FC12; Thu, 13 Dec 2012 00:09:55 +0000 (UTC) Received: from Alfreds-MacBook-Pro-6.local (c-67-180-208-218.hsd1.ca.comcast.net [67.180.208.218]) by elvis.mu.org (Postfix) with ESMTPSA id 145931A3C33; Wed, 12 Dec 2012 16:09:55 -0800 (PST) Message-ID: <50C91CD3.7030900@mu.org> Date: Wed, 12 Dec 2012 16:09:55 -0800 From: Alfred Perlstein User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Navdeep Parhar Subject: Re: svn commit: r244112 - head/sys/kern References: <201212110708.qBB78EWx025288@svn.freebsd.org> <201212121046.43706.jhb@freebsd.org> <201212121658.49048.jhb@freebsd.org> <50C90567.8080406@FreeBSD.org> <50C909BD.9090709@mu.org> <50C91B32.4080904@FreeBSD.org> In-Reply-To: <50C91B32.4080904@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Adrian Chadd , src-committers@FreeBSD.org, John Baldwin , svn-src-all@FreeBSD.org, Alfred Perlstein , Andriy Gapon , svn-src-head@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 13 Dec 2012 00:09:56 -0000 On 12/12/12 4:02 PM, Navdeep Parhar wrote: > On 12/12/12 14:48, Alfred Perlstein wrote: >> On 12/12/12 2:29 PM, Andriy Gapon wrote: >>> Now we get a new middle-ground: get both worse performance (because >>> KASSERTs are compiled in) and a risk of harming your data (because >>> KASSERTs no longer panic). The upside: there is no panic! There's just >>> a log message (or etc). and chance to get more log messages because >>> the insanity propagates. And a chance to lose your data (your >>> customer's) - but I've already mentioned this. I am not sure that I >>> like this kind of middle-ground. >> I have a number of points here: >> >> The most important one being: >> 1) without kassert you would still have the bug, just that it would be >> unreported. >> The upside: there is no panic! There's **NO** log message (or etc). >> and chance to get more log messages because the insanity propagates. >> >> Terrible! >> >> Let me explain that again: >> If you don't compile in KASSERT, then it's not like the condition is >> never going to happen. Instead it will just be unreported. > A KASSERT() really is for a condition that should never happen. It is > primarily useful during development and testing (and when the code is > reworked or redesigned). I agree with Andriy here -- a non-fatal assert > shouldn't really exist. What do you think happens to a FreeBSD kernel when INVARIANTS is compiled in and it trips an assertion after my change? -Alfred From owner-svn-src-head@FreeBSD.ORG Thu Dec 13 00:25:20 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0184454F; Thu, 13 Dec 2012 00:25:19 +0000 (UTC) (envelope-from nparhar@gmail.com) Received: from mail-da0-f54.google.com (mail-da0-f54.google.com [209.85.210.54]) by mx1.freebsd.org (Postfix) with ESMTP id 947858FC0A; Thu, 13 Dec 2012 00:25:19 +0000 (UTC) Received: by mail-da0-f54.google.com with SMTP id n2so431529dad.13 for ; Wed, 12 Dec 2012 16:25:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=UHwUG6hI/dDfVeR49brYDFf/hLSpb0gLjQ42DJQNgKM=; b=b1/On5VBYpYZUSI7i4BdegJjySWGh44Wj2/pZ7o0/Fd35thpN70Csv/T1gVbyyzodM nyDe+TVMAFa/l4ux7XCEJG/xhe64gd9N1oSYQa/ijRv7hsx6XcQyKwWB2Vsl/fCENTZw suP2S3u/3yjHlg4b57WjUVPnNhhMTBmw3GUPZYgrGt/EDZfP2DM31+hvg/Rwyp1CRfsp yt//dMJsHhtj5cUeMWRPCQV8hq3XNUEhALyWYofDwVDpeIKqUfagGVcc/6WjdlBhw03P IQzzKkE+eHZMuRJ18l9cBsmf7HCHwieooc3iEHvkUdIRsXtqGo++wa8Ne/mzhbbBvKdD kY4w== Received: by 10.68.143.162 with SMTP id sf2mr7383810pbb.137.1355358318945; Wed, 12 Dec 2012 16:25:18 -0800 (PST) Received: from [10.192.166.0] (stargate.chelsio.com. [67.207.112.58]) by mx.google.com with ESMTPS id ol4sm7623276pbb.58.2012.12.12.16.25.17 (version=SSLv3 cipher=OTHER); Wed, 12 Dec 2012 16:25:18 -0800 (PST) Sender: Navdeep Parhar Message-ID: <50C9206D.6080502@FreeBSD.org> Date: Wed, 12 Dec 2012 16:25:17 -0800 From: Navdeep Parhar User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Alfred Perlstein Subject: Re: svn commit: r244112 - head/sys/kern References: <201212110708.qBB78EWx025288@svn.freebsd.org> <201212121046.43706.jhb@freebsd.org> <201212121658.49048.jhb@freebsd.org> <50C90567.8080406@FreeBSD.org> <50C909BD.9090709@mu.org> <50C91B32.4080904@FreeBSD.org> <50C91CD3.7030900@mu.org> In-Reply-To: <50C91CD3.7030900@mu.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Adrian Chadd , src-committers@FreeBSD.org, John Baldwin , svn-src-all@FreeBSD.org, Alfred Perlstein , Andriy Gapon , svn-src-head@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 13 Dec 2012 00:25:20 -0000 On 12/12/12 16:09, Alfred Perlstein wrote: > On 12/12/12 4:02 PM, Navdeep Parhar wrote: >> On 12/12/12 14:48, Alfred Perlstein wrote: >>> On 12/12/12 2:29 PM, Andriy Gapon wrote: >>>> Now we get a new middle-ground: get both worse performance (because >>>> KASSERTs are compiled in) and a risk of harming your data (because >>>> KASSERTs no longer panic). The upside: there is no panic! There's just >>>> a log message (or etc). and chance to get more log messages because >>>> the insanity propagates. And a chance to lose your data (your >>>> customer's) - but I've already mentioned this. I am not sure that I >>>> like this kind of middle-ground. >>> I have a number of points here: >>> >>> The most important one being: >>> 1) without kassert you would still have the bug, just that it would be >>> unreported. >>> The upside: there is no panic! There's **NO** log message (or etc). >>> and chance to get more log messages because the insanity propagates. >>> >>> Terrible! >>> >>> Let me explain that again: >>> If you don't compile in KASSERT, then it's not like the condition is >>> never going to happen. Instead it will just be unreported. >> A KASSERT() really is for a condition that should never happen. It is >> primarily useful during development and testing (and when the code is >> reworked or redesigned). I agree with Andriy here -- a non-fatal assert >> shouldn't really exist. > > > What do you think happens to a FreeBSD kernel when INVARIANTS is > compiled in and it trips an assertion after my change? I know the new knob has sane defaults. My point was that invariants should be considered inviolable. A knob that allows for it's-really-not-supposed-to-fail-but-in-case-it-does... dilutes their meaning, so it may have been better to introduce a new macro for the kind of tests you had in mind. I would use it too instead of the if (!foo) kdb_backtrace() that I often resort to for conditions that I'm not sure about. Regards, Navdeep From owner-svn-src-head@FreeBSD.ORG Thu Dec 13 00:41:48 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 915E8B45; Thu, 13 Dec 2012 00:41:48 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wg0-f52.google.com (mail-wg0-f52.google.com [74.125.82.52]) by mx1.freebsd.org (Postfix) with ESMTP id 2E1508FC17; Thu, 13 Dec 2012 00:41:46 +0000 (UTC) Received: by mail-wg0-f52.google.com with SMTP id 12so533717wgh.31 for ; Wed, 12 Dec 2012 16:41:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=AZ/YW/+UjZp3ViFKgdNF+SIYj+q/r9pWnrDD0M3XbPk=; b=tMeKS/QvluaFhfW3EdfYCmckkV7Zl/VHq32ztd2kUZPyMjkeiQ9bfZJSOmGvy3cmac dnxLGteHdIi+gOxwGRb8T+TjTzBLZ6E7JATCxLR/CwHOZDxh+qgBuPAwVWQ4IN7t/VKp Al8ei325kPAAQLurDVVJ4QtlO7Aahm9mrOATFNA3r/jk42YvIGElc0w1Al2HwA6MgEgy biWAt4Ek0573Zq7zGHAKRyIC0hRsIqQ42vjhPDX7zWGhT5s4vfGZe1giqFaBzGSyCceL MP4fgFPVPYvKbOBGHBI6iBFJU0xEnV+ye7+pHSP5n6MU1oEJSS5snmRL/wqKiAe95nYw egAg== MIME-Version: 1.0 Received: by 10.194.179.34 with SMTP id dd2mr4921139wjc.1.1355359305931; Wed, 12 Dec 2012 16:41:45 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.217.57.9 with HTTP; Wed, 12 Dec 2012 16:41:45 -0800 (PST) In-Reply-To: <50C9206D.6080502@FreeBSD.org> References: <201212110708.qBB78EWx025288@svn.freebsd.org> <201212121046.43706.jhb@freebsd.org> <201212121658.49048.jhb@freebsd.org> <50C90567.8080406@FreeBSD.org> <50C909BD.9090709@mu.org> <50C91B32.4080904@FreeBSD.org> <50C91CD3.7030900@mu.org> <50C9206D.6080502@FreeBSD.org> Date: Wed, 12 Dec 2012 16:41:45 -0800 X-Google-Sender-Auth: hLPb47fvav1DgOl_ldAplOB0I6o Message-ID: Subject: Re: svn commit: r244112 - head/sys/kern From: Adrian Chadd To: Navdeep Parhar Content-Type: text/plain; charset=ISO-8859-1 Cc: Alfred Perlstein , John Baldwin , svn-src-all@freebsd.org, Alfred Perlstein , Andriy Gapon , src-committers@freebsd.org, svn-src-head@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 13 Dec 2012 00:41:48 -0000 If a kassert is inviolable, then make it a panic() and include in the default kernel. Right now there's no distinction between "kassert for a condition that shouldn't happen, but we fail gracefully" and "kassert for a condition that shouldn't happen, and we don't handle at all." Ideally we'd create two separate macros to express that, t.hen we should make all kassert's that don't fail gracefully to fail gracefully. Anything left over should've been a panic() in the first place. Right now, with no INVARIANTS compiled in, we don't check KASSERT(). Again, the difference between panic and KASSERT. TL;DR - we're doing panic/assert sub-optimally; we don't have a consistent definition of what an invariant check is; Alfred's work doesn't change that. Adrian On 12 December 2012 16:25, Navdeep Parhar wrote: > On 12/12/12 16:09, Alfred Perlstein wrote: >> On 12/12/12 4:02 PM, Navdeep Parhar wrote: >>> On 12/12/12 14:48, Alfred Perlstein wrote: >>>> On 12/12/12 2:29 PM, Andriy Gapon wrote: >>>>> Now we get a new middle-ground: get both worse performance (because >>>>> KASSERTs are compiled in) and a risk of harming your data (because >>>>> KASSERTs no longer panic). The upside: there is no panic! There's just >>>>> a log message (or etc). and chance to get more log messages because >>>>> the insanity propagates. And a chance to lose your data (your >>>>> customer's) - but I've already mentioned this. I am not sure that I >>>>> like this kind of middle-ground. >>>> I have a number of points here: >>>> >>>> The most important one being: >>>> 1) without kassert you would still have the bug, just that it would be >>>> unreported. >>>> The upside: there is no panic! There's **NO** log message (or etc). >>>> and chance to get more log messages because the insanity propagates. >>>> >>>> Terrible! >>>> >>>> Let me explain that again: >>>> If you don't compile in KASSERT, then it's not like the condition is >>>> never going to happen. Instead it will just be unreported. >>> A KASSERT() really is for a condition that should never happen. It is >>> primarily useful during development and testing (and when the code is >>> reworked or redesigned). I agree with Andriy here -- a non-fatal assert >>> shouldn't really exist. >> >> >> What do you think happens to a FreeBSD kernel when INVARIANTS is >> compiled in and it trips an assertion after my change? > > I know the new knob has sane defaults. My point was that invariants > should be considered inviolable. A knob that allows for > it's-really-not-supposed-to-fail-but-in-case-it-does... dilutes their > meaning, so it may have been better to introduce a new macro for the > kind of tests you had in mind. I would use it too instead of the if > (!foo) kdb_backtrace() that I often resort to for conditions that I'm > not sure about. > > Regards, > Navdeep From owner-svn-src-head@FreeBSD.ORG Thu Dec 13 00:44:24 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B0F37CDE; Thu, 13 Dec 2012 00:44:24 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 941688FC08; Thu, 13 Dec 2012 00:44:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBD0iO3H094416; Thu, 13 Dec 2012 00:44:24 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBD0iOTm094414; Thu, 13 Dec 2012 00:44:24 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201212130044.qBD0iOTm094414@svn.freebsd.org> From: Eitan Adler Date: Thu, 13 Dec 2012 00:44:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244164 - head/share/syscons/keymaps X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 13 Dec 2012 00:44:24 -0000 Author: eadler Date: Thu Dec 13 00:44:23 2012 New Revision: 244164 URL: http://svnweb.freebsd.org/changeset/base/244164 Log: Give credit where credit is due. Requested by: Ãlvaro Castillo Approved by: cperciva (implicit) Modified: head/share/syscons/keymaps/spanish.dvorak.kbd Modified: head/share/syscons/keymaps/spanish.dvorak.kbd ============================================================================== --- head/share/syscons/keymaps/spanish.dvorak.kbd Wed Dec 12 22:25:31 2012 (r244163) +++ head/share/syscons/keymaps/spanish.dvorak.kbd Thu Dec 13 00:44:23 2012 (r244164) @@ -1,4 +1,6 @@ # $FreeBSD$ +# +# Submitted by: Álvaro Castillo # alt # scan cntrl alt alt cntrl lock # code base shift cntrl shift alt shift cntrl shift state From owner-svn-src-head@FreeBSD.ORG Thu Dec 13 00:53:49 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 59F2F10F; Thu, 13 Dec 2012 00:53:49 +0000 (UTC) (envelope-from bright@mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 32F848FC0C; Thu, 13 Dec 2012 00:53:49 +0000 (UTC) Received: from Alfreds-MacBook-Pro-6.local (c-67-180-208-218.hsd1.ca.comcast.net [67.180.208.218]) by elvis.mu.org (Postfix) with ESMTPSA id B78A81A3C1B; Wed, 12 Dec 2012 16:53:48 -0800 (PST) Message-ID: <50C9271C.70803@mu.org> Date: Wed, 12 Dec 2012 16:53:48 -0800 From: Alfred Perlstein User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Navdeep Parhar Subject: Re: svn commit: r244112 - head/sys/kern References: <201212110708.qBB78EWx025288@svn.freebsd.org> <201212121046.43706.jhb@freebsd.org> <201212121658.49048.jhb@freebsd.org> <50C90567.8080406@FreeBSD.org> <50C909BD.9090709@mu.org> <50C91B32.4080904@FreeBSD.org> <50C91CD3.7030900@mu.org> <50C9206D.6080502@FreeBSD.org> In-Reply-To: <50C9206D.6080502@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Adrian Chadd , src-committers@FreeBSD.org, John Baldwin , svn-src-all@FreeBSD.org, Alfred Perlstein , Andriy Gapon , svn-src-head@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 13 Dec 2012 00:53:49 -0000 On 12/12/12 4:25 PM, Navdeep Parhar wrote: > On 12/12/12 16:09, Alfred Perlstein wrote: > >> What do you think happens to a FreeBSD kernel when INVARIANTS is >> compiled in and it trips an assertion after my change? > I know the new knob has sane defaults. My point was that invariants > should be considered inviolable. A knob that allows for > it's-really-not-supposed-to-fail-but-in-case-it-does... dilutes their > meaning, so it may have been better to introduce a new macro for the > kind of tests you had in mind. I would use it too instead of the if > (!foo) kdb_backtrace() that I often resort to for conditions that I'm > not sure about. > The problem again is that not all the KASSERTS are inviolable, if you want to do a project to split them, then please do, it would really be helpful, as for now, they are a mis-mash of death/warnings and there are at least three vendors who approve of this as well as 3 long term committers that approved my change (not including Adrian). I'll be completely honest, I struggled very much with this KASSERT problem at a previous employer, and the second that Adrian brought up the idea of "optional panic" I was kicking myself so hard because the solution to so many problems suddenly jumped out at me. I will assure you that taking a stand on this one issue has the following problems: 1) Makes it harder for at LEAST three vendors to shake out and report bugs back to the project. 2) Makes it more likely that someone who has useful (to some, but not all) patches to keep them private to avoid such arguments. Anyhow after all this back and forth on changes that really do not effect anyone, ie defaults stay the same, it really has me questioning the sanity of contributing and/or taking the time to give this sort of thing to the project. It really seems like people are getting very bent out of shape over minor enhancements that offer flexibility. Like what if I do gzipp'd kernel dumps next? (on my todo list) How many people will complain that "gzip is too dangerous in kernel context foo foo!!!!" Not sure, I guess I'll find out? -Alfred From owner-svn-src-head@FreeBSD.ORG Thu Dec 13 00:55:18 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 443E63D3; Thu, 13 Dec 2012 00:55:18 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wg0-f52.google.com (mail-wg0-f52.google.com [74.125.82.52]) by mx1.freebsd.org (Postfix) with ESMTP id D30168FC08; Thu, 13 Dec 2012 00:55:16 +0000 (UTC) Received: by mail-wg0-f52.google.com with SMTP id 12so537155wgh.31 for ; Wed, 12 Dec 2012 16:55:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=sbL7J0cFHJzOmW/Pg29iU7xObtpoSxglsqdoZNyjRio=; b=J45eW74/7lXeHj2hEmBn4ssBIzm3okRxxVyhJbcEVviVunO/HY9RA2NkvkbDqo2x0/ SG0HH6b9KXZ3ek2n5F4f67ttmopgwxutyoj5y9+6exIu3frkHUnLNEGql+BBFgv4xOnP VRM+2loIur9mmUHngQdNkskAMtNoJY1E2+fXDp+GqoSYPUYJ9hY2VB0i7MiG6DUvyn7e hKBVflAsPWm8E2iG3O8jVfAqWm5Kc8Nzq5b7lsQNTLBCtuUSFesf9BzmL8j5Ie8tIH7q p4gncqddsl+D42X/gsLZ7MO2Pxu1GGFfTYM34Bu/WudkZSqdUmDSEiz3EvuDX5vxvOAI RFlw== MIME-Version: 1.0 Received: by 10.180.97.137 with SMTP id ea9mr86005wib.13.1355360116117; Wed, 12 Dec 2012 16:55:16 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.217.57.9 with HTTP; Wed, 12 Dec 2012 16:55:16 -0800 (PST) In-Reply-To: <50C9271C.70803@mu.org> References: <201212110708.qBB78EWx025288@svn.freebsd.org> <201212121046.43706.jhb@freebsd.org> <201212121658.49048.jhb@freebsd.org> <50C90567.8080406@FreeBSD.org> <50C909BD.9090709@mu.org> <50C91B32.4080904@FreeBSD.org> <50C91CD3.7030900@mu.org> <50C9206D.6080502@FreeBSD.org> <50C9271C.70803@mu.org> Date: Wed, 12 Dec 2012 16:55:16 -0800 X-Google-Sender-Auth: U82LK1Ie-tgsoyN__g3rFVBSmZ8 Message-ID: Subject: Re: svn commit: r244112 - head/sys/kern From: Adrian Chadd To: Alfred Perlstein Content-Type: text/plain; charset=ISO-8859-1 Cc: src-committers@freebsd.org, John Baldwin , svn-src-all@freebsd.org, Alfred Perlstein , Andriy Gapon , Navdeep Parhar , svn-src-head@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 13 Dec 2012 00:55:18 -0000 .. just make sure you've preallocated all the space needed by the gzip code when writing those dumps. :-) Adrian From owner-svn-src-head@FreeBSD.ORG Thu Dec 13 01:39:50 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C054A3CF; Thu, 13 Dec 2012 01:39:50 +0000 (UTC) (envelope-from alfred@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8C1698FC0A; Thu, 13 Dec 2012 01:39:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBD1dom4005842; Thu, 13 Dec 2012 01:39:50 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBD1dooO005840; Thu, 13 Dec 2012 01:39:50 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <201212130139.qBD1dooO005840@svn.freebsd.org> From: Alfred Perlstein Date: Thu, 13 Dec 2012 01:39:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244165 - head/usr.sbin/portsnap/portsnap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 13 Dec 2012 01:39:50 -0000 Author: alfred Date: Thu Dec 13 01:39:49 2012 New Revision: 244165 URL: http://svnweb.freebsd.org/changeset/base/244165 Log: Change progress indicator for downloading patches. Use a percent style indicator instead of emitting one long line of patch numbers. Modified: head/usr.sbin/portsnap/portsnap/portsnap.sh Modified: head/usr.sbin/portsnap/portsnap/portsnap.sh ============================================================================== --- head/usr.sbin/portsnap/portsnap/portsnap.sh Thu Dec 13 00:44:23 2012 (r244164) +++ head/usr.sbin/portsnap/portsnap/portsnap.sh Thu Dec 13 01:39:49 2012 (r244165) @@ -612,6 +612,28 @@ fetch_progress() { echo -n " " } +pct_fmt() +{ + printf " \r" + printf "($1/$2) %02.2f%% " `echo "scale=4;$LNC / $TOTAL * 100"|bc` +} + +fetch_progress_percent() { + TOTAL=$1 + LNC=0 + pct_fmt $LNC $TOTAL + while read x; do + LNC=$(($LNC + 1)) + if [ $(($LNC % 100)) = 0 ]; then + pct_fmt $LNC $TOTAL + elif [ $(($LNC % 10)) = 0 ]; then + echo -n . + fi + done + pct_fmt $LNC $TOTAL + echo " done. " +} + # Sanity-check an index file fetch_index_sanity() { if grep -qvE "^[-_+./@0-9A-Za-z]+\|[0-9a-f]{64}$" INDEX.new || @@ -781,11 +803,13 @@ fetch_update() { echo " done." 1>${QUIETREDIR} # Attempt to fetch ports patches - echo -n "Fetching `wc -l < patchlist | tr -d ' '` " + patchcnt=`wc -l < patchlist | tr -d ' '` + echo -n "Fetching $patchcnt " echo ${NDEBUG} "patches.${DDSTATS}" + echo " " tr '|' '-' < patchlist | lam -s "bp/" - | xargs ${XARGST} ${PHTTPGET} ${SERVERNAME} \ - 2>${STATSREDIR} | fetch_progress + 2>${STATSREDIR} | fetch_progress_percent $patchcnt echo "done." # Attempt to apply ports patches From owner-svn-src-head@FreeBSD.ORG Thu Dec 13 01:41:42 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 438A9717; Thu, 13 Dec 2012 01:41:42 +0000 (UTC) (envelope-from bright@mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id E8AE08FC0C; Thu, 13 Dec 2012 01:41:41 +0000 (UTC) Received: from Alfreds-MacBook-Pro-6.local (c-67-180-208-218.hsd1.ca.comcast.net [67.180.208.218]) by elvis.mu.org (Postfix) with ESMTPSA id 708381A3CE9; Wed, 12 Dec 2012 17:41:41 -0800 (PST) Message-ID: <50C93255.5080607@mu.org> Date: Wed, 12 Dec 2012 17:41:41 -0800 From: Alfred Perlstein User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Alfred Perlstein Subject: Re: svn commit: r244165 - head/usr.sbin/portsnap/portsnap References: <201212130139.qBD1dooO005840@svn.freebsd.org> In-Reply-To: <201212130139.qBD1dooO005840@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 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 13 Dec 2012 01:41:42 -0000 Reviewed by: eadler On 12/12/12 5:39 PM, Alfred Perlstein wrote: > Author: alfred > Date: Thu Dec 13 01:39:49 2012 > New Revision: 244165 > URL: http://svnweb.freebsd.org/changeset/base/244165 > > Log: > Change progress indicator for downloading patches. > > Use a percent style indicator instead of emitting one > long line of patch numbers. > > Modified: > head/usr.sbin/portsnap/portsnap/portsnap.sh > > Modified: head/usr.sbin/portsnap/portsnap/portsnap.sh > ============================================================================== > --- head/usr.sbin/portsnap/portsnap/portsnap.sh Thu Dec 13 00:44:23 2012 (r244164) > +++ head/usr.sbin/portsnap/portsnap/portsnap.sh Thu Dec 13 01:39:49 2012 (r244165) > @@ -612,6 +612,28 @@ fetch_progress() { > echo -n " " > } > > +pct_fmt() > +{ > + printf " \r" > + printf "($1/$2) %02.2f%% " `echo "scale=4;$LNC / $TOTAL * 100"|bc` > +} > + > +fetch_progress_percent() { > + TOTAL=$1 > + LNC=0 > + pct_fmt $LNC $TOTAL > + while read x; do > + LNC=$(($LNC + 1)) > + if [ $(($LNC % 100)) = 0 ]; then > + pct_fmt $LNC $TOTAL > + elif [ $(($LNC % 10)) = 0 ]; then > + echo -n . > + fi > + done > + pct_fmt $LNC $TOTAL > + echo " done. " > +} > + > # Sanity-check an index file > fetch_index_sanity() { > if grep -qvE "^[-_+./@0-9A-Za-z]+\|[0-9a-f]{64}$" INDEX.new || > @@ -781,11 +803,13 @@ fetch_update() { > echo " done." 1>${QUIETREDIR} > > # Attempt to fetch ports patches > - echo -n "Fetching `wc -l < patchlist | tr -d ' '` " > + patchcnt=`wc -l < patchlist | tr -d ' '` > + echo -n "Fetching $patchcnt " > echo ${NDEBUG} "patches.${DDSTATS}" > + echo " " > tr '|' '-' < patchlist | lam -s "bp/" - | > xargs ${XARGST} ${PHTTPGET} ${SERVERNAME} \ > - 2>${STATSREDIR} | fetch_progress > + 2>${STATSREDIR} | fetch_progress_percent $patchcnt > echo "done." > > # Attempt to apply ports patches > From owner-svn-src-head@FreeBSD.ORG Thu Dec 13 01:44:59 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8AD838DB; Thu, 13 Dec 2012 01:44:59 +0000 (UTC) (envelope-from grog@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6D5518FC08; Thu, 13 Dec 2012 01:44:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBD1ixZJ006878; Thu, 13 Dec 2012 01:44:59 GMT (envelope-from grog@svn.freebsd.org) Received: (from grog@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBD1ixxP006877; Thu, 13 Dec 2012 01:44:59 GMT (envelope-from grog@svn.freebsd.org) Message-Id: <201212130144.qBD1ixxP006877@svn.freebsd.org> From: Greg Lehey Date: Thu, 13 Dec 2012 01:44:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244166 - head/usr.bin/calendar X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 13 Dec 2012 01:44:59 -0000 Author: grog Date: Thu Dec 13 01:44:58 2012 New Revision: 244166 URL: http://svnweb.freebsd.org/changeset/base/244166 Log: Reluctantly remove one of the most extraordinary numeric conversion routines I have ever seen and replace with something far more boring. Modified: head/usr.bin/calendar/parsedata.c Modified: head/usr.bin/calendar/parsedata.c ============================================================================== --- head/usr.bin/calendar/parsedata.c Thu Dec 13 01:39:49 2012 (r244165) +++ head/usr.bin/calendar/parsedata.c Thu Dec 13 01:44:58 2012 (r244166) @@ -940,15 +940,13 @@ indextooffset(char *s) { int i; struct fixs *n; + char *es; if (s[0] == '+' || s[0] == '-') { - char ss[9]; - for (i = -100; i < 100; i++) { - sprintf(ss, "%s%d", (i > 0) ? "+" : "", i); - if (strcmp(ss, s) == 0) - return (i); - } - return (0); + i = strtod (s, &es); + if (*es != '\0') /* trailing junk */ + errx (1, "Invalid specifier format: %s\n", s); + return (i); } for (i = 0; i < 6; i++) { From owner-svn-src-head@FreeBSD.ORG Thu Dec 13 02:21:06 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 11555DB; Thu, 13 Dec 2012 02:21:06 +0000 (UTC) (envelope-from grog@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E8C6B8FC0C; Thu, 13 Dec 2012 02:21:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBD2L5RR014676; Thu, 13 Dec 2012 02:21:05 GMT (envelope-from grog@svn.freebsd.org) Received: (from grog@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBD2L5wj014675; Thu, 13 Dec 2012 02:21:05 GMT (envelope-from grog@svn.freebsd.org) Message-Id: <201212130221.qBD2L5wj014675@svn.freebsd.org> From: Greg Lehey Date: Thu, 13 Dec 2012 02:21:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244168 - head/usr.bin/calendar X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 13 Dec 2012 02:21:06 -0000 Author: grog Date: Thu Dec 13 02:21:05 2012 New Revision: 244168 URL: http://svnweb.freebsd.org/changeset/base/244168 Log: Use even more conventional conversion routines. Reported by: peterj@ Modified: head/usr.bin/calendar/parsedata.c Modified: head/usr.bin/calendar/parsedata.c ============================================================================== --- head/usr.bin/calendar/parsedata.c Thu Dec 13 01:58:11 2012 (r244167) +++ head/usr.bin/calendar/parsedata.c Thu Dec 13 02:21:05 2012 (r244168) @@ -943,7 +943,7 @@ indextooffset(char *s) char *es; if (s[0] == '+' || s[0] == '-') { - i = strtod (s, &es); + i = strtol (s, &es, 10); if (*es != '\0') /* trailing junk */ errx (1, "Invalid specifier format: %s\n", s); return (i); From owner-svn-src-head@FreeBSD.ORG Thu Dec 13 03:33:02 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 54D3D9FD; Thu, 13 Dec 2012 03:33:02 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 382C28FC08; Thu, 13 Dec 2012 03:33:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBD3X2lJ028991; Thu, 13 Dec 2012 03:33:02 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBD3X25Y028990; Thu, 13 Dec 2012 03:33:02 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201212130333.qBD3X25Y028990@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Thu, 13 Dec 2012 03:33:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244169 - head/sys/dev/smc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 13 Dec 2012 03:33:02 -0000 Author: gonzo Date: Thu Dec 13 03:33:01 2012 New Revision: 244169 URL: http://svnweb.freebsd.org/changeset/base/244169 Log: Disable interrupts in filter in order to avoid interrupt storm and CPU starvation Modified: head/sys/dev/smc/if_smc.c Modified: head/sys/dev/smc/if_smc.c ============================================================================== --- head/sys/dev/smc/if_smc.c Thu Dec 13 02:21:05 2012 (r244168) +++ head/sys/dev/smc/if_smc.c Thu Dec 13 03:33:01 2012 (r244169) @@ -807,6 +807,10 @@ smc_intr(void *context) struct smc_softc *sc; sc = (struct smc_softc *)context; + /* + * Block interrupts in order to let smc_task_intr to kick in + */ + smc_write_1(sc, MSK, 0); taskqueue_enqueue_fast(sc->smc_tq, &sc->smc_intr); return (FILTER_HANDLED); } @@ -827,13 +831,6 @@ smc_task_intr(void *context, int pending smc_select_bank(sc, 2); /* - * Get the current mask, and then block all interrupts while we're - * working. - */ - if ((ifp->if_capenable & IFCAP_POLLING) == 0) - smc_write_1(sc, MSK, 0); - - /* * Find out what interrupts are flagged. */ status = smc_read_1(sc, IST) & sc->smc_mask; From owner-svn-src-head@FreeBSD.ORG Thu Dec 13 03:34:25 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 94884B86; Thu, 13 Dec 2012 03:34:25 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 79C998FC0A; Thu, 13 Dec 2012 03:34:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBD3YPtD029181; Thu, 13 Dec 2012 03:34:25 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBD3YP2B029180; Thu, 13 Dec 2012 03:34:25 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201212130334.qBD3YP2B029180@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Thu, 13 Dec 2012 03:34:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244170 - head/sys/dev/sym X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 13 Dec 2012 03:34:25 -0000 Author: gonzo Date: Thu Dec 13 03:34:24 2012 New Revision: 244170 URL: http://svnweb.freebsd.org/changeset/base/244170 Log: Add memory barrier macros for ARM Modified: head/sys/dev/sym/sym_hipd.c Modified: head/sys/dev/sym/sym_hipd.c ============================================================================== --- head/sys/dev/sym/sym_hipd.c Thu Dec 13 03:33:01 2012 (r244169) +++ head/sys/dev/sym/sym_hipd.c Thu Dec 13 03:34:24 2012 (r244170) @@ -135,6 +135,8 @@ typedef u_int32_t u32; #define MEMORY_BARRIER() __asm__ volatile("mf.a; mf" : : : "memory") #elif defined __sparc64__ #define MEMORY_BARRIER() __asm__ volatile("membar #Sync" : : : "memory") +#elif defined __arm__ +#define MEMORY_BARRIER() __do_dmb() #else #error "Not supported platform" #endif From owner-svn-src-head@FreeBSD.ORG Thu Dec 13 03:35:47 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BCC2CD18; Thu, 13 Dec 2012 03:35:47 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A0BB98FC12; Thu, 13 Dec 2012 03:35:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBD3ZldS029566; Thu, 13 Dec 2012 03:35:47 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBD3ZlUi029565; Thu, 13 Dec 2012 03:35:47 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201212130335.qBD3ZlUi029565@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Thu, 13 Dec 2012 03:35:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244171 - head/sys/dev/uart X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 13 Dec 2012 03:35:47 -0000 Author: gonzo Date: Thu Dec 13 03:35:47 2012 New Revision: 244171 URL: http://svnweb.freebsd.org/changeset/base/244171 Log: Prevent possible usage of uninitialized pbase variable by checking return value of fdt_get_range Modified: head/sys/dev/uart/uart_bus_fdt.c Modified: head/sys/dev/uart/uart_bus_fdt.c ============================================================================== --- head/sys/dev/uart/uart_bus_fdt.c Thu Dec 13 03:34:24 2012 (r244170) +++ head/sys/dev/uart/uart_bus_fdt.c Thu Dec 13 03:35:47 2012 (r244171) @@ -206,8 +206,10 @@ uart_cpu_getdev(int devtype, struct uart err = fdt_regsize(node, &start, &size); if (err) return (ENXIO); + err = fdt_get_range(OF_parent(node), 0, &pbase, &psize); + if (err) + pbase = 0; - fdt_get_range(OF_parent(node), 0, &pbase, &psize); start += pbase; return (bus_space_map(di->bas.bst, start, size, 0, &di->bas.bsh)); From owner-svn-src-head@FreeBSD.ORG Thu Dec 13 06:42:45 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BD4A5CC; Thu, 13 Dec 2012 06:42:45 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8A67F8FC12; Thu, 13 Dec 2012 06:42:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBD6gjVG065918; Thu, 13 Dec 2012 06:42:45 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBD6gjdP065917; Thu, 13 Dec 2012 06:42:45 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201212130642.qBD6gjdP065917@svn.freebsd.org> From: Rui Paulo Date: Thu, 13 Dec 2012 06:42:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244179 - head/sys/powerpc/wii X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 13 Dec 2012 06:42:45 -0000 Author: rpaulo Date: Thu Dec 13 06:42:44 2012 New Revision: 244179 URL: http://svnweb.freebsd.org/changeset/base/244179 Log: Add the common FreeBSD SVN properties. Modified: Directory Properties: head/sys/powerpc/wii/locore.S (props changed) From owner-svn-src-head@FreeBSD.ORG Thu Dec 13 06:45:46 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 87A6D25A; Thu, 13 Dec 2012 06:45:46 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6C6EB8FC17; Thu, 13 Dec 2012 06:45:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBD6jk85066528; Thu, 13 Dec 2012 06:45:46 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBD6jkeE066527; Thu, 13 Dec 2012 06:45:46 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201212130645.qBD6jkeE066527@svn.freebsd.org> From: Rui Paulo Date: Thu, 13 Dec 2012 06:45:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244180 - head/contrib/top X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 13 Dec 2012 06:45:46 -0000 Author: rpaulo Date: Thu Dec 13 06:45:45 2012 New Revision: 244180 URL: http://svnweb.freebsd.org/changeset/base/244180 Log: Bump MAX_COLS to 512 to take advantage of wider terminals. Modified: head/contrib/top/top.h Modified: head/contrib/top/top.h ============================================================================== --- head/contrib/top/top.h Thu Dec 13 06:42:44 2012 (r244179) +++ head/contrib/top/top.h Thu Dec 13 06:45:45 2012 (r244180) @@ -14,7 +14,7 @@ extern int Header_lines; /* 7 */ /* Maximum number of columns allowed for display */ -#define MAX_COLS 128 +#define MAX_COLS 512 /* Log base 2 of 1024 is 10 (2^10 == 1024) */ #define LOG1024 10 From owner-svn-src-head@FreeBSD.ORG Thu Dec 13 06:47:51 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E98084BB; Thu, 13 Dec 2012 06:47:51 +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 319D58FC08; Thu, 13 Dec 2012 06:47:49 +0000 (UTC) Received: from porto.starpoint.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 IAA11155; Thu, 13 Dec 2012 08:47:48 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1Tj2aC-000MmZ-3L; Thu, 13 Dec 2012 08:47:48 +0200 Message-ID: <50C97A11.10409@FreeBSD.org> Date: Thu, 13 Dec 2012 08:47:45 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Adrian Chadd Subject: Re: svn commit: r244112 - head/sys/kern References: <201212110708.qBB78EWx025288@svn.freebsd.org> <201212121046.43706.jhb@freebsd.org> <201212121658.49048.jhb@freebsd.org> <50C90567.8080406@FreeBSD.org> In-Reply-To: X-Enigmail-Version: 1.4.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, Alfred Perlstein , src-committers@FreeBSD.org, John Baldwin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 13 Dec 2012 06:47:52 -0000 on 13/12/2012 00:38 Adrian Chadd said the following: > There are two parts to this; > > * don't compile in invariants. Panics panic. Invariant conditions > aren't checked. You end up with data corruption still if there are > bugs. > * compile in invariants. Panics panic. Invariant conditions are > checked and immediately panic. You can't run this in production to get > debugging info because our debugging info is "create a crash dump and > reboot." > > Now, the crash dump is great for us developers. But crap for say, a > file server. If it's some very subtle issue that only occasionally > pops up once a week and doesn't obviously screw with your data: > > * you can enable invariants and get a crash dump each time - then us > developers get lots of information, but the user experiences outages > once a week; > * they just give the hell up, disable invariants in production and > occasionally hit odd issues they can't explain. > > So now there's a third option: > > * enable invariants, get told when you hit that condition, and continue running. > > Now, we ship _right now_ generic with INVARIANTS disabled, because in > theory the releases are supposed to be stable enough for us not to > need the extra debugging information. That means that for those very > occasional, very subtle bugs that invariants may catch, we don't have > any way of getting told about them. > > Now, enabling some alternative to panic() is a different story and not > what's being addressed here. > > HTH, Let me see if it does... So basically a violated assertion means that something has already gone wrong. With assertions you catch that sooner and get full debug information and can fix it. Without assertions you crash anyway (in 99% cases), but later and get much less useful information. Now you have an option to crash later while having the worse performance and the only benefit is a log message which may or may not be useful for debugging. No, this doesn't help. -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Thu Dec 13 06:49:46 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7FA2C641; Thu, 13 Dec 2012 06:49:46 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-vc0-f182.google.com (mail-vc0-f182.google.com [209.85.220.182]) by mx1.freebsd.org (Postfix) with ESMTP id 621B08FC08; Thu, 13 Dec 2012 06:49:45 +0000 (UTC) Received: by mail-vc0-f182.google.com with SMTP id fo14so1829197vcb.13 for ; Wed, 12 Dec 2012 22:49:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=dmdJYeoFONc4VB/XnGu8f1Hk7OT8TZZQUC7maqPyins=; b=mqvZyNgYee6B/UF3y3b8R7pG1bP12esCUY92O9dmStFSI2EeVgRvRhRvWxU8Z/vv5Y usUE3zX7mJjlZ6ZJm+SnfWQqKW5SCw9qIeNpTLZj+WDDZK/m69+snUpZw78sw7pCH8S9 Vwaf633t2yNuWHFFGgE5MqrgXYdcp4Hnm1qWxxH6KYOQyaferaLmhX0q/cWAyEk+KoNn kGIz5j8siRlcWohPX//4EcN7VrwcjH5USQxbQYbFilTgOaKZzYJaIupWWKXPuJYXZ2iD J4448hEQEsEbscvidjR4Sx8882JRoylSFJCQcNQMWxrPKCgPoZExBCD2aNKZBlOmK/3X CriQ== MIME-Version: 1.0 Received: by 10.58.137.7 with SMTP id qe7mr1447440veb.23.1355381384499; Wed, 12 Dec 2012 22:49:44 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.58.201.202 with HTTP; Wed, 12 Dec 2012 22:49:44 -0800 (PST) In-Reply-To: <50C97A11.10409@FreeBSD.org> References: <201212110708.qBB78EWx025288@svn.freebsd.org> <201212121046.43706.jhb@freebsd.org> <201212121658.49048.jhb@freebsd.org> <50C90567.8080406@FreeBSD.org> <50C97A11.10409@FreeBSD.org> Date: Wed, 12 Dec 2012 22:49:44 -0800 X-Google-Sender-Auth: OQN6cNSMm9onv_qMTruGyumRgts Message-ID: Subject: Re: svn commit: r244112 - head/sys/kern From: Adrian Chadd To: Andriy Gapon Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Alfred Perlstein , src-committers@freebsd.org, John Baldwin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 13 Dec 2012 06:49:46 -0000 Let me restate it again. We can ship a STABLE kernel with INVARIANTS enabled, and it not be any less stable than the STABLE kernel is today. Adrian From owner-svn-src-head@FreeBSD.ORG Thu Dec 13 06:51:25 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 80A247C5; Thu, 13 Dec 2012 06:51:25 +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 986C88FC0A; Thu, 13 Dec 2012 06:51:23 +0000 (UTC) Received: from porto.starpoint.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 IAA11190; Thu, 13 Dec 2012 08:51:21 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1Tj2dd-000Mmz-6U; Thu, 13 Dec 2012 08:51:21 +0200 Message-ID: <50C97AE8.1040806@FreeBSD.org> Date: Thu, 13 Dec 2012 08:51:20 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Adrian Chadd Subject: Re: svn commit: r244112 - head/sys/kern References: <201212110708.qBB78EWx025288@svn.freebsd.org> <201212121046.43706.jhb@freebsd.org> <201212121658.49048.jhb@freebsd.org> <50C904B8.6000502@mu.org> <50C90641.4030000@FreeBSD.org> In-Reply-To: X-Enigmail-Version: 1.4.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Alfred Perlstein , John Baldwin , svn-src-all@FreeBSD.org, Alfred Perlstein , src-committers@FreeBSD.org, svn-src-head@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 13 Dec 2012 06:51:25 -0000 on 13/12/2012 00:43 Adrian Chadd said the following: > On 12 December 2012 14:33, Andriy Gapon wrote: > >>> Yes, two of my employers were more of "we want to get more debug metrics, we >>> have the spare cycles, but we can't deal with superfluous panics". >>> >>> It also allows us "non-architects" to slip in a debug image when we have spare >>> cpu without getting yelled at for "crashing the $foo". >> >> There is clearly something wrong with this sort of mentality. >> >> If you find instances where a developer put panic(9) (or KASSERT or etc) to mean >> "maybe here is a bug, let's just panic", then let's get those things fixed. >> >> But most of assertions in our code that are know to me really mean that a real >> bug has already occurred, that portions of kernel state are corrupted and there >> is no going back to a sane state, only going forward to corrupting more and more. > > Dude, if you're running -STABLE right now, you don't have invariants > enabled and you aren't checking for them. > So right now, as it stands, large swaths of our kernel code are > falling afoul of what you're calling Alfred out on. Pal, it's because there are people who thoroughly and regularly test code with INVARIANTS that the code with or without INVARIANTS does not crash as often as it could. When I tested the code with INVARIANTS I trust it to run without those and if a user get a mystery panic one of the first things to advise is to enable various debugging options. > Before you all reply, please review and understand the difference > between "panic()" and "KASSERT()". panic() is not being changed here. > KASSERT() is what's being changed here. panic() is not optional. > KASSERT() is. With a non-INVARIANTS kernel, we _are not checking > invariants_ and we are continuing to run _after_ said non-compiled-in > invariants. With this in mind, please re-review this. :-) KASSERT is not optional contrary to your opinion. We elect to not compile it in for performance reasons, but it is not optional when it is compiled in. -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Thu Dec 13 07:02:51 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9D8DDDD9; Thu, 13 Dec 2012 07:02:51 +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 BD6878FC0C; Thu, 13 Dec 2012 07:02:49 +0000 (UTC) Received: from porto.starpoint.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 JAA11240; Thu, 13 Dec 2012 09:02:46 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1Tj2of-000MnT-UA; Thu, 13 Dec 2012 09:02:46 +0200 Message-ID: <50C97D94.1090603@FreeBSD.org> Date: Thu, 13 Dec 2012 09:02:44 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Alfred Perlstein Subject: Re: svn commit: r244112 - head/sys/kern References: <201212110708.qBB78EWx025288@svn.freebsd.org> <201212121046.43706.jhb@freebsd.org> <201212121658.49048.jhb@freebsd.org> <50C90567.8080406@FreeBSD.org> <50C909BD.9090709@mu.org> In-Reply-To: <50C909BD.9090709@mu.org> X-Enigmail-Version: 1.4.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Adrian Chadd , src-committers@FreeBSD.org, John Baldwin , svn-src-all@FreeBSD.org, Alfred Perlstein , svn-src-head@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 13 Dec 2012 07:02:51 -0000 on 13/12/2012 00:48 Alfred Perlstein said the following: > On 12/12/12 2:29 PM, Andriy Gapon wrote: >> Now we get a new middle-ground: get both worse performance (because KASSERTs >> are compiled in) and a risk of harming your data (because KASSERTs no longer >> panic). The upside: there is no panic! There's just a log message (or etc). >> and chance to get more log messages because the insanity propagates. And a >> chance to lose your data (your customer's) - but I've already mentioned this. >> I am not sure that I like this kind of middle-ground. > I have a number of points here: > > The most important one being: > 1) without kassert you would still have the bug, just that it would be unreported. > The upside: there is no panic! There's **NO** log message (or etc). and chance > to get more log messages because the insanity propagates. > > Terrible! > > Let me explain that again: > If you don't compile in KASSERT, then it's not like the condition is never going > to happen. Instead it will just be unreported. > > So to put it in your own words, *without* KASSERT you get: > > The upside: there is no panic! There's **NO** log message (or etc). and chance > to get more log messages because the insanity propagates. I disagree with your base premise. I think that the issue will get reported anyway. If the code has gone insane you will get a crash, it just would be much harder to debug. > Now let's get to the other points: > > 2) Since this is not the default, then I do not understand why you are so > concerned. I am concerned about the code becoming less clear and thus harder to maintain. I am also concerned about code with INVARIANTS becoming even more slow. > 3) Can you explain to me why it is so upsetting to you that someone might be > able to use this functionality? That is not upsetting to me at all. 'Someone' could develop the code in his branch / repo. Someone can provide the code for testing and review to his customers and other interested users. Someone may evaluate practical usefulness of the code and only then commit it to the tree. As far as I can see, no one had a chance yet to see how this code is really useful in practice. Yet the code is already in the tree. > 4) *puts on flame retardant suit* ... Linux has had this for over a decade and > it's allowed them to find bugs in different ways. Mind you, in Linux it was the > default. Can't comment. But if you wanted to add some equivalent of WARN_ON, then I would have zero objection to that. I want to have a clear distinction between "this can't happen" and "it's weird that this happened". KASSERT is not for error checking or for spotting funny situations. It's for asserting sanity in the code as its name implies. > 5) Adrian and I have both stated that we need this sort of functionality to > avoid superfluous panics in our work environments while still getting bug feedback. Good. Please use this code. > Can we now please stop arguing over a non-default option that will help some > vendors report bugs to the project? Please do use this code, please do report the bugs. Please postpone putting this code into the tree until its benefits are seen. -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Thu Dec 13 07:08:05 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6A3781F0; Thu, 13 Dec 2012 07:08:05 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-vb0-f54.google.com (mail-vb0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id 55E728FC08; Thu, 13 Dec 2012 07:08:04 +0000 (UTC) Received: by mail-vb0-f54.google.com with SMTP id l1so1808054vba.13 for ; Wed, 12 Dec 2012 23:07:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=OnXCzZC2B8QhuWFn/HMJKmbxAoeQiNIHesT5wmfFH3E=; b=KAK/53K7YdflLAvccDXJcp8xz/bK21TLRIE/pLo6NrGNU4x0avj5ngBgP5CBQD0eA9 EGrjIqrooMmLffSfjLx804Qz4fLxvGHGuGuRPFT72IwvHd/VrlDiI9kaXM3tZvOfQh/l zJnzevitLrmuPbM7Wnet8cm0G5/JKmnTt2nJdO5f0PLZqdUU9eDPvKSaQtu6thbPEp02 hYn6ijzhZe8ZE/Fr+JlFA1QuTyITNOczWWF8DwjElX5/NyaUkKinYoNDXehdhak4NWEE qieS/y6UlMK5MCDoi23wbGXxMIqzXOkBLDKNLPzNRyye1sV4LLdgLZvAkU8qMrjTslDm eV9w== MIME-Version: 1.0 Received: by 10.52.97.230 with SMTP id ed6mr1247623vdb.90.1355382478581; Wed, 12 Dec 2012 23:07:58 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.58.201.202 with HTTP; Wed, 12 Dec 2012 23:07:58 -0800 (PST) In-Reply-To: <50C97D94.1090603@FreeBSD.org> References: <201212110708.qBB78EWx025288@svn.freebsd.org> <201212121046.43706.jhb@freebsd.org> <201212121658.49048.jhb@freebsd.org> <50C90567.8080406@FreeBSD.org> <50C909BD.9090709@mu.org> <50C97D94.1090603@FreeBSD.org> Date: Wed, 12 Dec 2012 23:07:58 -0800 X-Google-Sender-Auth: LWROwOTi2LNmd3SRAFZ7VisolLs Message-ID: Subject: Re: svn commit: r244112 - head/sys/kern From: Adrian Chadd To: Andriy Gapon Content-Type: text/plain; charset=ISO-8859-1 Cc: Alfred Perlstein , John Baldwin , svn-src-all@freebsd.org, Alfred Perlstein , src-committers@freebsd.org, svn-src-head@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 13 Dec 2012 07:08:05 -0000 Andriy, If you are willing to enable INVARIANTS by default in GENERIC, right now, then I think we should remove Alfred's work. Adrian From owner-svn-src-head@FreeBSD.ORG Thu Dec 13 07:09:11 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 884C5376; Thu, 13 Dec 2012 07:09:11 +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 C75778FC0C; Thu, 13 Dec 2012 07:09:09 +0000 (UTC) Received: from porto.starpoint.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 JAA11293; Thu, 13 Dec 2012 09:09:08 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1Tj2up-000Mnw-JK; Thu, 13 Dec 2012 09:09:07 +0200 Message-ID: <50C97F12.9070905@FreeBSD.org> Date: Thu, 13 Dec 2012 09:09:06 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Adrian Chadd Subject: Re: svn commit: r244112 - head/sys/kern References: <201212110708.qBB78EWx025288@svn.freebsd.org> <201212121046.43706.jhb@freebsd.org> <201212121658.49048.jhb@freebsd.org> <50C90567.8080406@FreeBSD.org> <50C97A11.10409@FreeBSD.org> In-Reply-To: X-Enigmail-Version: 1.4.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, Alfred Perlstein , src-committers@FreeBSD.org, John Baldwin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 13 Dec 2012 07:09:11 -0000 on 13/12/2012 08:49 Adrian Chadd said the following: > Let me restate it again. > > We can ship a STABLE kernel with INVARIANTS enabled, and it not be any > less stable than the STABLE kernel is today. STABLE != stable, of course. And it will be much much slower, so no one (of the regular users) would use it. It seems like you are missing a point of KASSERT a little bit, the part why it is a compile-time option and not a run-time thing. -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Thu Dec 13 07:11:14 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0D773504; Thu, 13 Dec 2012 07:11:14 +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 474F48FC08; Thu, 13 Dec 2012 07:11:11 +0000 (UTC) Received: from porto.starpoint.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 JAA11321; Thu, 13 Dec 2012 09:11:10 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1Tj2wo-000MoA-FK; Thu, 13 Dec 2012 09:11:10 +0200 Message-ID: <50C97F8D.6010504@FreeBSD.org> Date: Thu, 13 Dec 2012 09:11:09 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Adrian Chadd Subject: Re: svn commit: r244112 - head/sys/kern References: <201212110708.qBB78EWx025288@svn.freebsd.org> <201212121046.43706.jhb@freebsd.org> <201212121658.49048.jhb@freebsd.org> <50C90567.8080406@FreeBSD.org> <50C909BD.9090709@mu.org> <50C97D94.1090603@FreeBSD.org> In-Reply-To: X-Enigmail-Version: 1.4.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Alfred Perlstein , John Baldwin , svn-src-all@FreeBSD.org, Alfred Perlstein , src-committers@FreeBSD.org, svn-src-head@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 13 Dec 2012 07:11:14 -0000 on 13/12/2012 09:07 Adrian Chadd said the following: > Andriy, > > If you are willing to enable INVARIANTS by default in GENERIC, right > now, then I think we should remove Alfred's work. I do not see any connection. INVARIANTS in !CURRENT will not be enabled in GENERIC regardless of Alfred'd work. INVARIANTS in CURRENT are and will be enabled in GENERIC regardless of Alfred'd work. -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Thu Dec 13 07:16:45 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 706076D5; Thu, 13 Dec 2012 07:16:45 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-vb0-f54.google.com (mail-vb0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id 6BD798FC12; Thu, 13 Dec 2012 07:16:44 +0000 (UTC) Received: by mail-vb0-f54.google.com with SMTP id l1so1815088vba.13 for ; Wed, 12 Dec 2012 23:16:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=LNkcb8lnXomVOh0Gdf7xAg0L4z9CvO0oOWkHh5I+QXk=; b=ipak5/qjmWMDXrhg7cZ9xvCUP5WFRySfsMjEo+RKZ8sZ8yAH3DPk5tM+XyvAPGNBhX Ehc7pR5TMI3YlTEa4bY7/VeOmbHUA8mz6bs5m/cFH1kctaTpY2n87r7KFy5eheyj8T59 lvCHM6F1ZOlBDA0wPPuTaU8Nf6LLB4C/nOVFaUWj9AbfpriPe4VyRQ5wcoxpZMRqpKaT A8MyBCUGHSBgJR9x0rbtLCDhlwDQdup6GEZGqwcmo+wzkLYX1kA/ttTP8JvP51LfEYMI NdEkizyBe+K9UAwIDIFGgJVdYBrVaHRGmk+O2J3aSg2cHyjSUdOdnsIC6g1S1Z6Xkb1x NFxQ== MIME-Version: 1.0 Received: by 10.220.240.141 with SMTP id la13mr1432406vcb.39.1355383003960; Wed, 12 Dec 2012 23:16:43 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.58.201.202 with HTTP; Wed, 12 Dec 2012 23:16:43 -0800 (PST) In-Reply-To: <50C97F8D.6010504@FreeBSD.org> References: <201212110708.qBB78EWx025288@svn.freebsd.org> <201212121046.43706.jhb@freebsd.org> <201212121658.49048.jhb@freebsd.org> <50C90567.8080406@FreeBSD.org> <50C909BD.9090709@mu.org> <50C97D94.1090603@FreeBSD.org> <50C97F8D.6010504@FreeBSD.org> Date: Wed, 12 Dec 2012 23:16:43 -0800 X-Google-Sender-Auth: Vayzg2eoYuN5MSuygQWldQG7xkw Message-ID: Subject: Re: svn commit: r244112 - head/sys/kern From: Adrian Chadd To: Andriy Gapon Content-Type: text/plain; charset=ISO-8859-1 Cc: Alfred Perlstein , John Baldwin , svn-src-all@freebsd.org, Alfred Perlstein , src-committers@freebsd.org, svn-src-head@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 13 Dec 2012 07:16:45 -0000 Hi, I think the fundamental problem here is we have some pretty different ideas of what KASSERT should be, versus what it actually is in various parts of the code. Since we're lost in semantics, we're not going to get any further on this discussion just for now, so let's take a break and think about other things for now. adrian From owner-svn-src-head@FreeBSD.ORG Thu Dec 13 07:19:47 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A9701876; Thu, 13 Dec 2012 07:19:47 +0000 (UTC) (envelope-from nparhar@gmail.com) Received: from mail-pa0-f54.google.com (mail-pa0-f54.google.com [209.85.220.54]) by mx1.freebsd.org (Postfix) with ESMTP id 47FAB8FC0A; Thu, 13 Dec 2012 07:19:46 +0000 (UTC) Received: by mail-pa0-f54.google.com with SMTP id bi5so1220999pad.13 for ; Wed, 12 Dec 2012 23:19:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=0Hcy4RyoG7WmTFcwxOtiV1uKhUEa8fEfowbDKKgArRs=; b=MMgExAhiDEPTbmghsN3dc3Lfyi79E4I3pINOFyz0TWlz7zEvDH7nnOV8oys9KAsPBO kDyS6A1vXPii0+nLqINM7dhvFvfTxhu1iBO83fqfI6o1cXD3VHARNvW4Q7co7eEUY6Rt 4lNxcGzsCK4FFDLJkc+rakZtBSB6LaVAAA7NylkgeCx/u9/5TRJfx1Sw27l5j/LJ5eLC HXTrCNRnd1FhadCoSiBNII/LcsimmQMDQ58CNB9QhSOc22eCgvnIZiNf3PziwGInK5mI AL0o5i2L9n01hDBycCY38mv9iZ+eJ2IaX7wpXp2nt0fmeOO3TWT7OuCqaMSC1QIDgvmF f8Bg== Received: by 10.66.79.166 with SMTP id k6mr3830480pax.25.1355383185821; Wed, 12 Dec 2012 23:19:45 -0800 (PST) Received: from itx (c-24-6-45-85.hsd1.ca.comcast.net. [24.6.45.85]) by mx.google.com with ESMTPS id gv9sm549628pbc.21.2012.12.12.23.19.44 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 12 Dec 2012 23:19:45 -0800 (PST) Date: Wed, 12 Dec 2012 23:19:38 -0800 From: Navdeep Parhar To: Adrian Chadd Subject: Re: svn commit: r244112 - head/sys/kern Message-ID: <20121213071938.GA2074@itx> Mail-Followup-To: Adrian Chadd , Andriy Gapon , Alfred Perlstein , John Baldwin , Alfred Perlstein , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201212110708.qBB78EWx025288@svn.freebsd.org> <201212121046.43706.jhb@freebsd.org> <201212121658.49048.jhb@freebsd.org> <50C90567.8080406@FreeBSD.org> <50C909BD.9090709@mu.org> <50C97D94.1090603@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) Cc: Alfred Perlstein , John Baldwin , svn-src-all@freebsd.org, Alfred Perlstein , Andriy Gapon , src-committers@freebsd.org, svn-src-head@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 13 Dec 2012 07:19:47 -0000 On Wed, Dec 12, 2012 at 11:07:58PM -0800, Adrian Chadd wrote: > Andriy, > > If you are willing to enable INVARIANTS by default in GENERIC, right > now, then I think we should remove Alfred's work. It's already enabled by default in GENERIC in the development branch (aka head), which is exactly the right thing to do. Surely, you're not advocating we enable it by default in any release branch? Regards, Navdeep From owner-svn-src-head@FreeBSD.ORG Thu Dec 13 07:22:52 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 94A5F9FB; Thu, 13 Dec 2012 07:22:52 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-vc0-f182.google.com (mail-vc0-f182.google.com [209.85.220.182]) by mx1.freebsd.org (Postfix) with ESMTP id 621148FC08; Thu, 13 Dec 2012 07:22:51 +0000 (UTC) Received: by mail-vc0-f182.google.com with SMTP id fo14so1855751vcb.13 for ; Wed, 12 Dec 2012 23:22:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=uatyFkQAN5gTwi+upmX3Fk3S7alT6uXgsqsNr8/2VEE=; b=m0JHvp+FVOgkVSoEWbFaZQwr6V/EDuIFWk+XJ/0EVzmgBzGilsziJcFztyn7D5IMKz nDU6PKXjW0QgQZhxoMlJDYyARqRL7Z5x1ewOOZbtx8KtmYKDIu/RVqamhVyyJ9OcyJMV rYcZQcslBw1YIXp5HOm6D1rekTc1hcX6pCaDQ5xbBDd3+S4pm9EaiTx996s2I5K5QoZl rOdSBa8aNZp2vSi1IQ+jseCLu+cIqazeQDnekkgqccAoJb/iYvCe0H8w5vQnjz7XqgPx /IISWkryz/U8zjUlJY9QQhr5BJz6LhowIrBFWJXKO2q6nheWAJdnO2ayukX8Ol7B0hPW FBMw== MIME-Version: 1.0 Received: by 10.52.67.133 with SMTP id n5mr1351397vdt.24.1355383370875; Wed, 12 Dec 2012 23:22:50 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.58.201.202 with HTTP; Wed, 12 Dec 2012 23:22:50 -0800 (PST) In-Reply-To: <20121213071938.GA2074@itx> References: <201212110708.qBB78EWx025288@svn.freebsd.org> <201212121046.43706.jhb@freebsd.org> <201212121658.49048.jhb@freebsd.org> <50C90567.8080406@FreeBSD.org> <50C909BD.9090709@mu.org> <50C97D94.1090603@FreeBSD.org> <20121213071938.GA2074@itx> Date: Wed, 12 Dec 2012 23:22:50 -0800 X-Google-Sender-Auth: v6d_jHq8RFZLF1fkCgG92hS7r4A Message-ID: Subject: Re: svn commit: r244112 - head/sys/kern From: Adrian Chadd To: Adrian Chadd , Andriy Gapon , Alfred Perlstein , John Baldwin , Alfred Perlstein , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 13 Dec 2012 07:22:52 -0000 On 12 December 2012 23:19, Navdeep Parhar wrote: > On Wed, Dec 12, 2012 at 11:07:58PM -0800, Adrian Chadd wrote: >> Andriy, >> >> If you are willing to enable INVARIANTS by default in GENERIC, right >> now, then I think we should remove Alfred's work. > > It's already enabled by default in GENERIC in the development branch > (aka head), which is exactly the right thing to do. Surely, you're not > advocating we enable it by default in any release branch? I'm sure at least one vendor out there would love to ship GENERIC + INVARIANTS minus the panic bit, so they get all of the invariants reporting and checking, but none of the panicing (which wouldn't occur if INVARIANTS wasn't compiled in.) WITNESS is still slow, but after I fixed a rather hilarious strlen() abuse in it, it actually started to be more useful to enable at runtime on my test equipment by default. Before I fixed that strlen() issue, I couldn't get anywhere near line rate ethernet/wifi throughput, so I didn't want to leave it on. Adrian From owner-svn-src-head@FreeBSD.ORG Thu Dec 13 08:58:46 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A2368742; Thu, 13 Dec 2012 08:58:46 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) by mx1.freebsd.org (Postfix) with ESMTP id A19E78FC1F; Thu, 13 Dec 2012 08:58:45 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.5/8.14.5) with ESMTP id qBD8wbpc009053; Thu, 13 Dec 2012 12:58:37 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.5/8.14.5/Submit) id qBD8wb8S009052; Thu, 13 Dec 2012 12:58:37 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 13 Dec 2012 12:58:37 +0400 From: Gleb Smirnoff To: Adrian Chadd Subject: Re: svn commit: r244112 - head/sys/kern Message-ID: <20121213085837.GO97487@FreeBSD.org> References: <201212110708.qBB78EWx025288@svn.freebsd.org> <201212121046.43706.jhb@freebsd.org> <201212121658.49048.jhb@freebsd.org> <50C90567.8080406@FreeBSD.org> <50C97A11.10409@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: src-committers@FreeBSD.org, John Baldwin , svn-src-all@FreeBSD.org, Alfred Perlstein , Andriy Gapon , svn-src-head@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 13 Dec 2012 08:58:46 -0000 On Wed, Dec 12, 2012 at 10:49:44PM -0800, Adrian Chadd wrote: A> Let me restate it again. A> A> We can ship a STABLE kernel with INVARIANTS enabled, and it not be any A> less stable than the STABLE kernel is today. It will be less stable, at least due to thrashing memory on free(9). Accessing memory after free(9) is a quite a common bug. However, with current semantics of KASSERT it will panic with good diagnostics and early, on malloc(9). With perverted semantics that Alfred suggests and you advocate it won't panic on malloc(9), but will panic later (no doubt that it will, if a thrashed pointer is dereferenced) with much more obscure diagnostics. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Thu Dec 13 09:02:22 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A0DE0924; Thu, 13 Dec 2012 09:02:22 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) by mx1.freebsd.org (Postfix) with ESMTP id 15A6E8FC15; Thu, 13 Dec 2012 09:02:21 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.5/8.14.5) with ESMTP id qBD92GoQ009087; Thu, 13 Dec 2012 13:02:16 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.5/8.14.5/Submit) id qBD92F3N009086; Thu, 13 Dec 2012 13:02:15 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 13 Dec 2012 13:02:15 +0400 From: Gleb Smirnoff To: Alfred Perlstein Subject: Re: svn commit: r244112 - head/sys/kern Message-ID: <20121213090215.GP97487@FreeBSD.org> References: <201212110708.qBB78EWx025288@svn.freebsd.org> <201212121046.43706.jhb@freebsd.org> <201212121658.49048.jhb@freebsd.org> <50C90567.8080406@FreeBSD.org> <50C909BD.9090709@mu.org> <50C91B32.4080904@FreeBSD.org> <50C91CD3.7030900@mu.org> <50C9206D.6080502@FreeBSD.org> <50C9271C.70803@mu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <50C9271C.70803@mu.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Adrian Chadd , src-committers@FreeBSD.org, John Baldwin , svn-src-all@FreeBSD.org, Alfred Perlstein , Andriy Gapon , Navdeep Parhar , svn-src-head@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 13 Dec 2012 09:02:22 -0000 On Wed, Dec 12, 2012 at 04:53:48PM -0800, Alfred Perlstein wrote: A> The problem again is that not all the KASSERTS are inviolable, if you A> want to do a project to split them, then please do, it would really be A> helpful, as for now, they are a mis-mash of death/warnings and there are A> at least three vendors who approve of this as well as 3 long term A> committers that approved my change (not including Adrian). Can you show examples of not inviolable KASSERTs? -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Thu Dec 13 09:05:59 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1DDA0C5A; Thu, 13 Dec 2012 09:05:59 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) by mx1.freebsd.org (Postfix) with ESMTP id 84F418FC12; Thu, 13 Dec 2012 09:05:57 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.5/8.14.5) with ESMTP id qBD95sOQ009111; Thu, 13 Dec 2012 13:05:54 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.5/8.14.5/Submit) id qBD95st1009110; Thu, 13 Dec 2012 13:05:54 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 13 Dec 2012 13:05:54 +0400 From: Gleb Smirnoff To: Adrian Chadd Subject: Re: svn commit: r244112 - head/sys/kern Message-ID: <20121213090554.GQ97487@FreeBSD.org> References: <201212110708.qBB78EWx025288@svn.freebsd.org> <201212121046.43706.jhb@freebsd.org> <201212121658.49048.jhb@freebsd.org> <50C90567.8080406@FreeBSD.org> <50C909BD.9090709@mu.org> <50C97D94.1090603@FreeBSD.org> <50C97F8D.6010504@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Alfred Perlstein , John Baldwin , svn-src-all@FreeBSD.org, Alfred Perlstein , Andriy Gapon , src-committers@FreeBSD.org, svn-src-head@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 13 Dec 2012 09:05:59 -0000 On Wed, Dec 12, 2012 at 11:16:43PM -0800, Adrian Chadd wrote: A> I think the fundamental problem here is we have some pretty different A> ideas of what KASSERT should be, versus what it actually is in various A> parts of the code. Yep, under "we" you probably meant you and Alfred. What both of you mean is something that might be named KWARN() or KWARNING(). You are welcome to introduce it and put them into kernel code whereever you want. All current assertions (okay, not all, but vast majority of them) are assertions, not warnings. Their semantics can't be changed to warnings. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Thu Dec 13 09:29:20 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2F67B247; Thu, 13 Dec 2012 09:29:20 +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 7E6728FC0C; Thu, 13 Dec 2012 09:29:18 +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 LAA12912; Thu, 13 Dec 2012 11:29:16 +0200 (EET) (envelope-from avg@FreeBSD.org) Message-ID: <50C99FEB.6050500@FreeBSD.org> Date: Thu, 13 Dec 2012 11:29:15 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Adrian Chadd Subject: Re: svn commit: r244112 - head/sys/kern References: <201212110708.qBB78EWx025288@svn.freebsd.org> <201212121046.43706.jhb@freebsd.org> <201212121658.49048.jhb@freebsd.org> <50C90567.8080406@FreeBSD.org> <50C909BD.9090709@mu.org> <50C97D94.1090603@FreeBSD.org> <50C97F8D.6010504@FreeBSD.org> In-Reply-To: X-Enigmail-Version: 1.4.6 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: Alfred Perlstein , John Baldwin , svn-src-all@FreeBSD.org, Alfred Perlstein , src-committers@FreeBSD.org, svn-src-head@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 13 Dec 2012 09:29:20 -0000 on 13/12/2012 09:16 Adrian Chadd said the following: > Hi, > > I think the fundamental problem here is we have some pretty different > ideas of what KASSERT should be, versus what it actually is in various > parts of the code. > > Since we're lost in semantics, we're not going to get any further on > this discussion just for now, so let's take a break and think about > other things for now. +1 :) -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Thu Dec 13 09:41:33 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5539B6B9; Thu, 13 Dec 2012 09:41:33 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3A11E8FC13; Thu, 13 Dec 2012 09:41:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBD9fXnQ000670; Thu, 13 Dec 2012 09:41:33 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBD9fX64000669; Thu, 13 Dec 2012 09:41:33 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201212130941.qBD9fX64000669@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 13 Dec 2012 09:41:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244181 - head/etc/rc.d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 13 Dec 2012 09:41:33 -0000 Author: pjd Date: Thu Dec 13 09:41:32 2012 New Revision: 244181 URL: http://svnweb.freebsd.org/changeset/base/244181 Log: Fix the location of auditdistd configuration file. Reported by: Johan Hendriks Modified: head/etc/rc.d/auditdistd Modified: head/etc/rc.d/auditdistd ============================================================================== --- head/etc/rc.d/auditdistd Thu Dec 13 06:45:45 2012 (r244180) +++ head/etc/rc.d/auditdistd Thu Dec 13 09:41:32 2012 (r244181) @@ -14,7 +14,7 @@ name="auditdistd" rcvar="${name}_enable" pidfile="/var/run/${name}.pid" command="/usr/sbin/${name}" -required_files="/etc/${name}.conf" +required_files="/etc/security/${name}.conf" extra_commands="reload" load_rc_config $name From owner-svn-src-head@FreeBSD.ORG Thu Dec 13 09:43:00 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B9267853; Thu, 13 Dec 2012 09:43:00 +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 130598FC08; Thu, 13 Dec 2012 09:42:58 +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 LAA13059; Thu, 13 Dec 2012 11:42:57 +0200 (EET) (envelope-from avg@FreeBSD.org) Message-ID: <50C9A321.5060407@FreeBSD.org> Date: Thu, 13 Dec 2012 11:42:57 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Adrian Chadd Subject: Re: svn commit: r244112 - head/sys/kern References: <201212110708.qBB78EWx025288@svn.freebsd.org> <201212121046.43706.jhb@freebsd.org> <201212121658.49048.jhb@freebsd.org> <50C90567.8080406@FreeBSD.org> <50C909BD.9090709@mu.org> <50C97D94.1090603@FreeBSD.org> <50C97F8D.6010504@FreeBSD.org> In-Reply-To: X-Enigmail-Version: 1.4.6 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: Alfred Perlstein , John Baldwin , svn-src-all@FreeBSD.org, Alfred Perlstein , src-committers@FreeBSD.org, svn-src-head@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 13 Dec 2012 09:43:00 -0000 on 13/12/2012 09:16 Adrian Chadd said the following: > Hi, > > I think the fundamental problem here is we have some pretty different > ideas of what KASSERT should be, versus what it actually is in various > parts of the code. Oh, and another part of the problem is that the discussion is opinion based. But it didn't have to be. Compare this: We think that feature F is a very good idea, we think that it will be used by many people and it will provide a lot of benefits. So here you are - the code is in the tree. To this: We have been using feature F, it has proved to be a very good idea as it provided these benefits and spared us from these problems. So here you are - the code is in the tree. If I have a differing opinion in the first case I usually state it (and can be pulled into an argument about it). If I have a different opinion in the second case, I try to adjust my opinion to the stated reality. > Since we're lost in semantics, we're not going to get any further on > this discussion just for now, so let's take a break and think about > other things for now. -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Thu Dec 13 09:55:27 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 812AAEFB; Thu, 13 Dec 2012 09:55:27 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 66BBF8FC08; Thu, 13 Dec 2012 09:55:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBD9tRXN002902; Thu, 13 Dec 2012 09:55:27 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBD9tRWu002901; Thu, 13 Dec 2012 09:55:27 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201212130955.qBD9tRWu002901@svn.freebsd.org> From: Steven Hartland Date: Thu, 13 Dec 2012 09:55:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244182 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 13 Dec 2012 09:55:27 -0000 Author: smh Date: Thu Dec 13 09:55:26 2012 New Revision: 244182 URL: http://svnweb.freebsd.org/changeset/base/244182 Log: Fixed missing 'n' of \n for my committers line Approved by: avg (mentor) Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Thu Dec 13 09:41:32 2012 (r244181) +++ head/share/misc/committers-src.dot Thu Dec 13 09:55:26 2012 (r244182) @@ -250,7 +250,7 @@ sephe [label="Sepherosa Ziehau\nsephe@Fr sepotvin [label="Stephane E. Potvin\nsepotvin@FreeBSD.org\n2007/02/15"] simon [label="Simon L. Nielsen\nsimon@FreeBSD.org\n2006/03/07"] sjg [label="Simon J. Gerraty\nsjg@FreeBSD.org\n2012/10/23"] -smh [label="Steven Hartland\smh@FreeBSD.org\n2012/11/12"] +smh [label="Steven Hartland\nsmh@FreeBSD.org\n2012/11/12"] sobomax [label="Maxim Sobolev\nsobomax@FreeBSD.org\n2001/07/25"] sos [label="Soren Schmidt\nsos@FreeBSD.org\n????/??/??"] sson [label="Stacey Son\nsson@FreeBSD.org\n2008/07/08"] From owner-svn-src-head@FreeBSD.ORG Thu Dec 13 10:59:52 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 89FABAF9; Thu, 13 Dec 2012 10:59: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 3D68D8FC0A; Thu, 13 Dec 2012 10:59: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 MAA14153; Thu, 13 Dec 2012 12:59:49 +0200 (EET) (envelope-from avg@FreeBSD.org) Message-ID: <50C9B525.2060503@FreeBSD.org> Date: Thu, 13 Dec 2012 12:59:49 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: attilio@FreeBSD.org Subject: Re: svn commit: r243515 - head/sys/kern References: <201211251422.qAPEM8BV074656@svn.freebsd.org> In-Reply-To: X-Enigmail-Version: 1.4.6 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 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 13 Dec 2012 10:59:52 -0000 on 09/12/2012 19:27 Attilio Rao said the following: > On Sun, Nov 25, 2012 at 2:22 PM, Andriy Gapon wrote: >> Author: avg >> Date: Sun Nov 25 14:22:08 2012 >> New Revision: 243515 >> URL: http://svnweb.freebsd.org/changeset/base/243515 >> >> Log: >> remove stop_scheduler_on_panic knob >> >> There has not been any complaints about the default behavior, so there >> is no need to keep a knob that enables the worse alternative. >> >> Now that the hard-stopping of other CPUs is the only behavior, the panic_cpu >> spinlock-like logic can be dropped, because only a single CPU is >> supposed to win stop_cpus_hard(other_cpus) race and proceed past that >> call. > > While this is true for the sane case, for the case report by Ryan this > still breaks. Yes. I haven't got around to start fixing the Ryan's problem yet. But this commit should reduce number of places where changes have to be made. In fact, I think that only stop_cpus_X would have to be fixed now. > Infact, immagine CPU0 (winner) and CPU1 (looser) both panic'ing. CPU0 > wins and then sets stopping_cpu. When the deadlock happens in the > spinning loop, because of generic_stop_cpus() logic CPU0 won't > deadlock and will correctly continue, but the problem is that it sets > back stopping_cpu to NOCPU, letting CPU1 continuing too and then > deadlocking. > > At the minimum, what I think that should happen is to have the check > in panic() as prior this change but with the add I outlined (thus we > need to generalize cpustop_handler()). However, it seems to me that > generic_stop_cpus() may still be broken by this and we eventually need > to fix it. > > I would then revert this part of the patch and fix it appropriately. > Later we can better discuss the generic_stop_cpus() similar race. I actually see this change and the Ryan's problem as orthogonal issues. My opinion is let's just fix generic_stop_cpus(). -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Thu Dec 13 11:00:30 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1F183D05; Thu, 13 Dec 2012 11:00:30 +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 C6D608FC13; Thu, 13 Dec 2012 11:00:28 +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 NAA14185; Thu, 13 Dec 2012 13:00:27 +0200 (EET) (envelope-from avg@FreeBSD.org) Message-ID: <50C9B54B.1080302@FreeBSD.org> Date: Thu, 13 Dec 2012 13:00:27 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: John Baldwin Subject: Re: svn commit: r243764 - head/sys/x86/x86 References: <201212011816.qB1IGE2Y064317@svn.freebsd.org> <201212061540.42393.jhb@freebsd.org> In-Reply-To: <201212061540.42393.jhb@freebsd.org> X-Enigmail-Version: 1.4.6 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 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 13 Dec 2012 11:00:30 -0000 on 06/12/2012 22:40 John Baldwin said the following: > On Saturday, December 01, 2012 1:16:14 pm Andriy Gapon wrote: >> Author: avg >> Date: Sat Dec 1 18:16:14 2012 >> New Revision: 243764 >> URL: http://svnweb.freebsd.org/changeset/base/243764 >> >> Log: >> ioapic_program_intpin: program high bits before low bits >> >> Programming the low bits has a side-effect if unmasking the pin if it is >> not disabled. So if an interrupt was pending then it would be delivered >> with the correct new vector but to the incorrect old LAPIC. >> >> This fix could be made clearer by preserving the mask bit while >> programming the low bits and then explicitly resetting the mask bit >> after all the programming is done. >> >> Probability to trip over the fixed bug could be increased by bootverbose >> because printing of the interrupt information in ioapic_assign_cpu >> lengthened the time window during which an interrupt could arrive while >> a pin is masked. > > Can you expand the comment to say that you write 'low' second since it may > clear the masked bit? > Will do. -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Thu Dec 13 11:11:13 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1028D119; Thu, 13 Dec 2012 11:11:13 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (garage.dawidek.net [91.121.88.72]) by mx1.freebsd.org (Postfix) with ESMTP id C002D8FC0A; Thu, 13 Dec 2012 11:11:12 +0000 (UTC) Received: from localhost (58.wheelsystems.com [83.12.187.58]) by mail.dawidek.net (Postfix) with ESMTPSA id DC8C632A; Thu, 13 Dec 2012 12:09:08 +0100 (CET) Date: Thu, 13 Dec 2012 12:12:44 +0100 From: Pawel Jakub Dawidek To: Konstantin Belousov Subject: Re: svn commit: r244154 - head/bin/ps Message-ID: <20121213111240.GB1381@garage.freebsd.pl> References: <201212121545.qBCFj4Hl086444@svn.freebsd.org> <20121212210652.GO3013@kib.kiev.ua> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="jho1yZJdad60DJr+" Content-Disposition: inline In-Reply-To: <20121212210652.GO3013@kib.kiev.ua> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, jhb@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 13 Dec 2012 11:11:13 -0000 --jho1yZJdad60DJr+ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Dec 12, 2012 at 11:06:52PM +0200, Konstantin Belousov wrote: > On Wed, Dec 12, 2012 at 03:45:04PM +0000, Pawel Jakub Dawidek wrote: > > Author: pjd > > Date: Wed Dec 12 15:45:03 2012 > > New Revision: 244154 > > URL: http://svnweb.freebsd.org/changeset/base/244154 > >=20 > > Log: > > Use kern.max_pid sysctl to obtain maximum PID number instead of using= local > > define. > It is pid_max, not max_pid. >=20 > But the change is wrong. The kern.pid_max only limits newly allocated pid= s, > it does not magically moves existing pids, which are out of range, to the > limited region. See the corresponding commit log for the description. > It was added to make it easier to run FreeBSD 1.x binaries on the modern > kernels. I saw CTLFLAG_TUN on the sysctl and assumed it is read-only... How about defining BSD_PID_MAX in sys/proc.h, which would be visible by userland as well and setting PID_MAX to BSD_PID_MAX? This would also help bsnmpd. http://people.freebsd.org/~pjd/patches/PID_MAX.patch --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --jho1yZJdad60DJr+ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlDJuCgACgkQForvXbEpPzRgjwCg5aK3VpBBR4HjVyIAa37Pbu0C F3YAoKEH8BTD4QmtCIMn7J22qBqhQF8/ =uiYE -----END PGP SIGNATURE----- --jho1yZJdad60DJr+-- From owner-svn-src-head@FreeBSD.ORG Thu Dec 13 11:11:16 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B13AA11E; Thu, 13 Dec 2012 11:11:16 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7C7058FC12; Thu, 13 Dec 2012 11:11:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBDBBGi2017299; Thu, 13 Dec 2012 11:11:16 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBDBBFrk017294; Thu, 13 Dec 2012 11:11:15 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201212131111.qBDBBFrk017294@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 13 Dec 2012 11:11:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244183 - in head/sys: net netinet netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 13 Dec 2012 11:11:16 -0000 Author: glebius Date: Thu Dec 13 11:11:15 2012 New Revision: 244183 URL: http://svnweb.freebsd.org/changeset/base/244183 Log: Fix problem in r238990. The LLE_LINKED flag should be tested prior to entering llentry_free(), and in case if we lose the race, we should simply perform LLE_FREE_LOCKED(). Otherwise, if the race is lost by the thread performing arptimer(), it will remove two references from the lle instead of one. Reported by: Ian FREISLICH Modified: head/sys/net/if_llatbl.c head/sys/netinet/if_ether.c head/sys/netinet6/nd6.c Modified: head/sys/net/if_llatbl.c ============================================================================== --- head/sys/net/if_llatbl.c Thu Dec 13 09:55:26 2012 (r244182) +++ head/sys/net/if_llatbl.c Thu Dec 13 11:11:15 2012 (r244183) @@ -109,12 +109,6 @@ llentry_free(struct llentry *lle) IF_AFDATA_WLOCK_ASSERT(lle->lle_tbl->llt_ifp); LLE_WLOCK_ASSERT(lle); - /* XXX: guard against race with other llentry_free(). */ - if (!(lle->la_flags & LLE_LINKED)) { - LLE_FREE_LOCKED(lle); - return (0); - } - LIST_REMOVE(lle, lle_next); lle->la_flags &= ~(LLE_VALID | LLE_LINKED); Modified: head/sys/netinet/if_ether.c ============================================================================== --- head/sys/netinet/if_ether.c Thu Dec 13 09:55:26 2012 (r244182) +++ head/sys/netinet/if_ether.c Thu Dec 13 11:11:15 2012 (r244183) @@ -165,7 +165,6 @@ arptimer(void *arg) { struct llentry *lle = (struct llentry *)arg; struct ifnet *ifp; - size_t pkts_dropped; if (lle->la_flags & LLE_STATIC) { LLE_WUNLOCK(lle); @@ -192,11 +191,20 @@ arptimer(void *arg) IF_AFDATA_LOCK(ifp); LLE_WLOCK(lle); - LLE_REMREF(lle); - pkts_dropped = llentry_free(lle); + /* Guard against race with other llentry_free(). */ + if (lle->la_flags & LLE_LINKED) { + size_t pkts_dropped; + + LLE_REMREF(lle); + pkts_dropped = llentry_free(lle); + ARPSTAT_ADD(dropped, pkts_dropped); + } else + LLE_FREE_LOCKED(lle); + IF_AFDATA_UNLOCK(ifp); - ARPSTAT_ADD(dropped, pkts_dropped); + ARPSTAT_INC(timeouts); + CURVNET_RESTORE(); } Modified: head/sys/netinet6/nd6.c ============================================================================== --- head/sys/netinet6/nd6.c Thu Dec 13 09:55:26 2012 (r244182) +++ head/sys/netinet6/nd6.c Thu Dec 13 11:11:15 2012 (r244183) @@ -1108,8 +1108,14 @@ nd6_free(struct llentry *ln, int gc) LLE_WUNLOCK(ln); IF_AFDATA_LOCK(ifp); LLE_WLOCK(ln); - LLE_REMREF(ln); - llentry_free(ln); + + /* Guard against race with other llentry_free(). */ + if (ln->la_flags & LLE_LINKED) { + LLE_REMREF(ln); + llentry_free(ln); + } else + LLE_FREE_LOCKED(ln); + IF_AFDATA_UNLOCK(ifp); return (next); From owner-svn-src-head@FreeBSD.ORG Thu Dec 13 12:48:58 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 56A48511; Thu, 13 Dec 2012 12:48:58 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 397F28FC14; Thu, 13 Dec 2012 12:48:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBDCmwe1034918; Thu, 13 Dec 2012 12:48:58 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBDCmw26034917; Thu, 13 Dec 2012 12:48:58 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201212131248.qBDCmw26034917@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 13 Dec 2012 12:48:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244184 - head/sys/netpfil/pf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 13 Dec 2012 12:48:58 -0000 Author: glebius Date: Thu Dec 13 12:48:57 2012 New Revision: 244184 URL: http://svnweb.freebsd.org/changeset/base/244184 Log: Initialize state id prior to attaching state to key hash. Otherwise a race can happen, when pf_find_state() finds state via key hash, and locks id hash slot 0 instead of appropriate to state id slot. Modified: head/sys/netpfil/pf/pf.c Modified: head/sys/netpfil/pf/pf.c ============================================================================== --- head/sys/netpfil/pf/pf.c Thu Dec 13 11:11:15 2012 (r244183) +++ head/sys/netpfil/pf/pf.c Thu Dec 13 12:48:57 2012 (r244184) @@ -1080,9 +1080,6 @@ pf_state_insert(struct pfi_kif *kif, str s->kif = kif; - if (pf_state_key_attach(skw, sks, s)) - return (-1); - if (s->id == 0 && s->creatorid == 0) { /* XXX: should be atomic, but probability of collision low */ if ((s->id = V_pf_stateid[curcpu]++) == PFID_MAXID) @@ -1092,6 +1089,9 @@ pf_state_insert(struct pfi_kif *kif, str s->creatorid = V_pf_status.hostid; } + if (pf_state_key_attach(skw, sks, s)) + return (-1); + ih = &V_pf_idhash[PF_IDHASH(s)]; PF_HASHROW_LOCK(ih); LIST_FOREACH(cur, &ih->states, entry) From owner-svn-src-head@FreeBSD.ORG Thu Dec 13 12:51:23 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 67891772; Thu, 13 Dec 2012 12:51:23 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 34A598FC0A; Thu, 13 Dec 2012 12:51:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBDCpN6q035427; Thu, 13 Dec 2012 12:51:23 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBDCpNfg035426; Thu, 13 Dec 2012 12:51:23 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201212131251.qBDCpNfg035426@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 13 Dec 2012 12:51:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244185 - head/sys/netpfil/pf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 13 Dec 2012 12:51:23 -0000 Author: glebius Date: Thu Dec 13 12:51:22 2012 New Revision: 244185 URL: http://svnweb.freebsd.org/changeset/base/244185 Log: Merge rev. 1.119 from OpenBSD: date: 2009/03/31 01:21:29; author: dlg; state: Exp; lines: +9 -16 ... this also firms up some of the input parsing so it handles short frames a bit better. This actually fixes reading beyond mbuf data area in pfsync_input(), that may happen at certain pfsync datagrams. Modified: head/sys/netpfil/pf/if_pfsync.c Modified: head/sys/netpfil/pf/if_pfsync.c ============================================================================== --- head/sys/netpfil/pf/if_pfsync.c Thu Dec 13 12:48:57 2012 (r244184) +++ head/sys/netpfil/pf/if_pfsync.c Thu Dec 13 12:51:22 2012 (r244185) @@ -44,6 +44,7 @@ /* * Revisions picked from OpenBSD after revision 1.110 import: + * 1.119 - don't m_copydata() beyond the len of mbuf in pfsync_input() * 1.118, 1.124, 1.148, 1.149, 1.151, 1.171 - fixes to bulk updates * 1.120, 1.175 - use monotonic time_uptime * 1.122 - reduce number of updates for non-TCP sessions @@ -566,7 +567,7 @@ pfsync_input(struct mbuf *m, __unused in struct pfsync_header *ph; struct pfsync_subheader subh; - int offset; + int offset, len; int rv; uint16_t count; @@ -612,6 +613,12 @@ pfsync_input(struct mbuf *m, __unused in goto done; } + len = ntohs(ph->len) + offset; + if (m->m_pkthdr.len < len) { + pfsyncstats.pfsyncs_badlen++; + goto done; + } + /* Cheaper to grab this now than having to mess with mbufs later */ pkt.ip = ip; pkt.src = ip->ip_src; @@ -626,7 +633,7 @@ pfsync_input(struct mbuf *m, __unused in pkt.flags |= PFSYNC_SI_CKSUM; offset += sizeof(*ph); - for (;;) { + while (offset <= len - sizeof(subh)) { m_copydata(m, offset, sizeof(subh), (caddr_t)&subh); offset += sizeof(subh); @@ -1222,8 +1229,8 @@ static int pfsync_in_eof(struct pfsync_pkt *pkt, struct mbuf *m, int offset, int count) { /* check if we are at the right place in the packet */ - if (offset != m->m_pkthdr.len - sizeof(struct pfsync_eof)) - V_pfsyncstats.pfsyncs_badact++; + if (offset != m->m_pkthdr.len) + V_pfsyncstats.pfsyncs_badlen++; /* we're done. free and let the caller return */ m_freem(m); @@ -1592,8 +1599,6 @@ pfsync_sendout(int schedswi) subh->count = htons(1); V_pfsyncstats.pfsyncs_oacts[PFSYNC_ACT_EOF]++; - /* XXX write checksum in EOF here */ - /* we're done, let's put it on the wire */ if (ifp->if_bpf) { m->m_data += sizeof(*ip); From owner-svn-src-head@FreeBSD.ORG Thu Dec 13 16:12:50 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 604A73BD; Thu, 13 Dec 2012 16:12:50 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id B7E998FC08; Thu, 13 Dec 2012 16:12:49 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.5/8.14.5) with ESMTP id qBDGChaQ042136; Thu, 13 Dec 2012 18:12:43 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.7.1 kib.kiev.ua qBDGChaQ042136 Received: (from kostik@localhost) by tom.home (8.14.5/8.14.5/Submit) id qBDGChB2042135; Thu, 13 Dec 2012 18:12:43 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 13 Dec 2012 18:12:42 +0200 From: Konstantin Belousov To: Pawel Jakub Dawidek Subject: Re: svn commit: r244154 - head/bin/ps Message-ID: <20121213161242.GE71906@kib.kiev.ua> References: <201212121545.qBCFj4Hl086444@svn.freebsd.org> <20121212210652.GO3013@kib.kiev.ua> <20121213111240.GB1381@garage.freebsd.pl> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="zjcmjzIkjQU2rmur" Content-Disposition: inline In-Reply-To: <20121213111240.GB1381@garage.freebsd.pl> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, jhb@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 13 Dec 2012 16:12:50 -0000 --zjcmjzIkjQU2rmur Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Dec 13, 2012 at 12:12:44PM +0100, Pawel Jakub Dawidek wrote: > On Wed, Dec 12, 2012 at 11:06:52PM +0200, Konstantin Belousov wrote: > > On Wed, Dec 12, 2012 at 03:45:04PM +0000, Pawel Jakub Dawidek wrote: > > > Author: pjd > > > Date: Wed Dec 12 15:45:03 2012 > > > New Revision: 244154 > > > URL: http://svnweb.freebsd.org/changeset/base/244154 > > >=20 > > > Log: > > > Use kern.max_pid sysctl to obtain maximum PID number instead of usi= ng local > > > define. > > It is pid_max, not max_pid. > >=20 > > But the change is wrong. The kern.pid_max only limits newly allocated p= ids, > > it does not magically moves existing pids, which are out of range, to t= he > > limited region. See the corresponding commit log for the description. > > It was added to make it easier to run FreeBSD 1.x binaries on the modern > > kernels. >=20 > I saw CTLFLAG_TUN on the sysctl and assumed it is read-only... > How about defining BSD_PID_MAX in sys/proc.h, which would be visible by > userland as well and setting PID_MAX to BSD_PID_MAX? >=20 > This would also help bsnmpd. >=20 > http://people.freebsd.org/~pjd/patches/PID_MAX.patch Do you know why PID_MAX is under _KERNEL ? If there is no real reason, it would be better to move it outside kernel-only section. sys/proc.h is not in POSIX anyway. --zjcmjzIkjQU2rmur Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlDJ/noACgkQC3+MBN1Mb4j2ZgCeO92KcVRMVW2xcqobnFmWXwcN q2IAoM1XvZJdiTEAm9JwjQWk3epumwre =gZLA -----END PGP SIGNATURE----- --zjcmjzIkjQU2rmur-- From owner-svn-src-head@FreeBSD.ORG Thu Dec 13 16:54:07 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8BD31DE3; Thu, 13 Dec 2012 16:54:07 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (garage.dawidek.net [91.121.88.72]) by mx1.freebsd.org (Postfix) with ESMTP id 45A148FC0C; Thu, 13 Dec 2012 16:54:06 +0000 (UTC) Received: from localhost (58.wheelsystems.com [83.12.187.58]) by mail.dawidek.net (Postfix) with ESMTPSA id A04AB466; Thu, 13 Dec 2012 17:52:02 +0100 (CET) Date: Thu, 13 Dec 2012 17:55:41 +0100 From: Pawel Jakub Dawidek To: Konstantin Belousov Subject: Re: svn commit: r244154 - head/bin/ps Message-ID: <20121213165541.GD1381@garage.freebsd.pl> References: <201212121545.qBCFj4Hl086444@svn.freebsd.org> <20121212210652.GO3013@kib.kiev.ua> <20121213111240.GB1381@garage.freebsd.pl> <20121213161242.GE71906@kib.kiev.ua> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="7DO5AaGCk89r4vaK" Content-Disposition: inline In-Reply-To: <20121213161242.GE71906@kib.kiev.ua> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, jhb@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 13 Dec 2012 16:54:07 -0000 --7DO5AaGCk89r4vaK Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Dec 13, 2012 at 06:12:42PM +0200, Konstantin Belousov wrote: > On Thu, Dec 13, 2012 at 12:12:44PM +0100, Pawel Jakub Dawidek wrote: > > On Wed, Dec 12, 2012 at 11:06:52PM +0200, Konstantin Belousov wrote: > > I saw CTLFLAG_TUN on the sysctl and assumed it is read-only... > > How about defining BSD_PID_MAX in sys/proc.h, which would be visible by > > userland as well and setting PID_MAX to BSD_PID_MAX? > >=20 > > This would also help bsnmpd. > >=20 > > http://people.freebsd.org/~pjd/patches/PID_MAX.patch > Do you know why PID_MAX is under _KERNEL ? If there is no real reason, > it would be better to move it outside kernel-only section. sys/proc.h > is not in POSIX anyway. I assumed it will break some ports that may define it themselves. I wonder if we could do a test ports build to see what's the impact. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --7DO5AaGCk89r4vaK Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlDKCI0ACgkQForvXbEpPzQhBACeKtkeqZsdANgj63pYD1KFmWVD aAUAoMiFuZCGgUJkd+4iXP27Tw2oRqKi =blyC -----END PGP SIGNATURE----- --7DO5AaGCk89r4vaK-- From owner-svn-src-head@FreeBSD.ORG Thu Dec 13 17:06:39 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D80D253A; Thu, 13 Dec 2012 17:06:39 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BC8E18FC16; Thu, 13 Dec 2012 17:06:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBDH6djW078586; Thu, 13 Dec 2012 17:06:39 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBDH6dDU078584; Thu, 13 Dec 2012 17:06:39 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201212131706.qBDH6dDU078584@svn.freebsd.org> From: Steven Hartland Date: Thu, 13 Dec 2012 17:06:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244187 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 13 Dec 2012 17:06:39 -0000 Author: smh Date: Thu Dec 13 17:06:38 2012 New Revision: 244187 URL: http://svnweb.freebsd.org/changeset/base/244187 Log: Upgrades trim free request sizes before inserting them into to free map, making range consolidation much more effective particularly for small deletes. This reduces memory used by the free map as well as reducing the number of bio requests down to geom required to process all deletes. In tests this achieved a factor of 10 reduction of trim ranges / geom call downs. While I'm here correct the description of zio_vdev_io_start. PR: kern/173254 Submitted by: Steven Hartland Approved by: pjd (mentor) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c Thu Dec 13 15:19:37 2012 (r244186) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c Thu Dec 13 17:06:38 2012 (r244187) @@ -28,6 +28,17 @@ #include #include +/* + * Calculate the zio end, upgrading based on ashift which would be + * done by zio_vdev_io_start. + * + * This makes free range consolidation much more effective + * than it would otherwise be as well as ensuring that entire + * blocks are invalidated by writes. + */ +#define TRIM_ZIO_END(zio) ((zio)->io_offset + \ + P2ROUNDUP((zio)->io_size, 1ULL << (zio)->io_vd->vdev_top->vdev_ashift)) + typedef struct trim_map { list_t tm_head; /* List of segments sorted by txg. */ avl_tree_t tm_queued_frees; /* AVL tree of segments waiting for TRIM. */ @@ -270,7 +281,7 @@ trim_map_free(zio_t *zio) return; mutex_enter(&tm->tm_lock); - trim_map_free_locked(tm, zio->io_offset, zio->io_offset + zio->io_size, + trim_map_free_locked(tm, zio->io_offset, TRIM_ZIO_END(zio), vd->vdev_spa->spa_syncing_txg); mutex_exit(&tm->tm_lock); } @@ -288,7 +299,7 @@ trim_map_write_start(zio_t *zio) return (B_TRUE); start = zio->io_offset; - end = start + zio->io_size; + end = TRIM_ZIO_END(zio); tsearch.ts_start = start; tsearch.ts_end = end; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Thu Dec 13 15:19:37 2012 (r244186) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Thu Dec 13 17:06:38 2012 (r244187) @@ -2448,7 +2448,7 @@ zio_free_zil(spa_t *spa, uint64_t txg, b /* * ========================================================================== - * Read and write to physical devices + * Read, write and delete to physical devices * ========================================================================== */ static int From owner-svn-src-head@FreeBSD.ORG Thu Dec 13 17:09:43 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DCE9773A; Thu, 13 Dec 2012 17:09:43 +0000 (UTC) (envelope-from mdf356@gmail.com) Received: from mail-pa0-f54.google.com (mail-pa0-f54.google.com [209.85.220.54]) by mx1.freebsd.org (Postfix) with ESMTP id 438028FC17; Thu, 13 Dec 2012 17:09:43 +0000 (UTC) Received: by mail-pa0-f54.google.com with SMTP id bi5so1584617pad.13 for ; Thu, 13 Dec 2012 09:09:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=CG4lmcxxdcC8yNwuB3ibHhPRGlCNCqQL6Ydy375+a7U=; b=HMOD1TRLAySxtgxo6Y5EIvs5XFknFZRAzBwN2h5KxsKpH7+ervW5mOE7y/oalMMDmw GA/qP3FlarcckS5Q6ji8FH9nR3DO5x04VS6GDgqTvbK7XEh0rrR24KPPLKxdrYGDuNoz IW+Evwmb7dcsXj13sFdXfzKA94rXw0R/wiqb4B4kyVUYoJ+gbXff+AqwJfIpGVlma/3r l3YT/XsRDcZ0J+BDa8T3j9B3n/bWqmohy1VKsdByj2qbVcXmRskZjjVvvn0Krt4nNEXw l+6JTBtsgvOkWVgFe405xl//4IQwM547JDeuoGCjvH098u6makny2ukikLiAZhiBdqBF 4MjA== MIME-Version: 1.0 Received: by 10.68.192.70 with SMTP id he6mr7188640pbc.142.1355418085617; Thu, 13 Dec 2012 09:01:25 -0800 (PST) Sender: mdf356@gmail.com Received: by 10.68.55.166 with HTTP; Thu, 13 Dec 2012 09:01:25 -0800 (PST) In-Reply-To: <50C9A321.5060407@FreeBSD.org> References: <201212110708.qBB78EWx025288@svn.freebsd.org> <201212121046.43706.jhb@freebsd.org> <201212121658.49048.jhb@freebsd.org> <50C90567.8080406@FreeBSD.org> <50C909BD.9090709@mu.org> <50C97D94.1090603@FreeBSD.org> <50C97F8D.6010504@FreeBSD.org> <50C9A321.5060407@FreeBSD.org> Date: Thu, 13 Dec 2012 09:01:25 -0800 X-Google-Sender-Auth: 4TjBm-A58eBfQas6qmryVhHqCGs Message-ID: Subject: Re: svn commit: r244112 - head/sys/kern From: mdf@FreeBSD.org To: Andriy Gapon Content-Type: text/plain; charset=ISO-8859-1 Cc: Adrian Chadd , Alfred Perlstein , John Baldwin , svn-src-all@freebsd.org, Alfred Perlstein , src-committers@freebsd.org, svn-src-head@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 13 Dec 2012 17:09:44 -0000 On Thu, Dec 13, 2012 at 1:42 AM, Andriy Gapon wrote: > on 13/12/2012 09:16 Adrian Chadd said the following: >> Hi, >> >> I think the fundamental problem here is we have some pretty different >> ideas of what KASSERT should be, versus what it actually is in various >> parts of the code. > > Oh, and another part of the problem is that the discussion is opinion based. > But it didn't have to be. > > Compare this: > We think that feature F is a very good idea, we think that it will be used by many > people and it will provide a lot of benefits. So here you are - the code is in > the tree. > > To this: > We have been using feature F, it has proved to be a very good idea as it provided > these benefits and spared us from these problems. So here you are - the code is > in the tree. > > If I have a differing opinion in the first case I usually state it (and can be > pulled into an argument about it). If I have a different opinion in the second > case, I try to adjust my opinion to the stated reality. > >> Since we're lost in semantics, we're not going to get any further on >> this discussion just for now, so let's take a break and think about >> other things for now. Tools, not policy. A non-panic-ing KASSERT is a tool, not enabled by default. You don't need to use it. Someone does, so why can't we provide the tool? Thanks, matthew From owner-svn-src-head@FreeBSD.ORG Thu Dec 13 17:39:08 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id ADC69C09; Thu, 13 Dec 2012 17:39:08 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 78A128FC08; Thu, 13 Dec 2012 17:39:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBDHd86Z083617; Thu, 13 Dec 2012 17:39:08 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBDHd8RR083616; Thu, 13 Dec 2012 17:39:08 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201212131739.qBDHd8RR083616@svn.freebsd.org> From: Steven Hartland Date: Thu, 13 Dec 2012 17:39:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244188 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 13 Dec 2012 17:39:08 -0000 Author: smh Date: Thu Dec 13 17:39:07 2012 New Revision: 244188 URL: http://svnweb.freebsd.org/changeset/base/244188 Log: Added vfs.zfs.vdev.trim_on_init sysctl which allows full vdev trim on initialisation to be enabled (1) / disabled (0) defaults to enabled. This is useful for devices which have a slow trim speed and are either new or have otherwise already been wiped e.g. secure erase. PR: kern/173116 Submitted by: Steven Hartland Approved by: pjd (mentor) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c Thu Dec 13 17:06:38 2012 (r244187) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c Thu Dec 13 17:39:07 2012 (r244188) @@ -148,6 +148,11 @@ #include #include +static boolean_t vdev_trim_on_init = B_TRUE; +SYSCTL_DECL(_vfs_zfs_vdev); +SYSCTL_INT(_vfs_zfs_vdev, OID_AUTO, trim_on_init, CTLFLAG_RW, + &vdev_trim_on_init, 0, "Enable/disable full vdev trim on initialisation"); + /* * Basic routines to read and write from a vdev label. * Used throughout the rest of this file. @@ -724,7 +729,7 @@ vdev_label_init(vdev_t *vd, uint64_t crt * Don't TRIM if removing so that we don't interfere with zpool * disaster recovery. */ - if (!zfs_notrim && (reason == VDEV_LABEL_CREATE || + if (!zfs_notrim && vdev_trim_on_init && (reason == VDEV_LABEL_CREATE || reason == VDEV_LABEL_SPARE || reason == VDEV_LABEL_L2CACHE)) zio_wait(zio_trim(NULL, spa, vd, 0, vd->vdev_psize)); From owner-svn-src-head@FreeBSD.ORG Thu Dec 13 18:16:29 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4CF56BFB; Thu, 13 Dec 2012 18:16:29 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id A577B8FC0C; Thu, 13 Dec 2012 18:16:28 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.5/8.14.5) with ESMTP id qBDIGMK1054305; Thu, 13 Dec 2012 20:16:22 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.7.1 kib.kiev.ua qBDIGMK1054305 Received: (from kostik@localhost) by tom.home (8.14.5/8.14.5/Submit) id qBDIGLTV054304; Thu, 13 Dec 2012 20:16:21 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 13 Dec 2012 20:16:21 +0200 From: Konstantin Belousov To: Pawel Jakub Dawidek Subject: Re: svn commit: r244154 - head/bin/ps Message-ID: <20121213181621.GG71906@kib.kiev.ua> References: <201212121545.qBCFj4Hl086444@svn.freebsd.org> <20121212210652.GO3013@kib.kiev.ua> <20121213111240.GB1381@garage.freebsd.pl> <20121213161242.GE71906@kib.kiev.ua> <20121213165541.GD1381@garage.freebsd.pl> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="2E/hm+v6kSLEYT3h" Content-Disposition: inline In-Reply-To: <20121213165541.GD1381@garage.freebsd.pl> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, jhb@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 13 Dec 2012 18:16:29 -0000 --2E/hm+v6kSLEYT3h Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Dec 13, 2012 at 05:55:41PM +0100, Pawel Jakub Dawidek wrote: > On Thu, Dec 13, 2012 at 06:12:42PM +0200, Konstantin Belousov wrote: > > On Thu, Dec 13, 2012 at 12:12:44PM +0100, Pawel Jakub Dawidek wrote: > > > On Wed, Dec 12, 2012 at 11:06:52PM +0200, Konstantin Belousov wrote: > > > I saw CTLFLAG_TUN on the sysctl and assumed it is read-only... > > > How about defining BSD_PID_MAX in sys/proc.h, which would be visible = by > > > userland as well and setting PID_MAX to BSD_PID_MAX? > > >=20 > > > This would also help bsnmpd. > > >=20 > > > http://people.freebsd.org/~pjd/patches/PID_MAX.patch > > Do you know why PID_MAX is under _KERNEL ? If there is no real reason, > > it would be better to move it outside kernel-only section. sys/proc.h > > is not in POSIX anyway. >=20 > I assumed it will break some ports that may define it themselves. > I wonder if we could do a test ports build to see what's the impact. Sure. On the other hand, sys/proc.h is mostly useless for the application code as it is now. Might be, use #ifndef PID_MAX braces ? --2E/hm+v6kSLEYT3h Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlDKG3UACgkQC3+MBN1Mb4jX+QCeLESwLmPE929To8ZKX83rHd2j OTUAnj0dpzbcbD3jaepjoVnX2LPRSuLa =Xfwg -----END PGP SIGNATURE----- --2E/hm+v6kSLEYT3h-- From owner-svn-src-head@FreeBSD.ORG Thu Dec 13 20:17:34 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DC081EC9; Thu, 13 Dec 2012 20:17:34 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id BAA258FC12; Thu, 13 Dec 2012 20:17:33 +0000 (UTC) Received: by mail-la0-f54.google.com with SMTP id j13so2146630lah.13 for ; Thu, 13 Dec 2012 12:17:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=iJwjKdiqmyEuRW1ZnoLgBapsq1AFCQV1RIlxsHUzrV0=; b=sok/XZC9xSoqlm7ETsxNBs6t/EBFubp1/ucFAMqrUPB3LJgU+TiolcoAECNgoRihgR S4LZ00NR3mJmp+9l0TPzGYo9u63KxMXi0CQTA+mhAyfACZvSfozTW1OcGcOa0TCb1AhA SA9UShX1UggwrN3TUE0rpktW6IzliZU4MAvrzl2Qj8CaA0XGVcTqBe9a5NabkvP3z2A6 /F0gAgOmoutRKuuZKaOom1K7xDuZjiNksf1rwu+b266F2JDbghXmmU5YdhvJMUH3IeU5 5ZnKPZTvoS4bXU0skjFUJaD30qAtWEA2YJorq+9S29WWI8Aj8UDt58wsMUg3gUasZN/k CMwQ== MIME-Version: 1.0 Received: by 10.112.46.66 with SMTP id t2mr1373631lbm.115.1355429851465; Thu, 13 Dec 2012 12:17:31 -0800 (PST) Sender: asmrookie@gmail.com Received: by 10.112.84.193 with HTTP; Thu, 13 Dec 2012 12:17:31 -0800 (PST) In-Reply-To: <50C9B525.2060503@FreeBSD.org> References: <201211251422.qAPEM8BV074656@svn.freebsd.org> <50C9B525.2060503@FreeBSD.org> Date: Thu, 13 Dec 2012 20:17:31 +0000 X-Google-Sender-Auth: L3QhmG8CWU7eVOLN0L-HJxIGJnI Message-ID: Subject: Re: svn commit: r243515 - head/sys/kern From: Attilio Rao To: Andriy Gapon Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: attilio@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, 13 Dec 2012 20:17:35 -0000 On Thu, Dec 13, 2012 at 10:59 AM, Andriy Gapon wrote: > on 09/12/2012 19:27 Attilio Rao said the following: >> On Sun, Nov 25, 2012 at 2:22 PM, Andriy Gapon wrote: >>> Author: avg >>> Date: Sun Nov 25 14:22:08 2012 >>> New Revision: 243515 >>> URL: http://svnweb.freebsd.org/changeset/base/243515 >>> >>> Log: >>> remove stop_scheduler_on_panic knob >>> >>> There has not been any complaints about the default behavior, so there >>> is no need to keep a knob that enables the worse alternative. >>> >>> Now that the hard-stopping of other CPUs is the only behavior, the panic_cpu >>> spinlock-like logic can be dropped, because only a single CPU is >>> supposed to win stop_cpus_hard(other_cpus) race and proceed past that >>> call. >> >> While this is true for the sane case, for the case report by Ryan this >> still breaks. > > Yes. I haven't got around to start fixing the Ryan's problem yet. > But this commit should reduce number of places where changes have to be made. > In fact, I think that only stop_cpus_X would have to be fixed now. > >> Infact, immagine CPU0 (winner) and CPU1 (looser) both panic'ing. CPU0 >> wins and then sets stopping_cpu. When the deadlock happens in the >> spinning loop, because of generic_stop_cpus() logic CPU0 won't >> deadlock and will correctly continue, but the problem is that it sets >> back stopping_cpu to NOCPU, letting CPU1 continuing too and then >> deadlocking. >> >> At the minimum, what I think that should happen is to have the check >> in panic() as prior this change but with the add I outlined (thus we >> need to generalize cpustop_handler()). However, it seems to me that >> generic_stop_cpus() may still be broken by this and we eventually need >> to fix it. >> >> I would then revert this part of the patch and fix it appropriately. >> Later we can better discuss the generic_stop_cpus() similar race. > > I actually see this change and the Ryan's problem as orthogonal issues. > My opinion is let's just fix generic_stop_cpus(). Right, but as I said, for the time being we can at least have a correct panic() semantic and take the right time to fix the generic_stop_cpus() and then absorb also the panic() fix into it. Right now the mechanism is still broken in panic and it can be fixed with a very easy fix, so we should just do it. This will also help vendors like Sandvine which may have hit just this bug too. Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-head@FreeBSD.ORG Thu Dec 13 21:27:21 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 51E827D1; Thu, 13 Dec 2012 21:27:21 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 364C28FC15; Thu, 13 Dec 2012 21:27:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBDLRLbC017781; Thu, 13 Dec 2012 21:27:21 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBDLRKo9017777; Thu, 13 Dec 2012 21:27:20 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201212132127.qBDLRKo9017777@svn.freebsd.org> From: Jim Harris Date: Thu, 13 Dec 2012 21:27:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244191 - in head/sys: amd64/include i386/include x86/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 13 Dec 2012 21:27:21 -0000 Author: jimharris Date: Thu Dec 13 21:27:20 2012 New Revision: 244191 URL: http://svnweb.freebsd.org/changeset/base/244191 Log: Revert r243960 based on feedback regarding keeping x86 headers unified (mdf@, tijl@) and use of KASSERT/systm.h in bus.h (zeising@, bde@). Alternate implementation will be made in a separate commit. Modified: head/sys/amd64/include/bus.h head/sys/i386/include/bus.h head/sys/x86/include/bus.h Modified: head/sys/amd64/include/bus.h ============================================================================== --- head/sys/amd64/include/bus.h Thu Dec 13 20:07:11 2012 (r244190) +++ head/sys/amd64/include/bus.h Thu Dec 13 21:27:20 2012 (r244191) @@ -1,153 +1,6 @@ /*- - * Copyright (c) 2012 Intel Corporation - * Copyright (c) 2009 Marcel Moolenaar - * 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$ + * This file is in the public domain. */ +/* $FreeBSD$ */ -#ifndef _MACHINE_BUS_H_ -#define _MACHINE_BUS_H_ - -#include #include - -#define KASSERT_BUS_SPACE_MEM_ONLY(tag) \ - KASSERT((tag) == X86_BUS_SPACE_MEM, \ - ("%s: can only handle mem space", __func__)) - -static __inline uint64_t -bus_space_read_8(bus_space_tag_t tag, bus_space_handle_t bsh, - bus_size_t ofs) -{ - - KASSERT_BUS_SPACE_MEM_ONLY(tag); - - return (*(volatile uint64_t *)(bsh + ofs)); -} - -static __inline void -bus_space_write_8(bus_space_tag_t tag, bus_space_handle_t bsh, - bus_size_t ofs, uint64_t val) -{ - - KASSERT_BUS_SPACE_MEM_ONLY(tag); - - *(volatile uint64_t *)(bsh + ofs) = val; -} - -static __inline void -bus_space_read_region_8(bus_space_tag_t tag, bus_space_handle_t bsh, - bus_size_t ofs, uint64_t *bufp, size_t count) -{ - volatile uint64_t *bsp; - - KASSERT_BUS_SPACE_MEM_ONLY(tag); - - bsp = (void *)(bsh + ofs); - while (count-- > 0) - *bufp++ = *bsp++; -} - -static __inline void -bus_space_write_region_8(bus_space_tag_t tag, bus_space_handle_t bsh, - bus_size_t ofs, uint64_t const *bufp, size_t count) -{ - volatile uint64_t *bsp; - - KASSERT_BUS_SPACE_MEM_ONLY(tag); - - bsp = (void *)(bsh + ofs); - while (count-- > 0) - *bsp++ = *bufp++; -} - -static __inline void -bus_space_set_region_8(bus_space_tag_t tag, bus_space_handle_t bsh, - bus_size_t ofs, uint64_t val, size_t count) -{ - volatile uint64_t *bsp; - - KASSERT_BUS_SPACE_MEM_ONLY(tag); - - bsp = (void *)(bsh + ofs); - while (count-- > 0) - *bsp++ = val; -} - -static __inline void -bus_space_copy_region_8(bus_space_tag_t tag, bus_space_handle_t sbsh, - bus_size_t sofs, bus_space_handle_t dbsh, bus_size_t dofs, size_t count) -{ - volatile uint64_t *dst, *src; - - KASSERT_BUS_SPACE_MEM_ONLY(tag); - - src = (void *)(sbsh + sofs); - dst = (void *)(dbsh + dofs); - if (src < dst) { - src += count - 1; - dst += count - 1; - while (count-- > 0) - *dst-- = *src--; - } else { - while (count-- > 0) - *dst++ = *src++; - } -} - -static __inline void -bus_space_read_multi_8(bus_space_tag_t tag, bus_space_handle_t bsh, - bus_size_t ofs, uint64_t *bufp, size_t count) -{ - - KASSERT_BUS_SPACE_MEM_ONLY(tag); - - while (count-- > 0) - *bufp++ = *(volatile uint64_t *)(bsh + ofs); -} - -static __inline void -bus_space_write_multi_8(bus_space_tag_t tag, bus_space_handle_t bsh, - bus_size_t ofs, uint64_t const *bufp, size_t count) -{ - - KASSERT_BUS_SPACE_MEM_ONLY(tag); - - while (count-- > 0) - *(volatile uint64_t *)(bsh + ofs) = *bufp++; -} - -static __inline void -bus_space_set_multi_8(bus_space_tag_t tag, bus_space_handle_t bsh, - bus_size_t ofs, uint64_t val, size_t count) -{ - - KASSERT_BUS_SPACE_MEM_ONLY(tag); - - while (count-- > 0) - *(volatile uint64_t *)(bsh + ofs) = val; -} - -#endif /*_MACHINE_BUS_H_*/ Modified: head/sys/i386/include/bus.h ============================================================================== --- head/sys/i386/include/bus.h Thu Dec 13 20:07:11 2012 (r244190) +++ head/sys/i386/include/bus.h Thu Dec 13 21:27:20 2012 (r244191) @@ -3,26 +3,4 @@ */ /* $FreeBSD$ */ -#ifndef _MACHINE_BUS_H_ -#define _MACHINE_BUS_H_ - #include - -/* - * The functions: - * bus_space_read_8 - * bus_space_read_region_8 - * bus_space_write_8 - * bus_space_write_multi_8 - * bus_space_write_region_8 - * bus_space_set_multi_8 - * bus_space_set_region_8 - * bus_space_copy_region_8 - * bus_space_read_multi_8 - * are unimplemented for i386 because there is no way to do a 64-bit move in - * this architecture. It is possible to do two 32-bit moves, but this is - * not atomic and may have hardware dependencies that should be fully - * understood. - */ - -#endif /*_MACHINE_BUS_H_*/ Modified: head/sys/x86/include/bus.h ============================================================================== --- head/sys/x86/include/bus.h Thu Dec 13 20:07:11 2012 (r244190) +++ head/sys/x86/include/bus.h Thu Dec 13 21:27:20 2012 (r244191) @@ -251,6 +251,10 @@ bus_space_read_4(bus_space_tag_t tag, bu return (*(volatile u_int32_t *)(handle + offset)); } +#if 0 /* Cause a link error for bus_space_read_8 */ +#define bus_space_read_8(t, h, o) !!! bus_space_read_8 unimplemented !!! +#endif + /* * Read `count' 1, 2, 4, or 8 byte quantities from bus space * described by tag/handle/offset and copy into buffer provided. @@ -333,6 +337,10 @@ bus_space_read_multi_4(bus_space_tag_t t } } +#if 0 /* Cause a link error for bus_space_read_multi_8 */ +#define bus_space_read_multi_8 !!! bus_space_read_multi_8 unimplemented !!! +#endif + /* * Read `count' 1, 2, 4, or 8 byte quantities from bus space * described by tag/handle and starting at `offset' and copy into @@ -450,6 +458,10 @@ bus_space_read_region_4(bus_space_tag_t } } +#if 0 /* Cause a link error for bus_space_read_region_8 */ +#define bus_space_read_region_8 !!! bus_space_read_region_8 unimplemented !!! +#endif + /* * Write the 1, 2, 4, or 8 byte value `value' to bus space * described by tag/handle/offset. @@ -500,6 +512,10 @@ bus_space_write_4(bus_space_tag_t tag, b *(volatile u_int32_t *)(bsh + offset) = value; } +#if 0 /* Cause a link error for bus_space_write_8 */ +#define bus_space_write_8 !!! bus_space_write_8 not implemented !!! +#endif + /* * Write `count' 1, 2, 4, or 8 byte quantities from the buffer * provided to bus space described by tag/handle/offset. @@ -585,6 +601,11 @@ bus_space_write_multi_4(bus_space_tag_t } } +#if 0 /* Cause a link error for bus_space_write_multi_8 */ +#define bus_space_write_multi_8(t, h, o, a, c) \ + !!! bus_space_write_multi_8 unimplemented !!! +#endif + /* * Write `count' 1, 2, 4, or 8 byte quantities from the buffer provided * to bus space described by tag/handle starting at `offset'. @@ -702,6 +723,11 @@ bus_space_write_region_4(bus_space_tag_t } } +#if 0 /* Cause a link error for bus_space_write_region_8 */ +#define bus_space_write_region_8 \ + !!! bus_space_write_region_8 unimplemented !!! +#endif + /* * Write the 1, 2, 4, or 8 byte value `val' to bus space described * by tag/handle/offset `count' times. @@ -762,6 +788,10 @@ bus_space_set_multi_4(bus_space_tag_t ta *(volatile u_int32_t *)(addr) = value; } +#if 0 /* Cause a link error for bus_space_set_multi_8 */ +#define bus_space_set_multi_8 !!! bus_space_set_multi_8 unimplemented !!! +#endif + /* * Write `count' 1, 2, 4, or 8 byte value `val' to bus space described * by tag/handle starting at `offset'. @@ -822,6 +852,10 @@ bus_space_set_region_4(bus_space_tag_t t *(volatile u_int32_t *)(addr) = value; } +#if 0 /* Cause a link error for bus_space_set_region_8 */ +#define bus_space_set_region_8 !!! bus_space_set_region_8 unimplemented !!! +#endif + /* * Copy `count' 1, 2, 4, or 8 byte values from bus space starting * at tag/bsh1/off1 to bus space starting at tag/bsh2/off2. @@ -950,6 +984,10 @@ bus_space_copy_region_4(bus_space_tag_t } } +#if 0 /* Cause a link error for bus_space_copy_8 */ +#define bus_space_copy_region_8 !!! bus_space_copy_region_8 unimplemented !!! +#endif + /* * Bus read/write barrier methods. * From owner-svn-src-head@FreeBSD.ORG Thu Dec 13 21:30:11 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B705F97D; Thu, 13 Dec 2012 21:30:11 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (garage.dawidek.net [91.121.88.72]) by mx1.freebsd.org (Postfix) with ESMTP id 700928FC14; Thu, 13 Dec 2012 21:30:10 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id 1F021514; Thu, 13 Dec 2012 22:28:07 +0100 (CET) Date: Thu, 13 Dec 2012 22:31:47 +0100 From: Pawel Jakub Dawidek To: Konstantin Belousov Subject: Re: svn commit: r244154 - head/bin/ps Message-ID: <20121213213147.GA1401@garage.freebsd.pl> References: <201212121545.qBCFj4Hl086444@svn.freebsd.org> <20121212210652.GO3013@kib.kiev.ua> <20121213111240.GB1381@garage.freebsd.pl> <20121213161242.GE71906@kib.kiev.ua> <20121213165541.GD1381@garage.freebsd.pl> <20121213181621.GG71906@kib.kiev.ua> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="MGYHOYXEY6WxJCY8" Content-Disposition: inline In-Reply-To: <20121213181621.GG71906@kib.kiev.ua> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, jhb@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 13 Dec 2012 21:30:11 -0000 --MGYHOYXEY6WxJCY8 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Dec 13, 2012 at 08:16:21PM +0200, Konstantin Belousov wrote: > On Thu, Dec 13, 2012 at 05:55:41PM +0100, Pawel Jakub Dawidek wrote: > > On Thu, Dec 13, 2012 at 06:12:42PM +0200, Konstantin Belousov wrote: > > > On Thu, Dec 13, 2012 at 12:12:44PM +0100, Pawel Jakub Dawidek wrote: > > > > On Wed, Dec 12, 2012 at 11:06:52PM +0200, Konstantin Belousov wrote: > > > > I saw CTLFLAG_TUN on the sysctl and assumed it is read-only... > > > > How about defining BSD_PID_MAX in sys/proc.h, which would be visibl= e by > > > > userland as well and setting PID_MAX to BSD_PID_MAX? > > > >=20 > > > > This would also help bsnmpd. > > > >=20 > > > > http://people.freebsd.org/~pjd/patches/PID_MAX.patch > > > Do you know why PID_MAX is under _KERNEL ? If there is no real reason, > > > it would be better to move it outside kernel-only section. sys/proc.h > > > is not in POSIX anyway. > >=20 > > I assumed it will break some ports that may define it themselves. > > I wonder if we could do a test ports build to see what's the impact. >=20 > Sure. >=20 > On the other hand, sys/proc.h is mostly useless for the application code > as it is now. Might be, use > #ifndef PID_MAX > braces ? This can be done of course, but it won't help cases where PID_MAX is defined after sys/proc.h is included. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --MGYHOYXEY6WxJCY8 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlDKSUMACgkQForvXbEpPzRu4wCffzwr68b3FD1J5XNwJVeklX3M Cp0AoI77Uc00qIo84676rt1Fq/viIpEe =EYUL -----END PGP SIGNATURE----- --MGYHOYXEY6WxJCY8-- From owner-svn-src-head@FreeBSD.ORG Thu Dec 13 21:40:12 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1FC0EDBA; Thu, 13 Dec 2012 21:40:12 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 04FCD8FC14; Thu, 13 Dec 2012 21:40:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBDLeBdk019752; Thu, 13 Dec 2012 21:40:11 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBDLeBhd019751; Thu, 13 Dec 2012 21:40:11 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201212132140.qBDLeBhd019751@svn.freebsd.org> From: Jim Harris Date: Thu, 13 Dec 2012 21:40:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244193 - head/sys/x86/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 13 Dec 2012 21:40:12 -0000 Author: jimharris Date: Thu Dec 13 21:40:11 2012 New Revision: 244193 URL: http://svnweb.freebsd.org/changeset/base/244193 Log: Add bus_space_read_8 and bus_space_write_8 for amd64. Rather than trying to KASSERT for callers that invoke this on IO tags, either do nothing (for write_8) or return ~0 (for read_8). Using KASSERT here just makes bus.h too messy from both polluting bus.h with systm.h (for any number of drivers that include bus.h without first including systm.h) or ports that use bus.h directly (i.e. libpciaccess) as reported by zeising@. Also don't try to implement all of the other bus_space functions for 8 byte access since realistically only these two are needed for some devices that expose 64-bit memory-mapped registers. Put the amd64-specific functions here rather than sys/amd64/include/bus.h so that we can keep this header unified for x86, as requested by mdf@ and tijl@. Submitted by: Carl Delsey MFC after: 3 days Modified: head/sys/x86/include/bus.h Modified: head/sys/x86/include/bus.h ============================================================================== --- head/sys/x86/include/bus.h Thu Dec 13 21:39:59 2012 (r244192) +++ head/sys/x86/include/bus.h Thu Dec 13 21:40:11 2012 (r244193) @@ -130,6 +130,7 @@ #define BUS_SPACE_MAXADDR 0xFFFFFFFF #endif +#define BUS_SPACE_INVALID_DATA (~0) #define BUS_SPACE_UNRESTRICTED (~0) /* @@ -221,6 +222,12 @@ static __inline u_int32_t bus_space_read bus_space_handle_t handle, bus_size_t offset); +#ifdef __amd64__ +static __inline uint64_t bus_space_read_8(bus_space_tag_t tag, + bus_space_handle_t handle, + bus_size_t offset); +#endif + static __inline u_int8_t bus_space_read_1(bus_space_tag_t tag, bus_space_handle_t handle, bus_size_t offset) @@ -251,8 +258,16 @@ bus_space_read_4(bus_space_tag_t tag, bu return (*(volatile u_int32_t *)(handle + offset)); } -#if 0 /* Cause a link error for bus_space_read_8 */ -#define bus_space_read_8(t, h, o) !!! bus_space_read_8 unimplemented !!! +#ifdef __amd64__ +static __inline uint64_t +bus_space_read_8(bus_space_tag_t tag, bus_space_handle_t handle, + bus_size_t offset) +{ + + if (tag == X86_BUS_SPACE_IO) /* No 8 byte IO space access on x86 */ + return (BUS_SPACE_INVALID_DATA); + return (*(volatile uint64_t *)(handle + offset)); +} #endif /* @@ -479,6 +494,12 @@ static __inline void bus_space_write_4(b bus_space_handle_t bsh, bus_size_t offset, u_int32_t value); +#ifdef __amd64__ +static __inline void bus_space_write_8(bus_space_tag_t tag, + bus_space_handle_t bsh, + bus_size_t offset, uint64_t value); +#endif + static __inline void bus_space_write_1(bus_space_tag_t tag, bus_space_handle_t bsh, bus_size_t offset, u_int8_t value) @@ -512,8 +533,17 @@ bus_space_write_4(bus_space_tag_t tag, b *(volatile u_int32_t *)(bsh + offset) = value; } -#if 0 /* Cause a link error for bus_space_write_8 */ -#define bus_space_write_8 !!! bus_space_write_8 not implemented !!! +#ifdef __amd64__ +static __inline void +bus_space_write_8(bus_space_tag_t tag, bus_space_handle_t bsh, + bus_size_t offset, uint64_t value) +{ + + if (tag == X86_BUS_SPACE_IO) /* No 8 byte IO space access on x86 */ + return; + else + *(volatile uint64_t *)(bsh + offset) = value; +} #endif /* From owner-svn-src-head@FreeBSD.ORG Thu Dec 13 22:03:08 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 41E267E6; Thu, 13 Dec 2012 22:03:08 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 272148FC0A; Thu, 13 Dec 2012 22:03:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBDM382V022847; Thu, 13 Dec 2012 22:03:08 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBDM38R3022846; Thu, 13 Dec 2012 22:03:08 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201212132203.qBDM38R3022846@svn.freebsd.org> From: Steven Hartland Date: Thu, 13 Dec 2012 22:03:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244194 - head/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 13 Dec 2012 22:03:08 -0000 Author: smh Date: Thu Dec 13 22:03:07 2012 New Revision: 244194 URL: http://svnweb.freebsd.org/changeset/base/244194 Log: Fixes zfs receive errors caused by snapshot replication being processed in a random order instead of creation order. Eliminates needless filesystem renames caused by removed parent snapshots which subsequently causes many more errors. PR: kern/172259 Submitted by: Steven Hartland Reviewed by: pjd (mentor) Approved by: pjd (mentor) MFC after: 2 weeks Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Thu Dec 13 21:40:11 2012 (r244193) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Thu Dec 13 22:03:07 2012 (r244194) @@ -727,7 +727,7 @@ send_iterate_fs(zfs_handle_t *zhp, void sd->parent_fromsnap_guid = 0; VERIFY(0 == nvlist_alloc(&sd->parent_snaps, NV_UNIQUE_NAME, 0)); VERIFY(0 == nvlist_alloc(&sd->snapprops, NV_UNIQUE_NAME, 0)); - (void) zfs_iter_snapshots(zhp, B_FALSE, send_iterate_snap, sd); + (void) zfs_iter_snapshots_sorted(zhp, send_iterate_snap, sd); VERIFY(0 == nvlist_add_nvlist(nvfs, "snaps", sd->parent_snaps)); VERIFY(0 == nvlist_add_nvlist(nvfs, "snapprops", sd->snapprops)); nvlist_free(sd->parent_snaps); @@ -1945,11 +1945,12 @@ recv_incremental_replication(libzfs_hand recvflags_t *flags, nvlist_t *stream_nv, avl_tree_t *stream_avl, nvlist_t *renamed) { - nvlist_t *local_nv; + nvlist_t *local_nv, *deleted = NULL; avl_tree_t *local_avl; nvpair_t *fselem, *nextfselem; char *fromsnap; char newname[ZFS_MAXNAMELEN]; + char guidname[32]; int error; boolean_t needagain, progress, recursive; char *s1, *s2; @@ -1965,6 +1966,8 @@ recv_incremental_replication(libzfs_hand again: needagain = progress = B_FALSE; + VERIFY(0 == nvlist_alloc(&deleted, NV_UNIQUE_NAME, 0)); + if ((error = gather_nvlist(hdl, tofs, fromsnap, NULL, recursive, &local_nv, &local_avl)) != 0) return (error); @@ -2079,6 +2082,8 @@ again: needagain = B_TRUE; else progress = B_TRUE; + sprintf(guidname, "%lu", thisguid); + nvlist_add_boolean(deleted, guidname); continue; } @@ -2134,6 +2139,8 @@ again: needagain = B_TRUE; else progress = B_TRUE; + sprintf(guidname, "%lu", parent_fromsnap_guid); + nvlist_add_boolean(deleted, guidname); continue; } @@ -2156,6 +2163,24 @@ again: s2 = strrchr(stream_fsname, '/'); /* + * Check if we're going to rename based on parent guid change + * and the current parent guid was also deleted. If it was then + * rename will fail and is likely unneeded, so avoid this and + * force an early retry to determine the new + * parent_fromsnap_guid. + */ + if (stream_parent_fromsnap_guid != 0 && + parent_fromsnap_guid != 0 && + stream_parent_fromsnap_guid != parent_fromsnap_guid) { + sprintf(guidname, "%lu", parent_fromsnap_guid); + if (nvlist_exists(deleted, guidname)) { + progress = B_TRUE; + needagain = B_TRUE; + goto doagain; + } + } + + /* * Check for rename. If the exact receive path is specified, it * does not count as a rename, but we still need to check the * datasets beneath it. @@ -2209,8 +2234,10 @@ again: } } +doagain: fsavl_destroy(local_avl); nvlist_free(local_nv); + nvlist_free(deleted); if (needagain && progress) { /* do another pass to fix up temporary names */ From owner-svn-src-head@FreeBSD.ORG Thu Dec 13 23:03:38 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 21354720; Thu, 13 Dec 2012 23:03:38 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 06FAF8FC13; Thu, 13 Dec 2012 23:03:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBDN3bpA032295; Thu, 13 Dec 2012 23:03:37 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBDN3bKf032293; Thu, 13 Dec 2012 23:03:37 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201212132303.qBDN3bKf032293@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Thu, 13 Dec 2012 23:03:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244195 - in head/sys: arm/arm conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 13 Dec 2012 23:03:38 -0000 Author: gonzo Date: Thu Dec 13 23:03:37 2012 New Revision: 244195 URL: http://svnweb.freebsd.org/changeset/base/244195 Log: Add driver for PrimeCell Vectored Interrupt Controller (PL190) Added: head/sys/arm/arm/pl190.c (contents, props changed) Modified: head/sys/conf/files.arm Added: head/sys/arm/arm/pl190.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/arm/pl190.c Thu Dec 13 23:03:37 2012 (r244195) @@ -0,0 +1,187 @@ +/*- + * Copyright (c) 2012 Oleksandr Tymoshenko + * 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. + */ + + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#ifdef DEBUG +#define dprintf(fmt, args...) printf(fmt, ##args) +#else +#define dprintf(fmt, args...) +#endif + +#define VICIRQSTATUS 0x000 +#define VICFIQSTATUS 0x004 +#define VICRAWINTR 0x008 +#define VICINTSELECT 0x00C +#define VICINTENABLE 0x010 +#define VICINTENCLEAR 0x014 +#define VICSOFTINT 0x018 +#define VICSOFTINTCLEAR 0x01C +#define VICPROTECTION 0x020 +#define VICPERIPHID 0xFE0 +#define VICPRIMECELLID 0xFF0 + +#define VIC_NIRQS 32 + +struct pl190_intc_softc { + device_t sc_dev; + struct resource * intc_res; +}; + +static struct pl190_intc_softc *pl190_intc_sc = NULL; + +#define intc_vic_read_4(reg) \ + bus_read_4(pl190_intc_sc->intc_res, (reg)) +#define intc_vic_write_4(reg, val) \ + bus_write_4(pl190_intc_sc->intc_res, (reg), (val)) + +static int +pl190_intc_probe(device_t dev) +{ + if (!ofw_bus_is_compatible(dev, "arm,versatile-vic")) + return (ENXIO); + device_set_desc(dev, "ARM PL190 VIC"); + return (BUS_PROBE_DEFAULT); +} + +static int +pl190_intc_attach(device_t dev) +{ + struct pl190_intc_softc *sc = device_get_softc(dev); + uint32_t id; + int i, rid; + + sc->sc_dev = dev; + + if (pl190_intc_sc) + return (ENXIO); + + /* Request memory resources */ + rid = 0; + sc->intc_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); + if (sc->intc_res == NULL) { + device_printf(dev, "Error: could not allocate memory resources\n"); + return (ENXIO); + } + + pl190_intc_sc = sc; + /* + * All interrupts should use IRQ line + */ + intc_vic_write_4(VICINTSELECT, 0x00000000); + /* Disable all interrupts */ + intc_vic_write_4(VICINTENCLEAR, 0xffffffff); + /* Enable INT31, SIC IRQ */ + intc_vic_write_4(VICINTENABLE, (1 << 31)); + + id = 0; + for (i = 3; i >= 0; i--) { + id = (id << 8) | + (intc_vic_read_4(VICPERIPHID + i*4) & 0xff); + } + + device_printf(dev, "Peripheral ID: %08x\n", id); + + id = 0; + for (i = 3; i >= 0; i--) { + id = (id << 8) | + (intc_vic_read_4(VICPRIMECELLID + i*4) & 0xff); + } + + device_printf(dev, "PrimeCell ID: %08x\n", id); + + return (0); +} + +static device_method_t pl190_intc_methods[] = { + DEVMETHOD(device_probe, pl190_intc_probe), + DEVMETHOD(device_attach, pl190_intc_attach), + { 0, 0 } +}; + +static driver_t pl190_intc_driver = { + "intc", + pl190_intc_methods, + sizeof(struct pl190_intc_softc), +}; + +static devclass_t pl190_intc_devclass; + +DRIVER_MODULE(intc, simplebus, pl190_intc_driver, pl190_intc_devclass, 0, 0); + +int +arm_get_next_irq(int last_irq) +{ + uint32_t pending; + int32_t irq = last_irq + 1; + + /* Sanity check */ + if (irq < 0) + irq = 0; + + pending = intc_vic_read_4(VICIRQSTATUS); + while (irq < VIC_NIRQS) { + if (pending & (1 << irq)) + return (irq); + irq++; + } + + return (-1); +} + +void +arm_mask_irq(uintptr_t nb) +{ + + dprintf("%s: %d\n", __func__, nb); + intc_vic_write_4(VICINTENCLEAR, (1 << nb)); +} + +void +arm_unmask_irq(uintptr_t nb) +{ + + dprintf("%s: %d\n", __func__, nb); + intc_vic_write_4(VICINTENABLE, (1 << nb)); +} Modified: head/sys/conf/files.arm ============================================================================== --- head/sys/conf/files.arm Thu Dec 13 22:03:07 2012 (r244194) +++ head/sys/conf/files.arm Thu Dec 13 23:03:37 2012 (r244195) @@ -32,6 +32,7 @@ arm/arm/mem.c optional mem arm/arm/minidump_machdep.c optional mem arm/arm/mp_machdep.c optional smp arm/arm/nexus.c standard +arm/arm/pl190.c optional pl190 arm/arm/pl310.c optional pl310 arm/arm/pmap.c optional cpu_arm9 | cpu_arm9e | cpu_fa526 | cpu_sa1100 | cpu_sa1110 | cpu_xscale_80219 | cpu_xscale_80321 | cpu_xscale_81342 | cpu_xscale_ixp425 | cpu_xscale_ixp435 | cpu_xscale_pxa2x0 arm/arm/pmap-v6.c optional cpu_arm11 | cpu_cortexa | cpu_mv_pj4b From owner-svn-src-head@FreeBSD.ORG Thu Dec 13 23:19:15 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 04A6617F; Thu, 13 Dec 2012 23:19:15 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DBC3A8FC12; Thu, 13 Dec 2012 23:19:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBDNJEXj035263; Thu, 13 Dec 2012 23:19:14 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBDNJDv1035251; Thu, 13 Dec 2012 23:19:13 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201212132319.qBDNJDv1035251@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Thu, 13 Dec 2012 23:19:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244197 - in head/sys: arm/conf arm/versatile boot/fdt/dts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 13 Dec 2012 23:19:15 -0000 Author: gonzo Date: Thu Dec 13 23:19:13 2012 New Revision: 244197 URL: http://svnweb.freebsd.org/changeset/base/244197 Log: Add support for QEMU's version of Versatile Platform Board Added: head/sys/arm/conf/VERSATILEPB (contents, props changed) head/sys/arm/versatile/ head/sys/arm/versatile/bus_space.c (contents, props changed) head/sys/arm/versatile/common.c (contents, props changed) head/sys/arm/versatile/files.versatile (contents, props changed) head/sys/arm/versatile/if_smc_fdt.c (contents, props changed) head/sys/arm/versatile/pl050.c (contents, props changed) head/sys/arm/versatile/sp804.c (contents, props changed) head/sys/arm/versatile/versatile_clcd.c (contents, props changed) head/sys/arm/versatile/versatile_machdep.c (contents, props changed) head/sys/arm/versatile/versatile_pci.c (contents, props changed) head/sys/arm/versatile/versatile_pci_bus_space.c (contents, props changed) head/sys/arm/versatile/versatile_pci_bus_space.h (contents, props changed) head/sys/arm/versatile/versatile_sic.c (contents, props changed) head/sys/arm/versatile/versatile_timer.c (contents, props changed) head/sys/boot/fdt/dts/versatilepb.dts (contents, props changed) Added: head/sys/arm/conf/VERSATILEPB ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/conf/VERSATILEPB Thu Dec 13 23:19:13 2012 (r244197) @@ -0,0 +1,101 @@ +# RPI-B -- Custom configuration for the Raspberry Pi +# +# For more information on this file, please read the handbook section on +# Kernel Configuration Files: +# +# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# +# The handbook is also available locally in /usr/share/doc/handbook +# if you've installed the doc distribution, otherwise always see the +# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the +# latest information. +# +# An exhaustive list of options and more detailed explanations of the +# device lines is also present in the ../../conf/NOTES and NOTES files. +# If you are in doubt as to the purpose or necessity of a line, check first +# in NOTES. +# +# $FreeBSD$ + +ident VERSATILEPB +machine arm armv6 +cpu CPU_ARM11 + +files "../versatile/files.versatile" +makeoptions MODULES_OVERRIDE="" + +options KERNVIRTADDR=0xc0100000 +makeoptions KERNVIRTADDR=0xc0100000 +options KERNPHYSADDR=0x00100000 +makeoptions KERNPHYSADDR=0x00100000 +options PHYSADDR=0x00000000 +options STARTUP_PAGETABLE_ADDR=0x01000000 +options FREEBSD_BOOT_LOADER +options LINUX_BOOT_ABI + +makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols +options HZ=100 + +options SCHED_4BSD #4BSD scheduler +options INET #InterNETworking +options FFS #Berkeley Fast Filesystem +options SOFTUPDATES #Enable FFS soft updates support +options UFS_ACL #Support for access control lists +options UFS_DIRHASH #Improve performance on big directories +device snp + +options PSEUDOFS #Pseudo-filesystem framework +options COMPAT_43 #Compatible with BSD 4.3 [KEEP THIS!] +options SCSI_DELAY=5000 #Delay (in ms) before probing SCSI +options KTRACE #ktrace(1) support +options SYSVSHM #SYSV-style shared memory +options SYSVMSG #SYSV-style message queues +options SYSVSEM #SYSV-style semaphores +options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions +options KBD_INSTALL_CDEV # install a CDEV entry in /dev +options ROOTDEVNAME=\"ufs:da0s2a\" + +options PREEMPTION + +device bpf +device loop +device mii +device mii_bitbang +device smc +device smcphy +device ether +device uart +device pl011 +device pl190 + +device pty + +device pci + +# SCSI Controllers +device sym # NCR/Symbios/LSI Logic 53C8XX/53C1010/53C1510D + +# ATA/SCSI peripherals +device scbus # SCSI bus (required for ATA/SCSI) +device da # Direct Access (disks) +device pass # Passthrough device (direct ATA/SCSI access) + +# NOTE: serial console is disabled if syscons enabled +# Comment following lines for headless setup +device sc +device kbdmux +options SC_DFLT_FONT # compile font in +makeoptions SC_DFLT_FONT=cp437 + +options KDB +options DDB #Enable the kernel debugger +options INVARIANTS #Enable calls of extra sanity checking +options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS + +device md +device random # Entropy device + +# Flattened Device Tree +options FDT +options FDT_DTB_STATIC +makeoptions FDT_DTS_FILE=versatilepb.dts Added: head/sys/arm/versatile/bus_space.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/versatile/bus_space.c Thu Dec 13 23:19:13 2012 (r244197) @@ -0,0 +1,113 @@ +/*- + * Copyright (C) 2012 FreeBSD Foundation + * 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 MARVELL nor the names of contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY 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 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include + +#include + +/* Prototypes for all the bus_space structure functions */ +bs_protos(generic); +bs_protos(generic_armv4); + +struct bus_space _base_tag = { + /* cookie */ + .bs_cookie = (void *) 0, + + /* mapping/unmapping */ + .bs_map = generic_bs_map, + .bs_unmap = generic_bs_unmap, + .bs_subregion = generic_bs_subregion, + + /* allocation/deallocation */ + .bs_alloc = generic_bs_alloc, + .bs_free = generic_bs_free, + + /* barrier */ + .bs_barrier = generic_bs_barrier, + + /* read (single) */ + .bs_r_1 = generic_bs_r_1, + .bs_r_2 = generic_armv4_bs_r_2, + .bs_r_4 = generic_bs_r_4, + .bs_r_8 = NULL, + + /* read multiple */ + .bs_rm_1 = generic_bs_rm_1, + .bs_rm_2 = generic_armv4_bs_rm_2, + .bs_rm_4 = generic_bs_rm_4, + .bs_rm_8 = NULL, + + /* read region */ + .bs_rr_1 = generic_bs_rr_1, + .bs_rr_2 = generic_armv4_bs_rr_2, + .bs_rr_4 = generic_bs_rr_4, + .bs_rr_8 = NULL, + + /* write (single) */ + .bs_w_1 = generic_bs_w_1, + .bs_w_2 = generic_armv4_bs_w_2, + .bs_w_4 = generic_bs_w_4, + .bs_w_8 = NULL, + + /* write multiple */ + .bs_wm_1 = generic_bs_wm_1, + .bs_wm_2 = generic_armv4_bs_wm_2, + .bs_wm_4 = generic_bs_wm_4, + .bs_wm_8 = NULL, + + /* write region */ + .bs_wr_1 = generic_bs_wr_1, + .bs_wr_2 = generic_armv4_bs_wr_2, + .bs_wr_4 = generic_bs_wr_4, + .bs_wr_8 = NULL, + + /* set multiple */ + /* XXX not implemented */ + + /* set region */ + .bs_sr_1 = NULL, + .bs_sr_2 = generic_armv4_bs_sr_2, + .bs_sr_4 = generic_bs_sr_4, + .bs_sr_8 = NULL, + + /* copy */ + .bs_c_1 = NULL, + .bs_c_2 = generic_armv4_bs_c_2, + .bs_c_4 = NULL, + .bs_c_8 = NULL, +}; + +bus_space_tag_t fdtbus_bs_tag = &_base_tag; Added: head/sys/arm/versatile/common.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/versatile/common.c Thu Dec 13 23:19:13 2012 (r244197) @@ -0,0 +1,75 @@ +/*- + * Copyright (C) 2008-2011 MARVELL INTERNATIONAL LTD. + * All rights reserved. + * + * Developed by Semihalf. + * + * 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 MARVELL nor the names of contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY 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 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. + */ + +#include "opt_global.h" + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +struct fdt_fixup_entry fdt_fixup_table[] = { + { NULL, NULL } +}; + +static int +fdt_intc_decode_ic(phandle_t node, pcell_t *intr, int *interrupt, int *trig, + int *pol) +{ + + if (!fdt_is_compatible(node, "arm,versatile-vic")) + return (ENXIO); + + *interrupt = fdt32_to_cpu(intr[0]); + *trig = INTR_TRIGGER_CONFORM; + *pol = INTR_POLARITY_CONFORM; + + return (0); +} + + +fdt_pic_decode_t fdt_pic_table[] = { + &fdt_intc_decode_ic, + NULL +}; Added: head/sys/arm/versatile/files.versatile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/versatile/files.versatile Thu Dec 13 23:19:13 2012 (r244197) @@ -0,0 +1,22 @@ +# $FreeBSD$ + +arm/arm/bus_space_asm_generic.S standard +arm/arm/bus_space_generic.c standard +arm/arm/cpufunc_asm_arm11.S standard +arm/arm/cpufunc_asm_armv5.S standard +arm/arm/cpufunc_asm_armv6.S standard +arm/arm/irq_dispatch.S standard + +arm/versatile/bus_space.c standard +arm/versatile/common.c standard +arm/versatile/pl050.c optional sc +arm/versatile/sp804.c standard +arm/versatile/versatile_machdep.c standard +arm/versatile/versatile_clcd.c optional sc +arm/versatile/versatile_pci.c optional pci +arm/versatile/versatile_pci_bus_space.c optional pci +arm/versatile/versatile_sic.c standard +arm/versatile/versatile_timer.c standard +arm/versatile/if_smc_fdt.c optional smc + +kern/kern_clocksource.c standard Added: head/sys/arm/versatile/if_smc_fdt.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/versatile/if_smc_fdt.c Thu Dec 13 23:19:13 2012 (r244197) @@ -0,0 +1,131 @@ +/*- + * Copyright (c) 2008 Benno Rice + * 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 ``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. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#include +#include + +#include +#include + +#include +#include +#include +#include + +#include + +#include +#include + +#include +#include +#include +#include + +#include "miibus_if.h" + +static int smc_fdt_probe(device_t); +static int smc_fdt_attach(device_t); +static int smc_fdt_detach(device_t); + +static int +smc_fdt_probe(device_t dev) +{ + struct smc_softc *sc; + + if (ofw_bus_is_compatible(dev, "smsc,lan91c111")) { + sc = device_get_softc(dev); + sc->smc_usemem = 1; + + if (smc_probe(dev) != 0) { + return (ENXIO); + } + + return (0); + } + + return (ENXIO); +} + +static int +smc_fdt_attach(device_t dev) +{ + int err; + struct smc_softc *sc; + + sc = device_get_softc(dev); + + err = smc_attach(dev); + if (err) { + return (err); + } + + return (0); +} + +static int +smc_fdt_detach(device_t dev) +{ + + smc_detach(dev); + + return (0); +} + +static device_method_t smc_fdt_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, smc_fdt_probe), + DEVMETHOD(device_attach, smc_fdt_attach), + DEVMETHOD(device_detach, smc_fdt_detach), + + /* MII interface */ + DEVMETHOD(miibus_readreg, smc_miibus_readreg), + DEVMETHOD(miibus_writereg, smc_miibus_writereg), + DEVMETHOD(miibus_statchg, smc_miibus_statchg), + + { 0, 0 } +}; + +static driver_t smc_fdt_driver = { + "smc", + smc_fdt_methods, + sizeof(struct smc_softc), +}; + +extern devclass_t smc_devclass; + +DRIVER_MODULE(smc, simplebus, smc_fdt_driver, smc_devclass, 0, 0); +DRIVER_MODULE(miibus, smc, miibus_driver, miibus_devclass, 0, 0); +MODULE_DEPEND(smc, fdt, 1, 1, 1); +MODULE_DEPEND(smc, ether, 1, 1, 1); +MODULE_DEPEND(smc, miibus, 1, 1, 1); Added: head/sys/arm/versatile/pl050.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/versatile/pl050.c Thu Dec 13 23:19:13 2012 (r244197) @@ -0,0 +1,713 @@ +/* + * Copyright (c) 2012 Oleksandr Tymoshenko + * All rights reserved. + * + * Based on dev/usb/input/ukbd.c + * + * 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include + +#include +#include + +#include + +#define KMI_LOCK() mtx_lock(&Giant) +#define KMI_UNLOCK() mtx_unlock(&Giant) + +#ifdef INVARIANTS +/* + * Assert that the lock is held in all contexts + * where the code can be executed. + */ +#define KMI_LOCK_ASSERT() mtx_assert(&Giant, MA_OWNED) +/* + * Assert that the lock is held in the contexts + * where it really has to be so. + */ +#define KMI_CTX_LOCK_ASSERT() \ + do { \ + if (!kdb_active && panicstr == NULL) \ + mtx_assert(&Giant, MA_OWNED); \ + } while (0) +#else +#define KMI_LOCK_ASSERT() (void)0 +#define KMI_CTX_LOCK_ASSERT() (void)0 +#endif + +#define KMICR 0x00 +#define KMICR_TYPE_NONPS2 (1 << 5) +#define KMICR_RXINTREN (1 << 4) +#define KMICR_TXINTREN (1 << 3) +#define KMICR_EN (1 << 2) +#define KMICR_FKMID (1 << 1) +#define KMICR_FKMIC (1 << 0) +#define KMISTAT 0x04 +#define KMISTAT_TXEMPTY (1 << 6) +#define KMISTAT_TXBUSY (1 << 5) +#define KMISTAT_RXFULL (1 << 4) +#define KMISTAT_RXBUSY (1 << 3) +#define KMISTAT_RXPARITY (1 << 2) +#define KMISTAT_KMIC (1 << 1) +#define KMISTAT_KMID (1 << 0) +#define KMIDATA 0x08 +#define KMICLKDIV 0x0C +#define KMIIR 0x10 +#define KMIIR_TXINTR (1 << 1) +#define KMIIR_RXINTR (1 << 0) + +#define KMI_DRIVER_NAME "kmi" +#define KMI_NFKEY (sizeof(fkey_tab)/sizeof(fkey_tab[0])) /* units */ + +struct kmi_softc { + keyboard_t sc_kbd; + keymap_t sc_keymap; + accentmap_t sc_accmap; + fkeytab_t sc_fkeymap[KMI_NFKEY]; + + struct resource* sc_mem_res; + struct resource* sc_irq_res; + void* sc_intr_hl; + + int sc_mode; /* input mode (K_XLATE,K_RAW,K_CODE) */ + int sc_state; /* shift/lock key state */ + int sc_accents; /* accent key index (> 0) */ + uint32_t sc_flags; /* flags */ +#define KMI_FLAG_COMPOSE 0x00000001 +#define KMI_FLAG_POLLING 0x00000002 + + struct thread *sc_poll_thread; +}; + +/* Read/Write macros for Timer used as timecounter */ +#define pl050_kmi_read_4(sc, reg) \ + bus_read_4((sc)->sc_mem_res, (reg)) + +#define pl050_kmi_write_4(sc, reg, val) \ + bus_write_4((sc)->sc_mem_res, (reg), (val)) + +/* prototypes */ +static void kmi_set_leds(struct kmi_softc *, uint8_t); +static int kmi_set_typematic(keyboard_t *, int); +static uint32_t kmi_read_char(keyboard_t *, int); +static void kmi_clear_state(keyboard_t *); +static int kmi_ioctl(keyboard_t *, u_long, caddr_t); +static int kmi_enable(keyboard_t *); +static int kmi_disable(keyboard_t *); + +/* early keyboard probe, not supported */ +static int +kmi_configure(int flags) +{ + return (0); +} + +/* detect a keyboard, not used */ +static int +kmi_probe(int unit, void *arg, int flags) +{ + return (ENXIO); +} + +/* reset and initialize the device, not used */ +static int +kmi_init(int unit, keyboard_t **kbdp, void *arg, int flags) +{ + return (ENXIO); +} + +/* test the interface to the device, not used */ +static int +kmi_test_if(keyboard_t *kbd) +{ + return (0); +} + +/* finish using this keyboard, not used */ +static int +kmi_term(keyboard_t *kbd) +{ + return (ENXIO); +} + +/* keyboard interrupt routine, not used */ +static int +kmi_intr(keyboard_t *kbd, void *arg) +{ + + return (0); +} + +/* lock the access to the keyboard, not used */ +static int +kmi_lock(keyboard_t *kbd, int lock) +{ + return (1); +} + +/* + * Enable the access to the device; until this function is called, + * the client cannot read from the keyboard. + */ +static int +kmi_enable(keyboard_t *kbd) +{ + + KMI_LOCK(); + KBD_ACTIVATE(kbd); + KMI_UNLOCK(); + + return (0); +} + +/* disallow the access to the device */ +static int +kmi_disable(keyboard_t *kbd) +{ + + KMI_LOCK(); + KBD_DEACTIVATE(kbd); + KMI_UNLOCK(); + + return (0); +} + +/* check if data is waiting */ +static int +kmi_check(keyboard_t *kbd) +{ + struct kmi_softc *sc = kbd->kb_data; + uint32_t reg; + + KMI_CTX_LOCK_ASSERT(); + + if (!KBD_IS_ACTIVE(kbd)) + return (0); + + reg = pl050_kmi_read_4(sc, KMIIR); + return (reg & KMIIR_RXINTR); +} + +/* check if char is waiting */ +static int +kmi_check_char_locked(keyboard_t *kbd) +{ + KMI_CTX_LOCK_ASSERT(); + + if (!KBD_IS_ACTIVE(kbd)) + return (0); + + return (kmi_check(kbd)); +} + +static int +kmi_check_char(keyboard_t *kbd) +{ + int result; + + KMI_LOCK(); + result = kmi_check_char_locked(kbd); + KMI_UNLOCK(); + + return (result); +} + +/* read one byte from the keyboard if it's allowed */ +/* Currently unused. */ +static int +kmi_read(keyboard_t *kbd, int wait) +{ + KMI_CTX_LOCK_ASSERT(); + + if (!KBD_IS_ACTIVE(kbd)) + return (-1); + + ++(kbd->kb_count); + printf("Implement ME: %s\n", __func__); + return (0); +} + +/* read char from the keyboard */ +static uint32_t +kmi_read_char_locked(keyboard_t *kbd, int wait) +{ + struct kmi_softc *sc = kbd->kb_data; + uint32_t reg, data; + + KMI_CTX_LOCK_ASSERT(); + + if (!KBD_IS_ACTIVE(kbd)) + return (NOKEY); + + reg = pl050_kmi_read_4(sc, KMIIR); + if (reg & KMIIR_RXINTR) { + data = pl050_kmi_read_4(sc, KMIDATA); + return (data); + } + + ++kbd->kb_count; + return (NOKEY); +} + +/* Currently wait is always false. */ +static uint32_t +kmi_read_char(keyboard_t *kbd, int wait) +{ + uint32_t keycode; + + KMI_LOCK(); + keycode = kmi_read_char_locked(kbd, wait); + KMI_UNLOCK(); + + return (keycode); +} + +/* some useful control functions */ +static int +kmi_ioctl_locked(keyboard_t *kbd, u_long cmd, caddr_t arg) +{ + struct kmi_softc *sc = kbd->kb_data; + int i; +#if defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD5) || \ + defined(COMPAT_FREEBSD4) || defined(COMPAT_43) + int ival; + +#endif + + KMI_LOCK_ASSERT(); + + switch (cmd) { + case KDGKBMODE: /* get keyboard mode */ + *(int *)arg = sc->sc_mode; + break; +#if defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD5) || \ + defined(COMPAT_FREEBSD4) || defined(COMPAT_43) + case _IO('K', 7): + ival = IOCPARM_IVAL(arg); + arg = (caddr_t)&ival; + /* FALLTHROUGH */ +#endif + case KDSKBMODE: /* set keyboard mode */ + switch (*(int *)arg) { + case K_XLATE: + if (sc->sc_mode != K_XLATE) { + /* make lock key state and LED state match */ + sc->sc_state &= ~LOCK_MASK; + sc->sc_state |= KBD_LED_VAL(kbd); + } + /* FALLTHROUGH */ + case K_RAW: + case K_CODE: + if (sc->sc_mode != *(int *)arg) { + if ((sc->sc_flags & KMI_FLAG_POLLING) == 0) + kmi_clear_state(kbd); + sc->sc_mode = *(int *)arg; + } + break; + default: + return (EINVAL); + } + break; + + case KDGETLED: /* get keyboard LED */ + *(int *)arg = KBD_LED_VAL(kbd); + break; +#if defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD5) || \ + defined(COMPAT_FREEBSD4) || defined(COMPAT_43) + case _IO('K', 66): + ival = IOCPARM_IVAL(arg); + arg = (caddr_t)&ival; + /* FALLTHROUGH */ +#endif + case KDSETLED: /* set keyboard LED */ + /* NOTE: lock key state in "sc_state" won't be changed */ + if (*(int *)arg & ~LOCK_MASK) + return (EINVAL); + + i = *(int *)arg; + + /* replace CAPS LED with ALTGR LED for ALTGR keyboards */ + if (sc->sc_mode == K_XLATE && + kbd->kb_keymap->n_keys > ALTGR_OFFSET) { + if (i & ALKED) + i |= CLKED; + else + i &= ~CLKED; + } + if (KBD_HAS_DEVICE(kbd)) + kmi_set_leds(sc, i); + + KBD_LED_VAL(kbd) = *(int *)arg; + break; + case KDGKBSTATE: /* get lock key state */ + *(int *)arg = sc->sc_state & LOCK_MASK; + break; +#if defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD5) || \ + defined(COMPAT_FREEBSD4) || defined(COMPAT_43) + case _IO('K', 20): + ival = IOCPARM_IVAL(arg); + arg = (caddr_t)&ival; + /* FALLTHROUGH */ +#endif + case KDSKBSTATE: /* set lock key state */ + if (*(int *)arg & ~LOCK_MASK) { + return (EINVAL); + } + sc->sc_state &= ~LOCK_MASK; + sc->sc_state |= *(int *)arg; + + /* set LEDs and quit */ + return (kmi_ioctl(kbd, KDSETLED, arg)); + + case KDSETREPEAT: /* set keyboard repeat rate (new + * interface) */ + if (!KBD_HAS_DEVICE(kbd)) { + return (0); + } + if (((int *)arg)[1] < 0) { + return (EINVAL); + } + if (((int *)arg)[0] < 0) { + return (EINVAL); + } + if (((int *)arg)[0] < 200) /* fastest possible value */ + kbd->kb_delay1 = 200; + else + kbd->kb_delay1 = ((int *)arg)[0]; + kbd->kb_delay2 = ((int *)arg)[1]; + return (0); + +#if defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD5) || \ + defined(COMPAT_FREEBSD4) || defined(COMPAT_43) + case _IO('K', 67): + ival = IOCPARM_IVAL(arg); + arg = (caddr_t)&ival; + /* FALLTHROUGH */ +#endif + case KDSETRAD: /* set keyboard repeat rate (old + * interface) */ + return (kmi_set_typematic(kbd, *(int *)arg)); + + case PIO_KEYMAP: /* set keyboard translation table */ + case OPIO_KEYMAP: /* set keyboard translation table + * (compat) */ + case PIO_KEYMAPENT: /* set keyboard translation table + * entry */ + case PIO_DEADKEYMAP: /* set accent key translation table */ + sc->sc_accents = 0; + /* FALLTHROUGH */ + default: + return (genkbd_commonioctl(kbd, cmd, arg)); + } + + return (0); +} + +static int +kmi_ioctl(keyboard_t *kbd, u_long cmd, caddr_t arg) +{ + int result; + + /* + * XXX KDGKBSTATE, KDSKBSTATE and KDSETLED can be called from any + * context where printf(9) can be called, which among other things + * includes interrupt filters and threads with any kinds of locks + * already held. For this reason it would be dangerous to acquire + * the Giant here unconditionally. On the other hand we have to + * have it to handle the ioctl. + * So we make our best effort to auto-detect whether we can grab + * the Giant or not. Blame syscons(4) for this. + */ + switch (cmd) { + case KDGKBSTATE: + case KDSKBSTATE: + case KDSETLED: + if (!mtx_owned(&Giant) && !SCHEDULER_STOPPED()) + return (EDEADLK); /* best I could come up with */ + /* FALLTHROUGH */ + default: + KMI_LOCK(); + result = kmi_ioctl_locked(kbd, cmd, arg); + KMI_UNLOCK(); + return (result); + } +} + + +/* clear the internal state of the keyboard */ +static void +kmi_clear_state(keyboard_t *kbd) +{ + struct kmi_softc *sc = kbd->kb_data; + + KMI_CTX_LOCK_ASSERT(); + + sc->sc_flags &= ~(KMI_FLAG_COMPOSE | KMI_FLAG_POLLING); + sc->sc_state &= LOCK_MASK; /* preserve locking key state */ + sc->sc_accents = 0; +} + +/* save the internal state, not used */ +static int +kmi_get_state(keyboard_t *kbd, void *buf, size_t len) +{ + return (len == 0) ? 1 : -1; +} + +/* set the internal state, not used */ +static int +kmi_set_state(keyboard_t *kbd, void *buf, size_t len) +{ + return (EINVAL); +} + +static int +kmi_poll(keyboard_t *kbd, int on) +{ + struct kmi_softc *sc = kbd->kb_data; + + KMI_LOCK(); + if (on) { + sc->sc_flags |= KMI_FLAG_POLLING; + sc->sc_poll_thread = curthread; + } else { + sc->sc_flags &= ~KMI_FLAG_POLLING; + } + KMI_UNLOCK(); + + return (0); +} + +/* local functions */ + +static void +kmi_set_leds(struct kmi_softc *sc, uint8_t leds) +{ + + KMI_LOCK_ASSERT(); + + /* start transfer, if not already started */ + printf("Implement me: %s\n", __func__); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Thu Dec 13 23:32:48 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C560052B; Thu, 13 Dec 2012 23:32:48 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9DC898FC0C; Thu, 13 Dec 2012 23:32:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBDNWm19037507; Thu, 13 Dec 2012 23:32:48 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBDNWmK4037503; Thu, 13 Dec 2012 23:32:48 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201212132332.qBDNWmK4037503@svn.freebsd.org> From: Xin LI Date: Thu, 13 Dec 2012 23:32:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244198 - in head: etc/rc.d sbin/sysctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 13 Dec 2012 23:32:48 -0000 Author: delphij Date: Thu Dec 13 23:32:47 2012 New Revision: 244198 URL: http://svnweb.freebsd.org/changeset/base/244198 Log: Teach sysctl(8) about parsing a file (while I'm there also give it capability of parsing both = and : formats). Submitted by: hrs (initial version, bugs are mine) MFC after: 3 months Modified: head/etc/rc.d/sysctl head/sbin/sysctl/sysctl.8 head/sbin/sysctl/sysctl.c Modified: head/etc/rc.d/sysctl ============================================================================== --- head/etc/rc.d/sysctl Thu Dec 13 23:19:13 2012 (r244197) +++ head/etc/rc.d/sysctl Thu Dec 13 23:32:47 2012 (r244198) @@ -8,51 +8,27 @@ . /etc/rc.subr name="sysctl" +command="/sbin/sysctl" stop_cmd=":" start_cmd="sysctl_start" reload_cmd="sysctl_start" lastload_cmd="sysctl_start last" extra_commands="reload lastload" -# -# Read in a file containing sysctl settings and set things accordingly. -# -parse_file() -{ - if [ -f $1 ]; then - while read var comments - do - case ${var} in - \#*|'') - ;; - *) - mib=${var%=*} - val=${var#*=} - - if current_value=`${SYSCTL} -n ${mib} 2>/dev/null`; then - case ${current_value} in - ${val}) - ;; - *) - if ! sysctl "${var}" >/dev/null 2>&1; then - warn "unable to set ${var}" - fi - ;; - esac - elif [ "$2" = "last" ]; then - warn "sysctl ${mib} does not exist." - fi - ;; - esac - done < $1 - fi -} - sysctl_start() { - - parse_file /etc/sysctl.conf $1 - parse_file /etc/sysctl.conf.local $1 + case $1 in + last) + command_args="-i -f" + ;; + *) + command_args="-f" + ;; + esac + + for _f in /etc/sysctl.conf /etc/sysctl.conf.local; do + [ -r ${_f} ] && ${command} ${command_args} ${_f} > /dev/null + done } load_rc_config $name Modified: head/sbin/sysctl/sysctl.8 ============================================================================== --- head/sbin/sysctl/sysctl.8 Thu Dec 13 23:19:13 2012 (r244197) +++ head/sbin/sysctl/sysctl.8 Thu Dec 13 23:32:47 2012 (r244198) @@ -28,7 +28,7 @@ .\" From: @(#)sysctl.8 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd January 17, 2011 +.Dd December 13, 2012 .Dt SYSCTL 8 .Os .Sh NAME @@ -37,6 +37,7 @@ .Sh SYNOPSIS .Nm .Op Fl bdehiNnoRTqx +.Op Fl f Ar filename .Ar name Ns Op = Ns Ar value .Ar ... .Nm @@ -80,6 +81,11 @@ This option is ignored if either or .Fl n is specified, or a variable is being set. +.It Fl f Ar filename +Specify a file which contains a pair of name and value in each line. +.Nm +reads and processes the specified file first and then processes the name +and value pairs in the command line argument. .It Fl h Format output for human, rather than machine, readability. .It Fl i Modified: head/sbin/sysctl/sysctl.c ============================================================================== --- head/sbin/sysctl/sysctl.c Thu Dec 13 23:19:13 2012 (r244197) +++ head/sbin/sysctl/sysctl.c Thu Dec 13 23:32:47 2012 (r244198) @@ -56,13 +56,17 @@ static const char rcsid[] = #include #include #include +#include #include +static const char *conffile; + static int aflag, bflag, dflag, eflag, hflag, iflag; -static int Nflag, nflag, oflag, qflag, Tflag, Wflag, xflag, warncount; +static int Nflag, nflag, oflag, qflag, Tflag, Wflag, xflag; static int oidfmt(int *, int, char *, u_int *); -static void parse(const char *); +static int parsefile(const char *); +static int parse(const char *, int); static int show_var(int *, int); static int sysctl_all(int *oid, int len); static int name2oid(char *, int *); @@ -74,7 +78,7 @@ usage(void) { (void)fprintf(stderr, "%s\n%s\n", - "usage: sysctl [-bdehiNnoqTWx] name[=value] ...", + "usage: sysctl [-bdehiNnoqTWx] [-f filename] name[=value] ...", " sysctl [-bdehNnoqTWx] -a"); exit(1); } @@ -83,12 +87,13 @@ int main(int argc, char **argv) { int ch; + int warncount = 0; setlocale(LC_NUMERIC, ""); setbuf(stdout,0); setbuf(stderr,0); - while ((ch = getopt(argc, argv, "AabdehiNnoqTwWxX")) != -1) { + while ((ch = getopt(argc, argv, "Aabdef:hiNnoqTwWxX")) != -1) { switch (ch) { case 'A': /* compatibility */ @@ -106,6 +111,9 @@ main(int argc, char **argv) case 'e': eflag = 1; break; + case 'f': + conffile = optarg; + break; case 'h': hflag = 1; break; @@ -152,13 +160,17 @@ main(int argc, char **argv) usage(); if (aflag && argc == 0) exit(sysctl_all(0, 0)); - if (argc == 0) + if (argc == 0 && conffile == NULL) usage(); warncount = 0; + if (conffile != NULL) + warncount += parsefile(conffile); + while (argc-- > 0) - parse(*argv++); - exit(warncount); + warncount += parse(*argv++, 0); + + return (warncount); } /* @@ -166,8 +178,8 @@ main(int argc, char **argv) * Lookup and print out the MIB entry if it exists. * Set a new value if requested. */ -static void -parse(const char *string) +static int +parse(const char *string, int lineno) { int len, i, j; void *newval = 0; @@ -179,13 +191,20 @@ parse(const char *string) int64_t i64val; uint64_t u64val; int mib[CTL_MAXNAME]; - char *cp, *bufp, buf[BUFSIZ], *endptr, fmt[BUFSIZ]; + char *cp, *bufp, buf[BUFSIZ], *endptr, fmt[BUFSIZ], line[BUFSIZ]; u_int kind; + if (lineno) + snprintf(line, sizeof(line), " at line %d", lineno); + else + line[0] = '\0'; + cp = buf; - if (snprintf(buf, BUFSIZ, "%s", string) >= BUFSIZ) - errx(1, "oid too long: '%s'", string); - bufp = strsep(&cp, "="); + if (snprintf(buf, BUFSIZ, "%s", string) >= BUFSIZ) { + warn("oid too long: '%s'%s", string, line); + return (1); + } + bufp = strsep(&cp, "=:"); if (cp != NULL) { /* Tflag just lists tunables, do not allow assignment */ if (Tflag || Wflag) { @@ -194,6 +213,14 @@ parse(const char *string) } while (isspace(*cp)) cp++; + /* Strip a pair of " or ' if any. */ + switch (*cp) { + case '\"': + case '\'': + if (cp[strlen(cp) - 1] == *cp) + cp[strlen(cp) - 1] = '\0'; + cp++; + } newval = cp; newsize = strlen(cp); } @@ -201,15 +228,22 @@ parse(const char *string) if (len < 0) { if (iflag) - return; + return (0); if (qflag) - exit(1); - else - errx(1, "unknown oid '%s'", bufp); + return (1); + else { + warn("unknown oid '%s'%s", bufp, line); + return (1); + } } - if (oidfmt(mib, len, fmt, &kind)) - err(1, "couldn't find format of oid '%s'", bufp); + if (oidfmt(mib, len, fmt, &kind)) { + warn("couldn't find format of oid '%s'%s", bufp, line); + if (iflag) + return (1); + else + exit(1); + } if (newval == NULL || dflag) { if ((kind & CTLTYPE) == CTLTYPE_NODE) { @@ -225,16 +259,18 @@ parse(const char *string) putchar('\n'); } } else { - if ((kind & CTLTYPE) == CTLTYPE_NODE) - errx(1, "oid '%s' isn't a leaf node", bufp); + if ((kind & CTLTYPE) == CTLTYPE_NODE) { + warn("oid '%s' isn't a leaf node%s", bufp, line); + return (1); + } if (!(kind & CTLFLAG_WR)) { if (kind & CTLFLAG_TUN) { - warnx("oid '%s' is a read only tunable", bufp); - errx(1, "Tunable values are set in /boot/loader.conf"); - } else { - errx(1, "oid '%s' is read only", bufp); - } + warnx("oid '%s' is a read only tunable%p", bufp, line); + warnx("Tunable values are set in /boot/loader.conf"); + } else + warnx("oid '%s' is read only%s", bufp, line); + return (1); } if ((kind & CTLTYPE) == CTLTYPE_INT || @@ -243,47 +279,59 @@ parse(const char *string) (kind & CTLTYPE) == CTLTYPE_ULONG || (kind & CTLTYPE) == CTLTYPE_S64 || (kind & CTLTYPE) == CTLTYPE_U64) { - if (strlen(newval) == 0) - errx(1, "empty numeric value"); + if (strlen(newval) == 0) { + warnx("empty numeric value"); + return (1); + } } switch (kind & CTLTYPE) { case CTLTYPE_INT: if (strcmp(fmt, "IK") == 0) { - if (!set_IK(newval, &intval)) - errx(1, "invalid value '%s'", - (char *)newval); + if (!set_IK(newval, &intval)) { + warnx("invalid value '%s'%s", + (char *)newval, line); + return (1); + } } else { intval = (int)strtol(newval, &endptr, 0); - if (endptr == newval || *endptr != '\0') - errx(1, "invalid integer '%s'", - (char *)newval); + if (endptr == newval || *endptr != '\0') { + warnx("invalid integer '%s'%s", + (char *)newval, line); + return (1); + } } newval = &intval; newsize = sizeof(intval); break; case CTLTYPE_UINT: uintval = (int) strtoul(newval, &endptr, 0); - if (endptr == newval || *endptr != '\0') - errx(1, "invalid unsigned integer '%s'", - (char *)newval); + if (endptr == newval || *endptr != '\0') { + warnx("invalid unsigned integer '%s'%s", + (char *)newval, line); + return (1); + } newval = &uintval; newsize = sizeof(uintval); break; case CTLTYPE_LONG: longval = strtol(newval, &endptr, 0); - if (endptr == newval || *endptr != '\0') - errx(1, "invalid long integer '%s'", - (char *)newval); + if (endptr == newval || *endptr != '\0') { + warnx("invalid long integer '%s'%s", + (char *)newval, line); + return (1); + } newval = &longval; newsize = sizeof(longval); break; case CTLTYPE_ULONG: ulongval = strtoul(newval, &endptr, 0); - if (endptr == newval || *endptr != '\0') - errx(1, "invalid unsigned long integer" - " '%s'", (char *)newval); + if (endptr == newval || *endptr != '\0') { + warnx("invalid unsigned long integer" + " '%s'%s", (char *)newval, line); + return (1); + } newval = &ulongval; newsize = sizeof(ulongval); break; @@ -291,26 +339,31 @@ parse(const char *string) break; case CTLTYPE_S64: i64val = strtoimax(newval, &endptr, 0); - if (endptr == newval || *endptr != '\0') - errx(1, "invalid int64_t '%s'", - (char *)newval); + if (endptr == newval || *endptr != '\0') { + warnx("invalid int64_t '%s'%s", + (char *)newval, line); + return (1); + } newval = &i64val; newsize = sizeof(i64val); break; case CTLTYPE_U64: u64val = strtoumax(newval, &endptr, 0); - if (endptr == newval || *endptr != '\0') - errx(1, "invalid uint64_t '%s'", - (char *)newval); + if (endptr == newval || *endptr != '\0') { + warnx("invalid uint64_t '%s'%s", + (char *)newval, line); + return (1); + } newval = &u64val; newsize = sizeof(u64val); break; case CTLTYPE_OPAQUE: /* FALLTHROUGH */ default: - errx(1, "oid '%s' is type %d," - " cannot set that", bufp, - kind & CTLTYPE); + warnx("oid '%s' is type %d," + " cannot set that%s", bufp, + kind & CTLTYPE, line); + return (1); } i = show_var(mib, len); @@ -319,18 +372,20 @@ parse(const char *string) putchar('\n'); switch (errno) { case EOPNOTSUPP: - errx(1, "%s: value is not available", - string); + warnx("%s: value is not available%s", + string, line); + return (1); case ENOTDIR: - errx(1, "%s: specification is incomplete", - string); + warnx("%s: specification is incomplete%s", + string, line); + return (1); case ENOMEM: - errx(1, "%s: type is unknown to this program", - string); + warnx("%s: type is unknown to this program%s", + string, line); + return (1); default: - warn("%s", string); - warncount++; - return; + warn("%s%s", string, line); + return (1); } } if (!bflag) @@ -342,6 +397,58 @@ parse(const char *string) putchar('\n'); nflag = i; } + + return (0); +} + +static int +parsefile(const char *filename) +{ + FILE *file; + char line[BUFSIZ], *p, *pq, *pdq; + int warncount = 0, lineno = 0; + + file = fopen(filename, "r"); + if (file == NULL) + err(EX_NOINPUT, "%s", filename); + while (fgets(line, sizeof(line), file) != NULL) { + lineno++; + p = line; + pq = strchr(line, '\''); + pdq = strchr(line, '\"'); + /* Replace the first # with \0. */ + while((p = strchr(p, '#')) != NULL) { + if (pq != NULL && p > pq) { + if ((p = strchr(pq+1, '\'')) != NULL) + *(++p) = '\0'; + break; + } else if (pdq != NULL && p > pdq) { + if ((p = strchr(pdq+1, '\"')) != NULL) + *(++p) = '\0'; + break; + } else if (p == line || *(p-1) != '\\') { + *p = '\0'; + break; + } + p++; + } + /* Trim spaces */ + p = line + strlen(line) - 1; + while (p >= line && isspace((int)*p)) { + *p = '\0'; + p--; + } + p = line; + while (isspace((int)*p)) + p++; + if (*p == '\0') + continue; + else + warncount += parse(p, lineno); + } + fclose(file); + + return (warncount); } /* These functions will dump out various interesting structures. */ From owner-svn-src-head@FreeBSD.ORG Fri Dec 14 04:18:10 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BE15C8CD; Fri, 14 Dec 2012 04:18:10 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from fallbackmx08.syd.optusnet.com.au (fallbackmx08.syd.optusnet.com.au [211.29.132.10]) by mx1.freebsd.org (Postfix) with ESMTP id 490068FC08; Fri, 14 Dec 2012 04:18:09 +0000 (UTC) Received: from mail13.syd.optusnet.com.au (mail13.syd.optusnet.com.au [211.29.132.194]) by fallbackmx08.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id qBE4I8m0012042; Fri, 14 Dec 2012 15:18:09 +1100 Received: from c122-106-175-26.carlnfd1.nsw.optusnet.com.au (c122-106-175-26.carlnfd1.nsw.optusnet.com.au [122.106.175.26]) by mail13.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id qBE4HsTW027059 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 14 Dec 2012 15:17:57 +1100 Date: Fri, 14 Dec 2012 15:17:54 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Pawel Jakub Dawidek Subject: Re: svn commit: r244154 - head/bin/ps In-Reply-To: <20121213213147.GA1401@garage.freebsd.pl> Message-ID: <20121214151047.X973@besplex.bde.org> References: <201212121545.qBCFj4Hl086444@svn.freebsd.org> <20121212210652.GO3013@kib.kiev.ua> <20121213111240.GB1381@garage.freebsd.pl> <20121213161242.GE71906@kib.kiev.ua> <20121213165541.GD1381@garage.freebsd.pl> <20121213181621.GG71906@kib.kiev.ua> <20121213213147.GA1401@garage.freebsd.pl> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.0 cv=BrrFWvr5 c=1 sm=1 a=WqmuCUZ0mQMA:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=URALeSCvvZIA:10 a=6I5d2MoRAAAA:8 a=uS_ZUP-777TR7mEKaZ4A:9 a=CjuIK1q_8ugA:10 a=2ekcOSppvVBNGPxY:21 a=QDnF1dTDgF_j9QlS:21 a=bxQHXO5Py4tHmhUgaywp5w==:117 Cc: Konstantin Belousov , svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, jhb@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 14 Dec 2012 04:18:10 -0000 On Thu, 13 Dec 2012, Pawel Jakub Dawidek wrote: > On Thu, Dec 13, 2012 at 08:16:21PM +0200, Konstantin Belousov wrote: >> On Thu, Dec 13, 2012 at 05:55:41PM +0100, Pawel Jakub Dawidek wrote: >>> On Thu, Dec 13, 2012 at 06:12:42PM +0200, Konstantin Belousov wrote: >>>> On Thu, Dec 13, 2012 at 12:12:44PM +0100, Pawel Jakub Dawidek wrote: >>>>> On Wed, Dec 12, 2012 at 11:06:52PM +0200, Konstantin Belousov wrote: >>>>> I saw CTLFLAG_TUN on the sysctl and assumed it is read-only... >>>>> How about defining BSD_PID_MAX in sys/proc.h, which would be visible by >>>>> userland as well and setting PID_MAX to BSD_PID_MAX? >>>>> >>>>> This would also help bsnmpd. >>>>> >>>>> http://people.freebsd.org/~pjd/patches/PID_MAX.patch >>>> Do you know why PID_MAX is under _KERNEL ? If there is no real reason, >>>> it would be better to move it outside kernel-only section. sys/proc.h >>>> is not in POSIX anyway. I don't really know, but POSIX says that {PID_MAX} is intentionally left out of POSIX because pids_t might be cookies in a very large address space so that there is no useful use of {PID_MAX}. (POSIX doesn't say exactly this. It says "arrays of values of this type [uid_t, gid_t or pid_t] are unlikely to be fully portable".) >>> I assumed it will break some ports that may define it themselves. >>> I wonder if we could do a test ports build to see what's the impact. >> >> Sure. >> >> On the other hand, sys/proc.h is mostly useless for the application code >> as it is now. Might be, use >> #ifndef PID_MAX >> braces ? Ugh. If there is any useful use of {PID_MAX}, then this just breaks detection of using the wrong value. > This can be done of course, but it won't help cases where PID_MAX is > defined after sys/proc.h is included. Bruce From owner-svn-src-head@FreeBSD.ORG Fri Dec 14 04:31:03 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8B5C4B3D for ; Fri, 14 Dec 2012 04:31:03 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx1.freebsd.org (Postfix) with ESMTP id E1B388FC0C for ; Fri, 14 Dec 2012 04:31:02 +0000 (UTC) Received: by mail-lb0-f182.google.com with SMTP id go10so2418700lbb.13 for ; Thu, 13 Dec 2012 20:31:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=640rnusHD/pw2rtGMTBfIN+9YVYgLQgT8luyfD89wek=; b=qytBxeiCONRJqAd/hl06FnH3vifTv3vHarYdx3RR/Iv05IlYNor77eyXXUi+TAukQq Znv1BB6omL+IlZx0Hw+VS1DUjo7Xkl8o/7WGBHpUCJFdl02jdEPkd/ipEeYqO6oRUNxj wtoBTEDFK4/gqASNT67CejY7MpjvT1Fj4WuCI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :x-gm-message-state; bh=640rnusHD/pw2rtGMTBfIN+9YVYgLQgT8luyfD89wek=; b=NeQ1aexUXFNrCID4FqwdN93LssipIEqa9rzSOwjzPugzuuP26gwPA0ns5x5f8Wbqpj RykwpCMY8RWy66B/CoVwtMfDYnnXOXqrcCjXfIrtl+NfWRWWPHRiX2icpkL2W1ZYQpv7 X/YY7vUBYEy5W8+vNT+VuVAPPpgdRVX5Ac874PROInRzaxMGgfiYZzEXYaokBSg9BWW4 JdiQ/AJkCfEPg5I7cz9Oe7CUpFPzIIEGUdPfKMq/At5ErAcZuiSi1JWW18iPmELW6+bx cLffMkj6Wj8KeSJxP0IP5mMJcw8vFOfmTehsyzVCwqAuwR3YO9n+hzP6cDjwkoem8N9W N8Sg== Received: by 10.112.13.133 with SMTP id h5mr1717366lbc.99.1355459461590; Thu, 13 Dec 2012 20:31:01 -0800 (PST) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.112.149.225 with HTTP; Thu, 13 Dec 2012 20:30:31 -0800 (PST) In-Reply-To: <20121213181621.GG71906@kib.kiev.ua> References: <201212121545.qBCFj4Hl086444@svn.freebsd.org> <20121212210652.GO3013@kib.kiev.ua> <20121213111240.GB1381@garage.freebsd.pl> <20121213161242.GE71906@kib.kiev.ua> <20121213165541.GD1381@garage.freebsd.pl> <20121213181621.GG71906@kib.kiev.ua> From: Eitan Adler Date: Thu, 13 Dec 2012 23:30:31 -0500 X-Google-Sender-Auth: 95dwn3CxHqyZmJklhWGjDCUkogM Message-ID: Subject: Re: svn commit: r244154 - head/bin/ps To: Konstantin Belousov Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQlTkkaTYKKEc9SWEfgXSOwpuHRqwI9Mbug/ZnMPzwRtxNbUEHq/q54DyLv5XaJ/yZitxfb1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Pawel Jakub Dawidek , jhb@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 14 Dec 2012 04:31:03 -0000 On 13 December 2012 13:16, Konstantin Belousov wrote: > On Thu, Dec 13, 2012 at 05:55:41PM +0100, Pawel Jakub Dawidek wrote: >> On Thu, Dec 13, 2012 at 06:12:42PM +0200, Konstantin Belousov wrote: >> > On Thu, Dec 13, 2012 at 12:12:44PM +0100, Pawel Jakub Dawidek wrote: >> > > On Wed, Dec 12, 2012 at 11:06:52PM +0200, Konstantin Belousov wrote: >> > > I saw CTLFLAG_TUN on the sysctl and assumed it is read-only... >> > > How about defining BSD_PID_MAX in sys/proc.h, which would be visible by >> > > userland as well and setting PID_MAX to BSD_PID_MAX? >> > > >> > > This would also help bsnmpd. >> > > >> > > http://people.freebsd.org/~pjd/patches/PID_MAX.patch >> > Do you know why PID_MAX is under _KERNEL ? If there is no real reason, >> > it would be better to move it outside kernel-only section. sys/proc.h >> > is not in POSIX anyway. >> >> I assumed it will break some ports that may define it themselves. >> I wonder if we could do a test ports build to see what's the impact. > > Sure. > > On the other hand, sys/proc.h is mostly useless for the application code > as it is now. Might be, use > #ifndef PID_MAX > braces ? I think it makes more sense to unconditionally define it. A file including sys/proc.h almost certainly wants the real PID_MAX. It would be better to cause a pre-process time failure than to have it silently hide the problem. -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-head@FreeBSD.ORG Fri Dec 14 04:44:17 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 17943D35; Fri, 14 Dec 2012 04:44:17 +0000 (UTC) (envelope-from bright@mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id B51308FC08; Fri, 14 Dec 2012 04:44:16 +0000 (UTC) Received: from Alfreds-MacBook-Pro-6.local (c-67-180-208-218.hsd1.ca.comcast.net [67.180.208.218]) by elvis.mu.org (Postfix) with ESMTPSA id 537D21A3C1B; Thu, 13 Dec 2012 20:44:15 -0800 (PST) Message-ID: <50CAAE9F.7030708@mu.org> Date: Thu, 13 Dec 2012 20:44:15 -0800 From: Alfred Perlstein User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Eitan Adler Subject: Re: svn commit: r244154 - head/bin/ps References: <201212121545.qBCFj4Hl086444@svn.freebsd.org> <20121212210652.GO3013@kib.kiev.ua> <20121213111240.GB1381@garage.freebsd.pl> <20121213161242.GE71906@kib.kiev.ua> <20121213165541.GD1381@garage.freebsd.pl> <20121213181621.GG71906@kib.kiev.ua> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: src-committers@freebsd.org, Pawel Jakub Dawidek , jhb@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Konstantin Belousov X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 14 Dec 2012 04:44:17 -0000 On 12/13/12 8:30 PM, Eitan Adler wrote: > On 13 December 2012 13:16, Konstantin Belousov wrote: >> On Thu, Dec 13, 2012 at 05:55:41PM +0100, Pawel Jakub Dawidek wrote: >>> On Thu, Dec 13, 2012 at 06:12:42PM +0200, Konstantin Belousov wrote: >>>> On Thu, Dec 13, 2012 at 12:12:44PM +0100, Pawel Jakub Dawidek wrote: >>>>> On Wed, Dec 12, 2012 at 11:06:52PM +0200, Konstantin Belousov wrote: >>>>> I saw CTLFLAG_TUN on the sysctl and assumed it is read-only... >>>>> How about defining BSD_PID_MAX in sys/proc.h, which would be visible by >>>>> userland as well and setting PID_MAX to BSD_PID_MAX? >>>>> >>>>> This would also help bsnmpd. >>>>> >>>>> http://people.freebsd.org/~pjd/patches/PID_MAX.patch >>>> Do you know why PID_MAX is under _KERNEL ? If there is no real reason, >>>> it would be better to move it outside kernel-only section. sys/proc.h >>>> is not in POSIX anyway. >>> I assumed it will break some ports that may define it themselves. >>> I wonder if we could do a test ports build to see what's the impact. >> Sure. >> >> On the other hand, sys/proc.h is mostly useless for the application code >> as it is now. Might be, use >> #ifndef PID_MAX >> braces ? > I think it makes more sense to unconditionally define it. A file > including sys/proc.h almost certainly wants the real PID_MAX. It > would be better to cause a pre-process time failure than to have it > silently hide the problem. > > > I'm thinking it's much better to make it a sysctl readonly (kern.pidmax), not a compile time thing. think about page_size and other things that can change. by making it dynamic you force better programming style at the slight expense of a few cycles of compile time optimization. -Alfred From owner-svn-src-head@FreeBSD.ORG Fri Dec 14 04:49:47 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 23C56C9; Fri, 14 Dec 2012 04:49:47 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from fallbackmx08.syd.optusnet.com.au (fallbackmx08.syd.optusnet.com.au [211.29.132.10]) by mx1.freebsd.org (Postfix) with ESMTP id A69AA8FC08; Fri, 14 Dec 2012 04:49:46 +0000 (UTC) Received: from mail17.syd.optusnet.com.au (mail17.syd.optusnet.com.au [211.29.132.198]) by fallbackmx08.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id qBE4njAY015689; Fri, 14 Dec 2012 15:49:45 +1100 Received: from c122-106-175-26.carlnfd1.nsw.optusnet.com.au (c122-106-175-26.carlnfd1.nsw.optusnet.com.au [122.106.175.26]) by mail17.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id qBE4nZEB020208 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 14 Dec 2012 15:49:37 +1100 Date: Fri, 14 Dec 2012 15:49:35 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Jim Harris Subject: Re: svn commit: r244193 - head/sys/x86/include In-Reply-To: <201212132140.qBDLeBhd019751@svn.freebsd.org> Message-ID: <20121214154930.D973@besplex.bde.org> References: <201212132140.qBDLeBhd019751@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.0 cv=CJhyxmXD c=1 sm=1 a=L6I1Zbe1xPYA:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=RQfEP2Kgk-UA:10 a=DA7H5E3C-HH1s4Do58cA:9 a=CjuIK1q_8ugA:10 a=bxQHXO5Py4tHmhUgaywp5w==:117 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 14 Dec 2012 04:49:47 -0000 On Thu, 13 Dec 2012, Jim Harris wrote: > Log: > Add bus_space_read_8 and bus_space_write_8 for amd64. > > Rather than trying to KASSERT for callers that invoke this on > IO tags, either do nothing (for write_8) or return ~0 (for read_8). read_8 returns a uint64_t, so it cannot return the signed integer ~0. It actually returns this signed integer converted to uint64_t. On amd64, this is the 32 bit value 0xffffffff. The 64-bit value 0xffffffffffffffff should be returned. > Using KASSERT here just makes bus.h too messy from both > polluting bus.h with systm.h (for any number of drivers that include > bus.h without first including systm.h) or ports that use bus.h > directly (i.e. libpciaccess) as reported by zeising@. > > Also don't try to implement all of the other bus_space functions for > 8 byte access since realistically only these two are needed for some > devices that expose 64-bit memory-mapped registers. Good. > Put the amd64-specific functions here rather than sys/amd64/include/bus.h > so that we can keep this header unified for x86, as requested by mdf@ > and tijl@. Not so good. I don't really like any of the unified headers. > Modified: head/sys/x86/include/bus.h > ============================================================================== > --- head/sys/x86/include/bus.h Thu Dec 13 21:39:59 2012 (r244192) > +++ head/sys/x86/include/bus.h Thu Dec 13 21:40:11 2012 (r244193) > @@ -130,6 +130,7 @@ > #define BUS_SPACE_MAXADDR 0xFFFFFFFF > #endif This file spells the F in hex constants in upper case. In the above definition and in previous ones, it is careful to spell out the constants and not depend on sign extension. So it is also a style bug to use ~0. Style bug visible in the above: space instead of tab after #define. This style bugs is in all #define's near here, including the new one. Type error in #define's just before the above: the above BUS_SPACE_MAXADDR is for 32 bits. For amd64 and i386-PAE, BUS_SPACE_MAXADDR is of course 64 bits, but the ifdef tangle for it is not tangled enough to be correct: BUS_SPACE_MAXADDR is 0xFFFFFFFFFFFFFFFFULL, on both, but bus_addr_t is only unsigned long long on i386-PAE. > > +#define BUS_SPACE_INVALID_DATA (~0) > #define BUS_SPACE_UNRESTRICTED (~0) > > /* > @@ -221,6 +222,12 @@ static __inline u_int32_t bus_space_read > bus_space_handle_t handle, > bus_size_t offset); > > +#ifdef __amd64__ > +static __inline uint64_t bus_space_read_8(bus_space_tag_t tag, > + bus_space_handle_t handle, > + bus_size_t offset); > +#endif > + This is style-bug for bug compatible with the existing forward declarations. Forward declarations of inline functions are nonsense. They are from NetBSD, for K&R support. But FreeBSD never supported K&R in bus-space headers, and the forward declarations never even compiled with K&R, since they never used __P(()). Almost 1/3 of the x86 bus.h consists of these negatively useful forward declarations. Some of them are almost as large as the full functions, since they are misformatted worse, with parameters starting at about column 40 instead of about column 20, so so that many lines are needed just for the parameters (to line them up in perfectly non-KNF gnu style). > ... > @@ -251,8 +258,16 @@ bus_space_read_4(bus_space_tag_t tag, bu > return (*(volatile u_int32_t *)(handle + offset)); > } > > -#if 0 /* Cause a link error for bus_space_read_8 */ > -#define bus_space_read_8(t, h, o) !!! bus_space_read_8 unimplemented !!! > +#ifdef __amd64__ > +static __inline uint64_t > +bus_space_read_8(bus_space_tag_t tag, bus_space_handle_t handle, > + bus_size_t offset) > +{ > + > + if (tag == X86_BUS_SPACE_IO) /* No 8 byte IO space access on x86 */ The comment is not indented, and should probably not be placed to the right of the code. This file mostly doesn't place comments there, and when it does it doesn't capitalize them. One that does also spells IO as i/o. > + return (BUS_SPACE_INVALID_DATA); > + return (*(volatile uint64_t *)(handle + offset)); > +} > #endif Bruce From owner-svn-src-head@FreeBSD.ORG Fri Dec 14 05:27:58 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0E39D59A; Fri, 14 Dec 2012 05:27:58 +0000 (UTC) (envelope-from bryanv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E5DAB8FC08; Fri, 14 Dec 2012 05:27:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBE5RvW0097155; Fri, 14 Dec 2012 05:27:57 GMT (envelope-from bryanv@svn.freebsd.org) Received: (from bryanv@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBE5Rvue097151; Fri, 14 Dec 2012 05:27:57 GMT (envelope-from bryanv@svn.freebsd.org) Message-Id: <201212140527.qBE5Rvue097151@svn.freebsd.org> From: Bryan Venteicher Date: Fri, 14 Dec 2012 05:27:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244200 - in head/sys/dev/virtio: block network scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 14 Dec 2012 05:27:58 -0000 Author: bryanv Date: Fri Dec 14 05:27:56 2012 New Revision: 244200 URL: http://svnweb.freebsd.org/changeset/base/244200 Log: virtio: Start taskqueues threads after attach cannot fail If virtio_setup_intr() failed during boot, we would hang in taskqueue_free() -> taskqueue_terminate() for all the taskq threads to terminate. This will never happen since the scheduler is not running by this point. Reported by: neel, grehan Approved by: grehan (mentor) Modified: head/sys/dev/virtio/block/virtio_blk.c head/sys/dev/virtio/network/if_vtnet.c head/sys/dev/virtio/scsi/virtio_scsi.c Modified: head/sys/dev/virtio/block/virtio_blk.c ============================================================================== --- head/sys/dev/virtio/block/virtio_blk.c Fri Dec 14 00:13:29 2012 (r244199) +++ head/sys/dev/virtio/block/virtio_blk.c Fri Dec 14 05:27:56 2012 (r244200) @@ -338,8 +338,6 @@ vtblk_attach(device_t dev) device_printf(dev, "cannot allocate taskqueue\n"); goto fail; } - taskqueue_start_threads(&sc->vtblk_tq, 1, PI_DISK, "%s taskq", - device_get_nameunit(dev)); error = virtio_setup_intr(dev, INTR_TYPE_BIO | INTR_ENTROPY); if (error) { @@ -347,6 +345,9 @@ vtblk_attach(device_t dev) goto fail; } + taskqueue_start_threads(&sc->vtblk_tq, 1, PI_DISK, "%s taskq", + device_get_nameunit(dev)); + vtblk_create_disk(sc); virtqueue_enable_intr(sc->vtblk_vq); Modified: head/sys/dev/virtio/network/if_vtnet.c ============================================================================== --- head/sys/dev/virtio/network/if_vtnet.c Fri Dec 14 00:13:29 2012 (r244199) +++ head/sys/dev/virtio/network/if_vtnet.c Fri Dec 14 05:27:56 2012 (r244200) @@ -439,18 +439,17 @@ vtnet_attach(device_t dev) ether_ifdetach(ifp); goto fail; } - taskqueue_start_threads(&sc->vtnet_tq, 1, PI_NET, "%s taskq", - device_get_nameunit(dev)); error = virtio_setup_intr(dev, INTR_TYPE_NET); if (error) { device_printf(dev, "cannot setup virtqueue interrupts\n"); - taskqueue_free(sc->vtnet_tq); - sc->vtnet_tq = NULL; ether_ifdetach(ifp); goto fail; } + taskqueue_start_threads(&sc->vtnet_tq, 1, PI_NET, "%s taskq", + device_get_nameunit(dev)); + /* * Device defaults to promiscuous mode for backwards * compatibility. Turn it off if possible. Modified: head/sys/dev/virtio/scsi/virtio_scsi.c ============================================================================== --- head/sys/dev/virtio/scsi/virtio_scsi.c Fri Dec 14 00:13:29 2012 (r244199) +++ head/sys/dev/virtio/scsi/virtio_scsi.c Fri Dec 14 05:27:56 2012 (r244200) @@ -347,12 +347,6 @@ vtscsi_attach(device_t dev) device_printf(dev, "cannot allocate taskqueue\n"); goto fail; } - error = taskqueue_start_threads(&sc->vtscsi_tq, 1, PI_DISK, "%s taskq", - device_get_nameunit(dev)); - if (error) { - device_printf(dev, "cannot start taskqueue threads\n"); - goto fail; - } error = virtio_setup_intr(dev, INTR_TYPE_CAM); if (error) { @@ -360,6 +354,9 @@ vtscsi_attach(device_t dev) goto fail; } + taskqueue_start_threads(&sc->vtscsi_tq, 1, PI_DISK, "%s taskq", + device_get_nameunit(dev)); + vtscsi_enable_vqs_intr(sc); /* From owner-svn-src-head@FreeBSD.ORG Fri Dec 14 05:33:51 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7B7577DC; Fri, 14 Dec 2012 05:33:51 +0000 (UTC) (envelope-from mr.kodiak@gmail.com) Received: from mail-we0-f182.google.com (mail-we0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id A48978FC0A; Fri, 14 Dec 2012 05:33:50 +0000 (UTC) Received: by mail-we0-f182.google.com with SMTP id u54so1309004wey.13 for ; Thu, 13 Dec 2012 21:33:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:content-type; bh=GknoNeoDucPP1gQVz/bbZdbDEvmcVrjB6uEf7xkr6Mw=; b=c6psycvTUFi9cSopUZCKI/oVfiRW58zI9Uh7Ltb9Ru2gl1gxGgLyq3Mu7H2NadvYip 8CpHtDsp9TaoJPzt9jZf3LL5N7uozyo7+YAeG3a0WHDp5q1C4MnsBEYm2wQX7KqprxN3 SGoJ3eN03jS6g6jQbqSG83Ymjnjw7REqQ3Y4xc9OZcAWqRD7G8lmTfny7R/92csd7TQG qgLY7D2Hu0l6npk8/gbceS0Q6L30N6h3zyBUy+AYOUYrZxoPm7UYyKouzUMU/r07I0JG h68ePzbRgtuIufnjLGXgYuW7WxjaeMphl65dWwZiTS+Cr09oof36ZSojBBO1isDaxs8e CctA== Received: by 10.194.88.98 with SMTP id bf2mr1488675wjb.49.1355463229183; Thu, 13 Dec 2012 21:33:49 -0800 (PST) MIME-Version: 1.0 Sender: mr.kodiak@gmail.com Received: by 10.216.108.130 with HTTP; Thu, 13 Dec 2012 21:33:19 -0800 (PST) In-Reply-To: <201212140527.qBE5Rvue097151@svn.freebsd.org> References: <201212140527.qBE5Rvue097151@svn.freebsd.org> From: Bryan Venteicher Date: Thu, 13 Dec 2012 23:33:19 -0600 X-Google-Sender-Auth: L5gQUPylGIlWVr2Z_w7nnzUHC-Q Message-ID: Subject: Re: svn commit: r244200 - in head/sys/dev/virtio: block network scsi To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 14 Dec 2012 05:33:51 -0000 On Thu, Dec 13, 2012 at 11:27 PM, Bryan Venteicher wrote: > > Author: bryanv > Date: Fri Dec 14 05:27:56 2012 > New Revision: 244200 > URL: http://svnweb.freebsd.org/changeset/base/244200 > > Log: > virtio: Start taskqueues threads after attach cannot fail > > If virtio_setup_intr() failed during boot, we would hang in > taskqueue_free() -> taskqueue_terminate() for all the taskq > threads to terminate. This will never happen since the > scheduler is not running by this point. > FWIW, this seems to be a pretty common bug across dozen of drivers. bus_setup_intr() is not very likely to fail though. For VirtIO, it is somewhat a moot point because the taskqueues are about to be removed and replaced with ithreads as I should have done in the beginning. > Reported by: neel, grehan > Approved by: grehan (mentor) > > Modified: > head/sys/dev/virtio/block/virtio_blk.c > head/sys/dev/virtio/network/if_vtnet.c > head/sys/dev/virtio/scsi/virtio_scsi.c > > Modified: head/sys/dev/virtio/block/virtio_blk.c > > ============================================================================== > --- head/sys/dev/virtio/block/virtio_blk.c Fri Dec 14 00:13:29 2012 > (r244199) > +++ head/sys/dev/virtio/block/virtio_blk.c Fri Dec 14 05:27:56 2012 > (r244200) > @@ -338,8 +338,6 @@ vtblk_attach(device_t dev) > device_printf(dev, "cannot allocate taskqueue\n"); > goto fail; > } > - taskqueue_start_threads(&sc->vtblk_tq, 1, PI_DISK, "%s taskq", > - device_get_nameunit(dev)); > > error = virtio_setup_intr(dev, INTR_TYPE_BIO | INTR_ENTROPY); > if (error) { > @@ -347,6 +345,9 @@ vtblk_attach(device_t dev) > goto fail; > } > > + taskqueue_start_threads(&sc->vtblk_tq, 1, PI_DISK, "%s taskq", > + device_get_nameunit(dev)); > + > vtblk_create_disk(sc); > > virtqueue_enable_intr(sc->vtblk_vq); > > Modified: head/sys/dev/virtio/network/if_vtnet.c > > ============================================================================== > --- head/sys/dev/virtio/network/if_vtnet.c Fri Dec 14 00:13:29 2012 > (r244199) > +++ head/sys/dev/virtio/network/if_vtnet.c Fri Dec 14 05:27:56 2012 > (r244200) > @@ -439,18 +439,17 @@ vtnet_attach(device_t dev) > ether_ifdetach(ifp); > goto fail; > } > - taskqueue_start_threads(&sc->vtnet_tq, 1, PI_NET, "%s taskq", > - device_get_nameunit(dev)); > > error = virtio_setup_intr(dev, INTR_TYPE_NET); > if (error) { > device_printf(dev, "cannot setup virtqueue interrupts\n"); > - taskqueue_free(sc->vtnet_tq); > - sc->vtnet_tq = NULL; > ether_ifdetach(ifp); > goto fail; > } > > + taskqueue_start_threads(&sc->vtnet_tq, 1, PI_NET, "%s taskq", > + device_get_nameunit(dev)); > + > /* > * Device defaults to promiscuous mode for backwards > * compatibility. Turn it off if possible. > > Modified: head/sys/dev/virtio/scsi/virtio_scsi.c > > ============================================================================== > --- head/sys/dev/virtio/scsi/virtio_scsi.c Fri Dec 14 00:13:29 2012 > (r244199) > +++ head/sys/dev/virtio/scsi/virtio_scsi.c Fri Dec 14 05:27:56 2012 > (r244200) > @@ -347,12 +347,6 @@ vtscsi_attach(device_t dev) > device_printf(dev, "cannot allocate taskqueue\n"); > goto fail; > } > - error = taskqueue_start_threads(&sc->vtscsi_tq, 1, PI_DISK, "%s > taskq", > - device_get_nameunit(dev)); > - if (error) { > - device_printf(dev, "cannot start taskqueue threads\n"); > - goto fail; > - } > > error = virtio_setup_intr(dev, INTR_TYPE_CAM); > if (error) { > @@ -360,6 +354,9 @@ vtscsi_attach(device_t dev) > goto fail; > } > > + taskqueue_start_threads(&sc->vtscsi_tq, 1, PI_DISK, "%s taskq", > + device_get_nameunit(dev)); > + > vtscsi_enable_vqs_intr(sc); > > /* From owner-svn-src-head@FreeBSD.ORG Fri Dec 14 08:02:36 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1ACC82F7; Fri, 14 Dec 2012 08:02:36 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F14198FC14; Fri, 14 Dec 2012 08:02:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBE82Z8v018914; Fri, 14 Dec 2012 08:02:35 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBE82ZdY018913; Fri, 14 Dec 2012 08:02:35 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201212140802.qBE82ZdY018913@svn.freebsd.org> From: Gleb Smirnoff Date: Fri, 14 Dec 2012 08:02:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244202 - head/sys/netpfil/pf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 14 Dec 2012 08:02:36 -0000 Author: glebius Date: Fri Dec 14 08:02:35 2012 New Revision: 244202 URL: http://svnweb.freebsd.org/changeset/base/244202 Log: Fix VIMAGE build broken in r244185. Submitted by: Nikolai Lifanov Modified: head/sys/netpfil/pf/if_pfsync.c Modified: head/sys/netpfil/pf/if_pfsync.c ============================================================================== --- head/sys/netpfil/pf/if_pfsync.c Fri Dec 14 07:48:03 2012 (r244201) +++ head/sys/netpfil/pf/if_pfsync.c Fri Dec 14 08:02:35 2012 (r244202) @@ -615,7 +615,7 @@ pfsync_input(struct mbuf *m, __unused in len = ntohs(ph->len) + offset; if (m->m_pkthdr.len < len) { - pfsyncstats.pfsyncs_badlen++; + V_pfsyncstats.pfsyncs_badlen++; goto done; } From owner-svn-src-head@FreeBSD.ORG Fri Dec 14 12:37:36 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 01C6F914; Fri, 14 Dec 2012 12:37:36 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DBD2C8FC0C; Fri, 14 Dec 2012 12:37:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBECbZ21060198; Fri, 14 Dec 2012 12:37:35 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBECbZbM060197; Fri, 14 Dec 2012 12:37:35 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201212141237.qBECbZbM060197@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Fri, 14 Dec 2012 12:37:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244209 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 14 Dec 2012 12:37:36 -0000 Author: ae Date: Fri Dec 14 12:37:35 2012 New Revision: 244209 URL: http://svnweb.freebsd.org/changeset/base/244209 Log: Add an #include guard to the sys/fnv_hash.h. MFC after: 3 days Modified: head/sys/sys/fnv_hash.h Modified: head/sys/sys/fnv_hash.h ============================================================================== --- head/sys/sys/fnv_hash.h Fri Dec 14 11:38:15 2012 (r244208) +++ head/sys/sys/fnv_hash.h Fri Dec 14 12:37:35 2012 (r244209) @@ -7,6 +7,8 @@ * * $FreeBSD$ */ +#ifndef _SYS_FNV_HASH_H_ +#define _SYS_FNV_HASH_H_ typedef u_int32_t Fnv32_t; typedef u_int64_t Fnv64_t; @@ -66,3 +68,4 @@ fnv_64_str(const char *str, Fnv64_t hval } return hval; } +#endif /* _SYS_FNV_HASH_H_ */ From owner-svn-src-head@FreeBSD.ORG Fri Dec 14 13:01:17 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 629B213D; Fri, 14 Dec 2012 13:01:17 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 46C368FC1C; Fri, 14 Dec 2012 13:01:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBED1HnL063872; Fri, 14 Dec 2012 13:01:17 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBED1H0I063871; Fri, 14 Dec 2012 13:01:17 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201212141301.qBED1H0I063871@svn.freebsd.org> From: Gleb Smirnoff Date: Fri, 14 Dec 2012 13:01:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244210 - head/sys/netpfil/pf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 14 Dec 2012 13:01:17 -0000 Author: glebius Date: Fri Dec 14 13:01:16 2012 New Revision: 244210 URL: http://svnweb.freebsd.org/changeset/base/244210 Log: Fix error in r235991. No-sleep version of IFNET_RLOCK() should be used here, since we may hold the main pf rulesets rwlock. Reported by: Fleuriot Damien Modified: head/sys/netpfil/pf/pf_if.c Modified: head/sys/netpfil/pf/pf_if.c ============================================================================== --- head/sys/netpfil/pf/pf_if.c Fri Dec 14 12:37:35 2012 (r244209) +++ head/sys/netpfil/pf/pf_if.c Fri Dec 14 13:01:16 2012 (r244210) @@ -478,10 +478,10 @@ pfi_table_update(struct pfr_ktable *kt, if (kif->pfik_ifp != NULL) pfi_instance_add(kif->pfik_ifp, net, flags); else if (kif->pfik_group != NULL) { - IFNET_RLOCK(); + IFNET_RLOCK_NOSLEEP(); TAILQ_FOREACH(ifgm, &kif->pfik_group->ifg_members, ifgm_next) pfi_instance_add(ifgm->ifgm_ifp, net, flags); - IFNET_RUNLOCK(); + IFNET_RUNLOCK_NOSLEEP(); } if ((e = pfr_set_addrs(&kt->pfrkt_t, V_pfi_buffer, V_pfi_buffer_cnt, &size2, From owner-svn-src-head@FreeBSD.ORG Fri Dec 14 15:01:23 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EE5C7714; Fri, 14 Dec 2012 15:01:23 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B947B8FC0A; Fri, 14 Dec 2012 15:01:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBEF1NiO082472; Fri, 14 Dec 2012 15:01:23 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBEF1Nj5082470; Fri, 14 Dec 2012 15:01:23 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201212141501.qBEF1Nj5082470@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Fri, 14 Dec 2012 15:01:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244215 - head/sbin/savecore X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 14 Dec 2012 15:01:24 -0000 Author: pjd Date: Fri Dec 14 15:01:23 2012 New Revision: 244215 URL: http://svnweb.freebsd.org/changeset/base/244215 Log: Whitespace cleanups. Modified: head/sbin/savecore/savecore.c Modified: head/sbin/savecore/savecore.c ============================================================================== --- head/sbin/savecore/savecore.c Fri Dec 14 14:59:35 2012 (r244214) +++ head/sbin/savecore/savecore.c Fri Dec 14 15:01:23 2012 (r244215) @@ -194,7 +194,7 @@ check_space(const char *savedir, off_t d syslog(LOG_ERR, "%s: %m", savedir); exit(1); } - spacefree = ((off_t) fsbuf.f_bavail * fsbuf.f_bsize) / 1024; + spacefree = ((off_t) fsbuf.f_bavail * fsbuf.f_bsize) / 1024; totfree = ((off_t) fsbuf.f_bfree * fsbuf.f_bsize) / 1024; (void)snprintf(path, sizeof(path), "%s/minfree", savedir); @@ -209,7 +209,7 @@ check_space(const char *savedir, off_t d } needed = dumpsize / 1024 + 2; /* 2 for info file */ - if (((minfree > 0) ? spacefree : totfree) - needed < minfree) { + if (((minfree > 0) ? spacefree : totfree) - needed < minfree) { syslog(LOG_WARNING, "no dump, not enough free space on device (%lld available, need %lld)", (long long)(minfree > 0 ? spacefree : totfree), @@ -262,7 +262,7 @@ DoRegularFile(int fd, off_t dumpsize, ch if (he >= hs + BLOCKSIZE) break; } - + /* back down to a block boundary */ he &= BLOCKMASK; @@ -433,7 +433,7 @@ DoFile(const char *savedir, const char * syslog(LOG_ERR, "unknown version (%d) in last dump header on %s", dtoh32(kdhl.version), device); - + status = STATUS_BAD; if (force == 0) goto closefd; @@ -444,7 +444,7 @@ DoFile(const char *savedir, const char * syslog(LOG_ERR, "unknown version (%d) in last dump header on %s", dtoh32(kdhl.version), device); - + status = STATUS_BAD; if (force == 0) goto closefd; @@ -472,7 +472,7 @@ DoFile(const char *savedir, const char * syslog(LOG_ERR, "unknown version (%d) in last dump header on %s", dtoh32(kdhl.version), device); - + status = STATUS_BAD; if (force == 0) goto closefd; From owner-svn-src-head@FreeBSD.ORG Fri Dec 14 15:03:13 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 344E4895; Fri, 14 Dec 2012 15:03:13 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 18AAE8FC08; Fri, 14 Dec 2012 15:03:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBEF3C8B082820; Fri, 14 Dec 2012 15:03:12 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBEF3C1k082819; Fri, 14 Dec 2012 15:03:12 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201212141503.qBEF3C1k082819@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Fri, 14 Dec 2012 15:03:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244216 - head/sbin/savecore X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 14 Dec 2012 15:03:13 -0000 Author: pjd Date: Fri Dec 14 15:03:12 2012 New Revision: 244216 URL: http://svnweb.freebsd.org/changeset/base/244216 Log: If we are not going to clear the dump (we are either just checking if the dump exists or we want to keep it), open device read-only. Obtained from: WHEEL Systems Modified: head/sbin/savecore/savecore.c Modified: head/sbin/savecore/savecore.c ============================================================================== --- head/sbin/savecore/savecore.c Fri Dec 14 15:01:23 2012 (r244215) +++ head/sbin/savecore/savecore.c Fri Dec 14 15:03:12 2012 (r244216) @@ -394,7 +394,7 @@ DoFile(const char *savedir, const char * if (verbose) printf("checking for kernel dump on device %s\n", device); - fd = open(device, O_RDWR); + fd = open(device, (checkfor || keep) ? O_RDONLY : O_RDWR); if (fd < 0) { syslog(LOG_ERR, "%s: %m", device); return; @@ -612,7 +612,7 @@ DoFile(const char *savedir, const char * printf("dump saved\n"); nuke: - if (clear || !keep) { + if (!keep) { if (verbose) printf("clearing dump header\n"); memcpy(kdhl.magic, KERNELDUMPMAGIC_CLEARED, sizeof kdhl.magic); From owner-svn-src-head@FreeBSD.ORG Fri Dec 14 15:04:40 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3EA89A15; Fri, 14 Dec 2012 15:04:40 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 22B688FC08; Fri, 14 Dec 2012 15:04:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBEF4eL5083104; Fri, 14 Dec 2012 15:04:40 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBEF4dop083103; Fri, 14 Dec 2012 15:04:40 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201212141504.qBEF4dop083103@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Fri, 14 Dec 2012 15:04:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244217 - head/sbin/savecore X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 14 Dec 2012 15:04:40 -0000 Author: pjd Date: Fri Dec 14 15:04:39 2012 New Revision: 244217 URL: http://svnweb.freebsd.org/changeset/base/244217 Log: The clear option (-c) is not compatible with keep (-k) and compress (-z) options. Obtained from: WHEEL Systems Modified: head/sbin/savecore/savecore.c Modified: head/sbin/savecore/savecore.c ============================================================================== --- head/sbin/savecore/savecore.c Fri Dec 14 15:03:12 2012 (r244216) +++ head/sbin/savecore/savecore.c Fri Dec 14 15:04:39 2012 (r244217) @@ -681,6 +681,8 @@ main(int argc, char **argv) } if (checkfor && (clear || force || keep)) usage(); + if (clear && (compress || keep)) + usage(); argc -= optind; argv += optind; if (argc >= 1) { From owner-svn-src-head@FreeBSD.ORG Fri Dec 14 15:12:09 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CC6FC14A; Fri, 14 Dec 2012 15:12:09 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 970398FC12; Fri, 14 Dec 2012 15:12:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBEFC94H084519; Fri, 14 Dec 2012 15:12:09 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBEFC9Ck084515; Fri, 14 Dec 2012 15:12:09 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201212141512.qBEFC9Ck084515@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Fri, 14 Dec 2012 15:12:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244218 - in head: etc/rc.d sbin/savecore X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 14 Dec 2012 15:12:09 -0000 Author: pjd Date: Fri Dec 14 15:12:08 2012 New Revision: 244218 URL: http://svnweb.freebsd.org/changeset/base/244218 Log: - When checking if a dump exists on the given device there is no need to provide dump directory. Eliminate this redundant argument. This changes the usage, but the only risk here is that a warning will be printed about directory given as device. - Update usage of -C option. - When clearing dump header from the given device there is also no need to provide dump directory, although additional arguments for -c were not documented. - Document that -v can be used with -c and that list of devices can be given. Obtained from: WHEEL Systems Modified: head/etc/rc.d/savecore head/sbin/savecore/savecore.8 head/sbin/savecore/savecore.c Modified: head/etc/rc.d/savecore ============================================================================== --- head/etc/rc.d/savecore Fri Dec 14 15:04:39 2012 (r244217) +++ head/etc/rc.d/savecore Fri Dec 14 15:12:08 2012 (r244218) @@ -62,7 +62,7 @@ savecore_start() ;; esac - if savecore -C "${dumpdir}" "${dev}" >/dev/null; then + if savecore -C "${dev}" >/dev/null; then savecore ${savecore_flags} ${dumpdir} ${dumpdev} if checkyesno crashinfo_enable; then ${crashinfo_program} -d ${dumpdir} Modified: head/sbin/savecore/savecore.8 ============================================================================== --- head/sbin/savecore/savecore.8 Fri Dec 14 15:04:39 2012 (r244217) +++ head/sbin/savecore/savecore.8 Fri Dec 14 15:12:08 2012 (r244218) @@ -28,7 +28,7 @@ .\" From: @(#)savecore.8 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd December 24, 2008 +.Dd December 14, 2012 .Dt SAVECORE 8 .Os .Sh NAME @@ -37,10 +37,12 @@ .Sh SYNOPSIS .Nm .Fl c +.Op Fl v +.Op Ar device ... .Nm .Fl C .Op Fl v -.Op Ar directory device +.Op Ar device ... .Nm .Op Fl fkvz .Op Ar directory Op Ar device ... Modified: head/sbin/savecore/savecore.c ============================================================================== --- head/sbin/savecore/savecore.c Fri Dec 14 15:04:39 2012 (r244217) +++ head/sbin/savecore/savecore.c Fri Dec 14 15:12:08 2012 (r244218) @@ -636,8 +636,8 @@ static void usage(void) { fprintf(stderr, "%s\n%s\n%s\n", - "usage: savecore -c", - " savecore -C [-v] [directory device]", + "usage: savecore -c [-v] [device ...]", + " savecore -C [-v] [device ...]", " savecore [-fkvz] [directory [device ...]]"); exit (1); } @@ -685,7 +685,7 @@ main(int argc, char **argv) usage(); argc -= optind; argv += optind; - if (argc >= 1) { + if (argc >= 1 && !checkfor && !clear) { error = chdir(argv[0]); if (error) { syslog(LOG_ERR, "chdir(%s): %m", argv[0]); From owner-svn-src-head@FreeBSD.ORG Fri Dec 14 17:09:33 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1DD1715B; Fri, 14 Dec 2012 17:09:33 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id DF33A8FC13; Fri, 14 Dec 2012 17:09:32 +0000 (UTC) Received: from pakbsde14.localnet (unknown [38.105.238.108]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 2D7BDB96E; Fri, 14 Dec 2012 12:09:32 -0500 (EST) From: John Baldwin To: Gleb Smirnoff Subject: Re: svn commit: r244112 - head/sys/kern Date: Fri, 14 Dec 2012 11:49:07 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p22; KDE/4.5.5; amd64; ; ) References: <201212110708.qBB78EWx025288@svn.freebsd.org> <50C9271C.70803@mu.org> <20121213090215.GP97487@FreeBSD.org> In-Reply-To: <20121213090215.GP97487@FreeBSD.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="koi8-r" Content-Transfer-Encoding: 7bit Message-Id: <201212141149.07671.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 14 Dec 2012 12:09:32 -0500 (EST) Cc: Adrian Chadd , Alfred Perlstein , svn-src-all@freebsd.org, Alfred Perlstein , Andriy Gapon , src-committers@freebsd.org, Navdeep Parhar , svn-src-head@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 14 Dec 2012 17:09:33 -0000 On Thursday, December 13, 2012 4:02:15 am Gleb Smirnoff wrote: > On Wed, Dec 12, 2012 at 04:53:48PM -0800, Alfred Perlstein wrote: > A> The problem again is that not all the KASSERTS are inviolable, if you > A> want to do a project to split them, then please do, it would really be > A> helpful, as for now, they are a mis-mash of death/warnings and there are > A> at least three vendors who approve of this as well as 3 long term > A> committers that approved my change (not including Adrian). > > Can you show examples of not inviolable KASSERTs? There are none. They are all assertions for a reason. However, in my experience at several large consumers of FreeBSD, no one wants to run with INVARIANTS in production. Not because we don't want panics (believe me, Yahoo! gets plenty of panics even with INVARIANTS disabled), but because the performance overhead, and redefining INVARIANTS into printf doesn't address that at all. Also, in regards to "if you think an a condition should be inviolable, make it a panic". I _did_ do that in WITNESS and you just reverted them! In all the cases of things like mismatching slock -> xlock you are about to corrupt WITNESS' internal state (leading to false positives or missed warnings) as well as the state of the locks themselves resulting in either hangs or random data corruption. Also, if you don't have a console wired up on all your machines (which not everyone does these days) a hang is _far_ worse than a crashdump, as when the machine hangs, you have to power cycle it, and you won't find the messages in /var/log/messages. With a straight-up panic if someone wants to run with INVARIANTS enabled they would instead have a nice crashdump that could be examined after the machine comes back up that points to the offending location. So in general, I will never use this and find it doesn't add any benefit whatsoever. OTOH, if it is not invasive (e.g. your original commit), then I think it might be ok if there are some folks who might actually find it useful. That said, I think direct use of kassert_panic() such as your changes to WITNESS is wrong. If you are going to change explicit panics, make them into a KASSERT() instead of changing a panic into a kassert_panic(). -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Fri Dec 14 17:09:41 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8361E280; Fri, 14 Dec 2012 17:09:41 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 51CA68FC1B; Fri, 14 Dec 2012 17:09:41 +0000 (UTC) Received: from pakbsde14.localnet (unknown [38.105.238.108]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id C6B71B9A8; Fri, 14 Dec 2012 12:09:40 -0500 (EST) From: John Baldwin To: Pawel Jakub Dawidek Subject: Re: svn commit: r244154 - head/bin/ps Date: Fri, 14 Dec 2012 11:52:15 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p22; KDE/4.5.5; amd64; ; ) References: <201212121545.qBCFj4Hl086444@svn.freebsd.org> <20121212210652.GO3013@kib.kiev.ua> <20121213111240.GB1381@garage.freebsd.pl> In-Reply-To: <20121213111240.GB1381@garage.freebsd.pl> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201212141152.15567.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 14 Dec 2012 12:09:40 -0500 (EST) Cc: Konstantin Belousov , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 14 Dec 2012 17:09:41 -0000 On Thursday, December 13, 2012 6:12:44 am Pawel Jakub Dawidek wrote: > On Wed, Dec 12, 2012 at 11:06:52PM +0200, Konstantin Belousov wrote: > > On Wed, Dec 12, 2012 at 03:45:04PM +0000, Pawel Jakub Dawidek wrote: > > > Author: pjd > > > Date: Wed Dec 12 15:45:03 2012 > > > New Revision: 244154 > > > URL: http://svnweb.freebsd.org/changeset/base/244154 > > > > > > Log: > > > Use kern.max_pid sysctl to obtain maximum PID number instead of using local > > > define. > > It is pid_max, not max_pid. > > > > But the change is wrong. The kern.pid_max only limits newly allocated pids, > > it does not magically moves existing pids, which are out of range, to the > > limited region. See the corresponding commit log for the description. > > It was added to make it easier to run FreeBSD 1.x binaries on the modern > > kernels. > > I saw CTLFLAG_TUN on the sysctl and assumed it is read-only... > How about defining BSD_PID_MAX in sys/proc.h, which would be visible by > userland as well and setting PID_MAX to BSD_PID_MAX? > > This would also help bsnmpd. > > http://people.freebsd.org/~pjd/patches/PID_MAX.patch This doesn't help your actual use case though where you want to boot a kernel with a different PID_MAX. I would much rather our tools learn such constants from the kernel via sysctl than have them compiled in. So, I would add a new sysctl which exports the true PID_MAX constant (and is read-only and never changes) and use that in ps, etc. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Fri Dec 14 17:19:33 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 61A69683; Fri, 14 Dec 2012 17:19:33 +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 1ACFC8FC12; Fri, 14 Dec 2012 17:19:31 +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 TAA29617; Fri, 14 Dec 2012 19:19:30 +0200 (EET) (envelope-from avg@FreeBSD.org) Message-ID: <50CB5FA2.6050104@FreeBSD.org> Date: Fri, 14 Dec 2012 19:19:30 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: mdf@FreeBSD.org Subject: Re: svn commit: r244112 - head/sys/kern References: <201212110708.qBB78EWx025288@svn.freebsd.org> <201212121046.43706.jhb@freebsd.org> <201212121658.49048.jhb@freebsd.org> <50C90567.8080406@FreeBSD.org> <50C909BD.9090709@mu.org> <50C97D94.1090603@FreeBSD.org> <50C97F8D.6010504@FreeBSD.org> <50C9A321.5060407@FreeBSD.org> In-Reply-To: X-Enigmail-Version: 1.4.6 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 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 14 Dec 2012 17:19:33 -0000 on 13/12/2012 19:01 mdf@FreeBSD.org said the following: > Tools, not policy. > > A non-panic-ing KASSERT is a tool, not enabled by default. You don't > need to use it. Someone does, so why can't we provide the tool? So if some code is a tool and it is disabled by default and someone believes that they will use it, then the code is acceptable to include into the tree no questions asked? -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Fri Dec 14 18:30:02 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B354CE24; Fri, 14 Dec 2012 18:30:02 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7EEB18FC19; Fri, 14 Dec 2012 18:30:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBEIU2PE025336; Fri, 14 Dec 2012 18:30:02 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBEIU2Qq025332; Fri, 14 Dec 2012 18:30:02 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201212141830.qBEIU2Qq025332@svn.freebsd.org> From: Ed Maste Date: Fri, 14 Dec 2012 18:30:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244224 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 14 Dec 2012 18:30:02 -0000 Author: emaste Date: Fri Dec 14 18:30:01 2012 New Revision: 244224 URL: http://svnweb.freebsd.org/changeset/base/244224 Log: Minor refactoring prior to .symbols file changes - Combine .if x and .if !x using .else - Separate out beforelinking dependency - Add comments to clarify .if nesting Sponsored by: ADARA Networks Modified: head/share/mk/bsd.lib.mk head/share/mk/bsd.prog.mk Modified: head/share/mk/bsd.lib.mk ============================================================================== --- head/share/mk/bsd.lib.mk Fri Dec 14 16:28:10 2012 (r244223) +++ head/share/mk/bsd.lib.mk Fri Dec 14 18:30:01 2012 (r244224) @@ -39,9 +39,7 @@ CFLAGS+= ${DEBUG_FLAGS} .if ${MK_CTF} != "no" && ${DEBUG_FLAGS:M-g} != "" CTFFLAGS+= -g .endif -.endif - -.if !defined(DEBUG_FLAGS) +.else STRIP?= -s .endif @@ -173,10 +171,9 @@ SOLINKOPTS+= -Wl,--fatal-warnings -Wl,-- .endif .if target(beforelinking) -${SHLIB_NAME}: ${SOBJS} beforelinking -.else -${SHLIB_NAME}: ${SOBJS} +${SHLIB_NAME}: beforelinking .endif +${SHLIB_NAME}: ${SOBJS} @${ECHO} building shared library ${SHLIB_NAME} @rm -f ${.TARGET} ${SHLIB_LINK} .if defined(SHLIB_LINK) Modified: head/share/mk/bsd.prog.mk ============================================================================== --- head/share/mk/bsd.prog.mk Fri Dec 14 16:28:10 2012 (r244223) +++ head/share/mk/bsd.prog.mk Fri Dec 14 18:30:01 2012 (r244224) @@ -46,10 +46,9 @@ PROG= ${PROG_CXX} OBJS+= ${SRCS:N*.h:R:S/$/.o/g} .if target(beforelinking) -${PROG}: ${OBJS} beforelinking -.else -${PROG}: ${OBJS} +${PROG}: beforelinking .endif +${PROG}: ${OBJS} .if defined(PROG_CXX) ${CXX} ${CXXFLAGS} ${LDFLAGS} -o ${.TARGET} ${OBJS} ${LDADD} .else @@ -76,10 +75,9 @@ SRCS= ${PROG}.c OBJS= ${PROG}.o .if target(beforelinking) -${PROG}: ${OBJS} beforelinking -.else -${PROG}: ${OBJS} +${PROG}: beforelinking .endif +${PROG}: ${OBJS} .if defined(PROG_CXX) ${CXX} ${CXXFLAGS} ${LDFLAGS} -o ${.TARGET} ${OBJS} ${LDADD} .else @@ -90,7 +88,7 @@ ${PROG}: ${OBJS} .endif .endif -.endif +.endif # !defined(SRCS) .if ${MK_MAN} != "no" && !defined(MAN) && \ !defined(MAN1) && !defined(MAN2) && !defined(MAN3) && \ @@ -100,7 +98,7 @@ ${PROG}: ${OBJS} MAN= ${PROG}.1 MAN1= ${MAN} .endif -.endif +.endif # defined(PROG) all: objwarn ${PROG} ${SCRIPTS} .if ${MK_MAN} != "no" From owner-svn-src-head@FreeBSD.ORG Fri Dec 14 20:24:53 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (unknown [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E1DF314EB; Fri, 14 Dec 2012 20:24:52 +0000 (UTC) (envelope-from bright@mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 9736E8FC13; Fri, 14 Dec 2012 20:24:52 +0000 (UTC) Received: from Alfreds-MacBook-Pro-6.local (c-67-180-208-218.hsd1.ca.comcast.net [67.180.208.218]) by elvis.mu.org (Postfix) with ESMTPSA id BE0401A3C1B; Fri, 14 Dec 2012 12:24:44 -0800 (PST) Message-ID: <50CB8B0C.2060908@mu.org> Date: Fri, 14 Dec 2012 12:24:44 -0800 From: Alfred Perlstein User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: John Baldwin Subject: Re: svn commit: r244112 - head/sys/kern References: <201212110708.qBB78EWx025288@svn.freebsd.org> <50C9271C.70803@mu.org> <20121213090215.GP97487@FreeBSD.org> <201212141149.07671.jhb@freebsd.org> In-Reply-To: <201212141149.07671.jhb@freebsd.org> Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit Cc: Adrian Chadd , src-committers@freebsd.org, svn-src-all@freebsd.org, Alfred Perlstein , Andriy Gapon , Gleb Smirnoff , Navdeep Parhar , svn-src-head@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 14 Dec 2012 20:24:53 -0000 On 12/14/12 8:49 AM, John Baldwin wrote: > On Thursday, December 13, 2012 4:02:15 am Gleb Smirnoff wrote: >> On Wed, Dec 12, 2012 at 04:53:48PM -0800, Alfred Perlstein wrote: >> A> The problem again is that not all the KASSERTS are inviolable, if you >> A> want to do a project to split them, then please do, it would really be >> A> helpful, as for now, they are a mis-mash of death/warnings and there are >> A> at least three vendors who approve of this as well as 3 long term >> A> committers that approved my change (not including Adrian). >> >> Can you show examples of not inviolable KASSERTs? > There are none. > They are all assertions for a reason. However, in my > experience at several large consumers of FreeBSD, no one wants to run with > INVARIANTS in production. Not because we don't want panics (believe me, > Yahoo! gets plenty of panics even with INVARIANTS disabled), but because the > performance overhead, and redefining INVARIANTS into printf doesn't address > that at all. > > Also, in regards to "if you think an a condition should be inviolable, make it > a panic". I _did_ do that in WITNESS and you just reverted them! In all the > cases of things like mismatching slock -> xlock you are about to corrupt > WITNESS' internal state (leading to false positives or missed warnings) as > well as the state of the locks themselves resulting in either hangs or random > data corruption. > > Also, if you don't have a console wired up on all your machines (which not > everyone does these days) a hang is _far_ worse than a crashdump, as when the > machine hangs, you have to power cycle it, and you won't find the messages in > /var/log/messages. With a straight-up panic if someone wants to run with > INVARIANTS enabled they would instead have a nice crashdump that could be > examined after the machine comes back up that points to the offending > location. > > So in general, I will never use this and find it doesn't add any benefit > whatsoever. OTOH, if it is not invasive (e.g. your original commit), then I > think it might be ok if there are some folks who might actually find it > useful. That said, I think direct use of kassert_panic() such as your changes > to WITNESS is wrong. If you are going to change explicit panics, make them > into a KASSERT() instead of changing a panic into a kassert_panic(). > Would that not break WITNESS without INVARIANTS. I can get a kernel to compile with a functional WITNESS without INVARIANTS, however with this proposed change, then WITNESS wouldn't do anything (not even log) without INVARIANTS. We can probably cobble up a WITNESS_ASSERT for witness if you'd like that does the right thing based on ifdef INVARIANTS. Let me know what you think of that. I've also given you my personal phone number so we can hash this out over the phone, but you have not called nor responded to that email. Don't call now, I'm taking a few hours off to rest, but please let's set up a time to discuss this contentious issue. -Alfred From owner-svn-src-head@FreeBSD.ORG Fri Dec 14 21:41:09 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6E238F57; Fri, 14 Dec 2012 21:41:09 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (garage.dawidek.net [91.121.88.72]) by mx1.freebsd.org (Postfix) with ESMTP id 2806C8FC0C; Fri, 14 Dec 2012 21:41:09 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id 051BA8AE; Fri, 14 Dec 2012 22:39:04 +0100 (CET) Date: Fri, 14 Dec 2012 22:42:47 +0100 From: Pawel Jakub Dawidek To: John Baldwin Subject: Re: svn commit: r244154 - head/bin/ps Message-ID: <20121214214246.GB1411@garage.freebsd.pl> References: <201212121545.qBCFj4Hl086444@svn.freebsd.org> <20121212210652.GO3013@kib.kiev.ua> <20121213111240.GB1381@garage.freebsd.pl> <201212141152.15567.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ZfOjI3PrQbgiZnxM" Content-Disposition: inline In-Reply-To: <201212141152.15567.jhb@freebsd.org> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Konstantin Belousov , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 14 Dec 2012 21:41:09 -0000 --ZfOjI3PrQbgiZnxM Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Dec 14, 2012 at 11:52:15AM -0500, John Baldwin wrote: > On Thursday, December 13, 2012 6:12:44 am Pawel Jakub Dawidek wrote: > > On Wed, Dec 12, 2012 at 11:06:52PM +0200, Konstantin Belousov wrote: > > > On Wed, Dec 12, 2012 at 03:45:04PM +0000, Pawel Jakub Dawidek wrote: > > > > Author: pjd > > > > Date: Wed Dec 12 15:45:03 2012 > > > > New Revision: 244154 > > > > URL: http://svnweb.freebsd.org/changeset/base/244154 > > > >=20 > > > > Log: > > > > Use kern.max_pid sysctl to obtain maximum PID number instead of u= sing local > > > > define. > > > It is pid_max, not max_pid. > > >=20 > > > But the change is wrong. The kern.pid_max only limits newly allocated= pids, > > > it does not magically moves existing pids, which are out of range, to= the > > > limited region. See the corresponding commit log for the description. > > > It was added to make it easier to run FreeBSD 1.x binaries on the mod= ern > > > kernels. > >=20 > > I saw CTLFLAG_TUN on the sysctl and assumed it is read-only... > > How about defining BSD_PID_MAX in sys/proc.h, which would be visible by > > userland as well and setting PID_MAX to BSD_PID_MAX? > >=20 > > This would also help bsnmpd. > >=20 > > http://people.freebsd.org/~pjd/patches/PID_MAX.patch >=20 > This doesn't help your actual use case though where you want to boot a ke= rnel > with a different PID_MAX. I would much rather our tools learn such const= ants > from the kernel via sysctl than have them compiled in. So, I would add a= new > sysctl which exports the true PID_MAX constant (and is read-only and never > changes) and use that in ps, etc. In that case I'd prefer to make existing kern.pid_max sysctl read-only and make it loader tunable. I don't expect there are many users of this sysctl... --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --ZfOjI3PrQbgiZnxM Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlDLnVYACgkQForvXbEpPzSTAwCg96tGrW/MyHpz59C7IQNwGwWj FYcAoOkeZJH+iA/7ol/2zM1xxn5bU7hU =tITq -----END PGP SIGNATURE----- --ZfOjI3PrQbgiZnxM-- From owner-svn-src-head@FreeBSD.ORG Fri Dec 14 21:49:07 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 438321387; Fri, 14 Dec 2012 21:49:07 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 28EC68FC0C; Fri, 14 Dec 2012 21:49:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBELn7Ka054301; Fri, 14 Dec 2012 21:49:07 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBELn7YY054300; Fri, 14 Dec 2012 21:49:07 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201212142149.qBELn7YY054300@svn.freebsd.org> From: Rick Macklem Date: Fri, 14 Dec 2012 21:49:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244226 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 14 Dec 2012 21:49:07 -0000 Author: rmacklem Date: Fri Dec 14 21:49:06 2012 New Revision: 244226 URL: http://svnweb.freebsd.org/changeset/base/244226 Log: The group list for a non-default export entry (a host/subnet one) was being copied from the wrong place. This patch fixes that. This could cause access failures for mapped users, when the group permissions were needed. PR: 147998 Submitted by: Christopher Key (cjk32 at cam.ac.uk) MFC after: 2 weeks Modified: head/sys/kern/vfs_export.c Modified: head/sys/kern/vfs_export.c ============================================================================== --- head/sys/kern/vfs_export.c Fri Dec 14 21:22:23 2012 (r244225) +++ head/sys/kern/vfs_export.c Fri Dec 14 21:49:06 2012 (r244226) @@ -208,7 +208,7 @@ vfs_hang_addrlist(struct mount *mp, stru np->netc_anon = crget(); np->netc_anon->cr_uid = argp->ex_anon.cr_uid; crsetgroups(np->netc_anon, argp->ex_anon.cr_ngroups, - np->netc_anon->cr_groups); + argp->ex_anon.cr_groups); np->netc_anon->cr_prison = &prison0; prison_hold(np->netc_anon->cr_prison); np->netc_numsecflavors = argp->ex_numsecflavors; From owner-svn-src-head@FreeBSD.ORG Fri Dec 14 22:04:10 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F03901CD9; Fri, 14 Dec 2012 22:04:09 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (garage.dawidek.net [91.121.88.72]) by mx1.freebsd.org (Postfix) with ESMTP id AB95B8FC0A; Fri, 14 Dec 2012 22:04:09 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id 4B2558BF; Fri, 14 Dec 2012 23:02:05 +0100 (CET) Date: Fri, 14 Dec 2012 23:05:47 +0100 From: Pawel Jakub Dawidek To: Steven Hartland Subject: Re: svn commit: r244188 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs Message-ID: <20121214220547.GC1411@garage.freebsd.pl> References: <201212131739.qBDHd8RR083616@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="R+My9LyyhiUvIEro" Content-Disposition: inline In-Reply-To: <201212131739.qBDHd8RR083616@svn.freebsd.org> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 14 Dec 2012 22:04:10 -0000 --R+My9LyyhiUvIEro Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Dec 13, 2012 at 05:39:08PM +0000, Steven Hartland wrote: > Author: smh > Date: Thu Dec 13 17:39:07 2012 > New Revision: 244188 > URL: http://svnweb.freebsd.org/changeset/base/244188 >=20 > Log: > Added vfs.zfs.vdev.trim_on_init sysctl which allows full vdev trim on > initialisation to be enabled (1) / disabled (0) defaults to enabled. > =20 > This is useful for devices which have a slow trim speed and are either > new or have otherwise already been wiped e.g. secure erase. > =20 > PR: kern/173116 > Submitted by: Steven Hartland > Approved by: pjd (mentor) >=20 > Modified: > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c >=20 > Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.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/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c Thu = Dec 13 17:06:38 2012 (r244187) > +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c Thu = Dec 13 17:39:07 2012 (r244188) > @@ -148,6 +148,11 @@ > #include > #include > =20 > +static boolean_t vdev_trim_on_init =3D B_TRUE; > +SYSCTL_DECL(_vfs_zfs_vdev); > +SYSCTL_INT(_vfs_zfs_vdev, OID_AUTO, trim_on_init, CTLFLAG_RW, > + &vdev_trim_on_init, 0, "Enable/disable full vdev trim on initialisat= ion"); I'd also make it loader tunable. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --R+My9LyyhiUvIEro Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlDLorsACgkQForvXbEpPzSHdwCgvaY38hjAT2deQrwWQ3zpJr8P 9o8AoOBnBpVSuh7muBuwGO0TOvaD4exI =aoAV -----END PGP SIGNATURE----- --R+My9LyyhiUvIEro-- From owner-svn-src-head@FreeBSD.ORG Fri Dec 14 22:50:05 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 268AD995; Fri, 14 Dec 2012 22:50:05 +0000 (UTC) (envelope-from carl.r.delsey@intel.com) Received: from mga03.intel.com (mga03.intel.com [143.182.124.21]) by mx1.freebsd.org (Postfix) with ESMTP id BE3058FC14; Fri, 14 Dec 2012 22:50:04 +0000 (UTC) Received: from azsmga002.ch.intel.com ([10.2.17.35]) by azsmga101.ch.intel.com with ESMTP; 14 Dec 2012 14:49:50 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.84,284,1355126400"; d="scan'208";a="181102956" Received: from crdelsey-fbsd.ch.intel.com (HELO [10.2.105.127]) ([10.2.105.127]) by AZSMGA002.ch.intel.com with ESMTP; 14 Dec 2012 14:49:50 -0800 Message-ID: <50CBAD0E.5050907@intel.com> Date: Fri, 14 Dec 2012 15:49:50 -0700 From: Carl Delsey User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:13.0) Gecko/20120724 Thunderbird/13.0.1 MIME-Version: 1.0 To: Bruce Evans Subject: Re: svn commit: r244193 - head/sys/x86/include References: <201212132140.qBDLeBhd019751@svn.freebsd.org> <20121214154930.D973@besplex.bde.org> In-Reply-To: <20121214154930.D973@besplex.bde.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, Jim Harris , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 14 Dec 2012 22:50:05 -0000 On 12/13/12 21:49, Bruce Evans wrote: > On Thu, 13 Dec 2012, Jim Harris wrote: > >> Log: >> Add bus_space_read_8 and bus_space_write_8 for amd64. >> >> Rather than trying to KASSERT for callers that invoke this on >> IO tags, either do nothing (for write_8) or return ~0 (for read_8). > > read_8 returns a uint64_t, so it cannot return the signed integer ~0. > It actually returns this signed integer converted to uint64_t. On > amd64, this is the 32 bit value 0xffffffff. The 64-bit value > 0xffffffffffffffff should be returned. I double checked and 0xffffffffffffffff is being returned when compiled by both clang and gcc. > >> Using KASSERT here just makes bus.h too messy from both >> polluting bus.h with systm.h (for any number of drivers that include >> bus.h without first including systm.h) or ports that use bus.h >> directly (i.e. libpciaccess) as reported by zeising@. >> >> Also don't try to implement all of the other bus_space functions for >> 8 byte access since realistically only these two are needed for some >> devices that expose 64-bit memory-mapped registers. > > Good. > >> Put the amd64-specific functions here rather than >> sys/amd64/include/bus.h >> so that we can keep this header unified for x86, as requested by mdf@ >> and tijl@. > > Not so good. I don't really like any of the unified headers. Me neither, but it sounds like there is a good reason for it, which I'll admit I don't fully understand. Sounds like it has something to do with cross-compiling. > >> Modified: head/sys/x86/include/bus.h >> ============================================================================== >> >> --- head/sys/x86/include/bus.h Thu Dec 13 21:39:59 2012 (r244192) >> +++ head/sys/x86/include/bus.h Thu Dec 13 21:40:11 2012 (r244193) >> @@ -130,6 +130,7 @@ >> #define BUS_SPACE_MAXADDR 0xFFFFFFFF >> #endif > > This file spells the F in hex constants in upper case. > > In the above definition and in previous ones, it is careful to spell out > the constants and not depend on sign extension. So it is also a style > bug to use ~0. Are you saying it is a style bug to not match the style used above, regardless of whether that style is right or wrong, or are you saying (~0) is always a style bug? > > Style bug visible in the above: space instead of tab after #define. This > style bugs is in all #define's near here, including the new one. > > Type error in #define's just before the above: the above > BUS_SPACE_MAXADDR > is for 32 bits. For amd64 and i386-PAE, BUS_SPACE_MAXADDR is of course > 64 bits, but the ifdef tangle for it is not tangled enough to be correct: > BUS_SPACE_MAXADDR is 0xFFFFFFFFFFFFFFFFULL, on both, but bus_addr_t is > only > unsigned long long on i386-PAE. I think this should be a separate patch though, since it is unrelated to this change. > >> >> +#define BUS_SPACE_INVALID_DATA (~0) >> #define BUS_SPACE_UNRESTRICTED (~0) >> >> /* >> @@ -221,6 +222,12 @@ static __inline u_int32_t bus_space_read >> bus_space_handle_t handle, >> bus_size_t offset); >> >> +#ifdef __amd64__ >> +static __inline uint64_t bus_space_read_8(bus_space_tag_t tag, >> + bus_space_handle_t handle, >> + bus_size_t offset); >> +#endif >> + > > This is style-bug for bug compatible with the existing forward > declarations. Forward declarations of inline functions are nonsense. > They are from NetBSD, for K&R support. But FreeBSD never supported > K&R in bus-space headers, and the forward declarations never even > compiled with K&R, since they never used __P(()). Almost 1/3 of the > x86 bus.h consists of these negatively useful forward declarations. > Some of them are almost as large as the full functions, since they are > misformatted worse, with parameters starting at about column 40 instead > of about column 20, so so that many lines are needed just for the > parameters (to line them up in perfectly non-KNF gnu style). Same with this - separate patch > >> ... >> @@ -251,8 +258,16 @@ bus_space_read_4(bus_space_tag_t tag, bu >> return (*(volatile u_int32_t *)(handle + offset)); >> } >> >> -#if 0 /* Cause a link error for bus_space_read_8 */ >> -#define bus_space_read_8(t, h, o) !!! bus_space_read_8 >> unimplemented !!! >> +#ifdef __amd64__ >> +static __inline uint64_t >> +bus_space_read_8(bus_space_tag_t tag, bus_space_handle_t handle, >> + bus_size_t offset) >> +{ >> + >> + if (tag == X86_BUS_SPACE_IO) /* No 8 byte IO space access on x86 */ > > The comment is not indented, and should probably not be placed to the > right of the code. This file mostly doesn't place comments there, and > when it does it doesn't capitalize them. One that does also spells IO > as i/o. All the #if 0 lines also start with an end of line comment, and they are all capitalized. By "not indented" are you saying that all end of line comments must be preceded by a tab? > >> + return (BUS_SPACE_INVALID_DATA); >> + return (*(volatile uint64_t *)(handle + offset)); >> +} >> #endif > > Bruce > _______________________________________________ > svn-src-head@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" From owner-svn-src-head@FreeBSD.ORG Sat Dec 15 00:03:36 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 31FD0BF2; Sat, 15 Dec 2012 00:03:36 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F1B098FC12; Sat, 15 Dec 2012 00:03:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBF03ZfH085868; Sat, 15 Dec 2012 00:03:35 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBF03Zr0085865; Sat, 15 Dec 2012 00:03:35 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201212150003.qBF03Zr0085865@svn.freebsd.org> From: Ed Maste Date: Sat, 15 Dec 2012 00:03:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244236 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 15 Dec 2012 00:03:36 -0000 Author: emaste Date: Sat Dec 15 00:03:35 2012 New Revision: 244236 URL: http://svnweb.freebsd.org/changeset/base/244236 Log: Put shared library debug info into separate .symbols file Sponsored by: ADARA Networks Modified: head/share/mk/bsd.lib.mk head/share/mk/sys.mk Modified: head/share/mk/bsd.lib.mk ============================================================================== --- head/share/mk/bsd.lib.mk Fri Dec 14 23:13:06 2012 (r244235) +++ head/share/mk/bsd.lib.mk Sat Dec 15 00:03:35 2012 (r244236) @@ -173,11 +173,15 @@ SOLINKOPTS+= -Wl,--fatal-warnings -Wl,-- .if target(beforelinking) ${SHLIB_NAME}: beforelinking .endif +.if defined(DEBUG_FLAGS) +${SHLIB_NAME}.debug: ${SOBJS} +.else ${SHLIB_NAME}: ${SOBJS} +.endif @${ECHO} building shared library ${SHLIB_NAME} - @rm -f ${.TARGET} ${SHLIB_LINK} + @rm -f ${SHLIB_NAME} ${SHLIB_LINK} .if defined(SHLIB_LINK) - @ln -fs ${.TARGET} ${SHLIB_LINK} + @ln -fs ${SHLIB_NAME} ${SHLIB_LINK} .endif .if !defined(NM) @${CC} ${LDFLAGS} ${SSP_CFLAGS} ${SOLINKOPTS} \ @@ -191,6 +195,15 @@ ${SHLIB_NAME}: ${SOBJS} .if ${MK_CTF} != "no" ${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${SOBJS} .endif + +.if defined(DEBUG_FLAGS) +${SHLIB_NAME}: ${SHLIB_NAME}.debug ${SHLIB_NAME}.symbols + ${OBJCOPY} --strip-debug --add-gnu-debuglink=${SHLIB_NAME}.symbols \ + ${SHLIB_NAME}.debug ${.TARGET} + +${SHLIB_NAME}.symbols: ${SHLIB_NAME}.debug + ${OBJCOPY} --only-keep-debug ${SHLIB_NAME}.debug ${.TARGET} +.endif .endif .if defined(INSTALL_PIC_ARCHIVE) && defined(LIB) && !empty(LIB) && ${MK_TOOLCHAIN} != "no" @@ -267,6 +280,11 @@ _libinstall: ${INSTALL} ${STRIP} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ ${_INSTALLFLAGS} ${_SHLINSTALLFLAGS} \ ${SHLIB_NAME} ${DESTDIR}${SHLIBDIR} +.if defined(DEBUG_FLAGS) + ${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ + ${_INSTALLFLAGS} ${_SHLINSTALLFLAGS} \ + ${SHLIB_NAME}.symbols ${DESTDIR}${SHLIBDIR} +.endif .if defined(SHLIB_LINK) # ${_SHLIBDIRPREFIX} and ${_LDSCRIPTROOT} are both needed when cross-building # and when building 32 bits library shims. ${_SHLIBDIRPREFIX} is the directory Modified: head/share/mk/sys.mk ============================================================================== --- head/share/mk/sys.mk Fri Dec 14 23:13:06 2012 (r244235) +++ head/share/mk/sys.mk Sat Dec 15 00:03:35 2012 (r244236) @@ -134,6 +134,8 @@ NM ?= nm OBJC ?= cc OBJCFLAGS ?= ${OBJCINCLUDES} ${CFLAGS} -Wno-import +OBJCOPY ?= objcopy + PC ?= pc PFLAGS ?= From owner-svn-src-head@FreeBSD.ORG Sat Dec 15 00:13:18 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E84C5F34; Sat, 15 Dec 2012 00:13:18 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-oa0-f54.google.com (mail-oa0-f54.google.com [209.85.219.54]) by mx1.freebsd.org (Postfix) with ESMTP id 7C08F8FC19; Sat, 15 Dec 2012 00:13:18 +0000 (UTC) Received: by mail-oa0-f54.google.com with SMTP id n9so4199582oag.13 for ; Fri, 14 Dec 2012 16:13:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=DyRItChpziaIfYYTDnX0QOZIZ6mO0hTJx7q/OaAF6y4=; b=GDYRdT2DAjlbmYMdgZ9SlKas7VFLC7mXfMRXuLIZrXFF77JEm0rsHauRuGXql7mrz8 WCUyc6bJDw/wdQQaJBIK6/j5QdmbAFpZfHcWawHwaf/7PvTLTmhrbUmN6LV3FQhFTFoS PNjG+OGtAXEUgPjcYV8pSFfyiTvkxhSDu3WrIR37N2BJ+oPiRDx7b0uh2xcxdacBL8tX p2tTf5VjqMF2NZg278lV3qwph8JtmB32lSXG68ocu08DOO7rmrEAXsEtlhiWgcDnXcIm 8hte6kdvU7kXXHxyJjA7ohf/WT998xSQhnvdNpc0A+hkqkWMPTdIC/uTACo9f/C5IhVX PKOQ== MIME-Version: 1.0 Received: by 10.182.2.169 with SMTP id 9mr6152277obv.66.1355530397622; Fri, 14 Dec 2012 16:13:17 -0800 (PST) Received: by 10.76.143.33 with HTTP; Fri, 14 Dec 2012 16:13:17 -0800 (PST) In-Reply-To: <201212150003.qBF03Zr0085865@svn.freebsd.org> References: <201212150003.qBF03Zr0085865@svn.freebsd.org> Date: Fri, 14 Dec 2012 16:13:17 -0800 Message-ID: Subject: Re: svn commit: r244236 - head/share/mk From: Garrett Cooper To: Ed Maste Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 15 Dec 2012 00:13:19 -0000 On Fri, Dec 14, 2012 at 4:03 PM, Ed Maste wrote: > Author: emaste > Date: Sat Dec 15 00:03:35 2012 > New Revision: 244236 > URL: http://svnweb.freebsd.org/changeset/base/244236 ... > Modified: head/share/mk/sys.mk > ============================================================================== > --- head/share/mk/sys.mk Fri Dec 14 23:13:06 2012 (r244235) > +++ head/share/mk/sys.mk Sat Dec 15 00:03:35 2012 (r244236) > @@ -134,6 +134,8 @@ NM ?= nm > OBJC ?= cc > OBJCFLAGS ?= ${OBJCINCLUDES} ${CFLAGS} -Wno-import > > +OBJCOPY ?= objcopy > + > PC ?= pc > PFLAGS ?= This shouldn't be defined when !defined(%POSIX) is true. The .endif should be pulled down to just above SHELL?= according to what I'm reading in http://pubs.opengroup.org/onlinepubs/009695399/utilities/make.html . Other spots in the tree where OBJCOPY?= is noted can be probably start to be reaped (thinking about sys/boot/, etc in particular). I have a PR open for some work Warner started with an initial patch that I've kind of been keeping up to date in git, but it needs to be updated now per this change (and also because I didn't notice that these variables weren't supposed to be defined when POSIX mode was on). Thanks! -Garrett From owner-svn-src-head@FreeBSD.ORG Sat Dec 15 00:14:38 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E041413A; Sat, 15 Dec 2012 00:14:38 +0000 (UTC) (envelope-from smh@freebsd.org) Received: from mail1.multiplay.co.uk (mail1.multiplay.co.uk [85.236.96.23]) by mx1.freebsd.org (Postfix) with ESMTP id D0DC28FC0A; Sat, 15 Dec 2012 00:14:37 +0000 (UTC) X-Spam-Processed: mail1.multiplay.co.uk, Sat, 15 Dec 2012 00:14:35 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on mail1.multiplay.co.uk X-Spam-Level: X-Spam-Status: No, score=-5.0 required=6.0 tests=USER_IN_WHITELIST shortcircuit=ham autolearn=disabled version=3.2.5 Received: from r2d2 ([188.220.16.49]) by mail1.multiplay.co.uk (mail1.multiplay.co.uk [85.236.96.23]) (MDaemon PRO v10.0.4) with ESMTP id md50001358603.msg; Sat, 15 Dec 2012 00:14:35 +0000 X-MDRemoteIP: 188.220.16.49 X-Return-Path: smh@freebsd.org X-Envelope-From: smh@freebsd.org Message-ID: <2684CC03E9F64F72B9F723411F32DF68@multiplay.co.uk> From: "Steven Hartland" To: "Pawel Jakub Dawidek" References: <201212131739.qBDHd8RR083616@svn.freebsd.org> <20121214220547.GC1411@garage.freebsd.pl> Subject: Re: svn commit: r244188 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs Date: Sat, 15 Dec 2012 00:14:28 -0000 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 15 Dec 2012 00:14:39 -0000 ----- Original Message ----- From: "Pawel Jakub Dawidek" On Thu, Dec 13, 2012 at 05:39:08PM +0000, Steven Hartland wrote: >> Author: smh >> Date: Thu Dec 13 17:39:07 2012 >> New Revision: 244188 >> URL: http://svnweb.freebsd.org/changeset/base/244188 >> >> Log: >> Added vfs.zfs.vdev.trim_on_init sysctl which allows full vdev trim on >> initialisation to be enabled (1) / disabled (0) defaults to enabled. >> >> This is useful for devices which have a slow trim speed and are either >> new or have otherwise already been wiped e.g. secure erase. >> ... >> +static boolean_t vdev_trim_on_init = B_TRUE; >> +SYSCTL_DECL(_vfs_zfs_vdev);> >> +SYSCTL_INT(_vfs_zfs_vdev, OID_AUTO, trim_on_init, CTLFLAG_RW, >> + &vdev_trim_on_init, 0, "Enable/disable full vdev trim on initialisation"); > > I'd also make it loader tunable. Will look into that, worth doing the other SYSCTL only ones at the same time? Regards Steve From owner-svn-src-head@FreeBSD.ORG Sat Dec 15 01:13:05 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 54DA4BDE; Sat, 15 Dec 2012 01:13:05 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id C33608FC12; Sat, 15 Dec 2012 01:13:04 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.5/8.14.5) with ESMTP id qBF1D04C074042; Sat, 15 Dec 2012 03:13:00 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.7.3 kib.kiev.ua qBF1D04C074042 Received: (from kostik@localhost) by tom.home (8.14.5/8.14.5/Submit) id qBF1D0pJ074041; Sat, 15 Dec 2012 03:13:00 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 15 Dec 2012 03:13:00 +0200 From: Konstantin Belousov To: Pawel Jakub Dawidek Subject: Re: svn commit: r244154 - head/bin/ps Message-ID: <20121215011300.GN71906@kib.kiev.ua> References: <201212121545.qBCFj4Hl086444@svn.freebsd.org> <20121212210652.GO3013@kib.kiev.ua> <20121213111240.GB1381@garage.freebsd.pl> <201212141152.15567.jhb@freebsd.org> <20121214214246.GB1411@garage.freebsd.pl> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="gWRamliw218YCZO9" Content-Disposition: inline In-Reply-To: <20121214214246.GB1411@garage.freebsd.pl> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, John Baldwin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 15 Dec 2012 01:13:05 -0000 --gWRamliw218YCZO9 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Dec 14, 2012 at 10:42:47PM +0100, Pawel Jakub Dawidek wrote: > On Fri, Dec 14, 2012 at 11:52:15AM -0500, John Baldwin wrote: > > On Thursday, December 13, 2012 6:12:44 am Pawel Jakub Dawidek wrote: > > > On Wed, Dec 12, 2012 at 11:06:52PM +0200, Konstantin Belousov wrote: > > > > On Wed, Dec 12, 2012 at 03:45:04PM +0000, Pawel Jakub Dawidek wrote: > > > > > Author: pjd > > > > > Date: Wed Dec 12 15:45:03 2012 > > > > > New Revision: 244154 > > > > > URL: http://svnweb.freebsd.org/changeset/base/244154 > > > > >=20 > > > > > Log: > > > > > Use kern.max_pid sysctl to obtain maximum PID number instead of= using local > > > > > define. > > > > It is pid_max, not max_pid. > > > >=20 > > > > But the change is wrong. The kern.pid_max only limits newly allocat= ed pids, > > > > it does not magically moves existing pids, which are out of range, = to the > > > > limited region. See the corresponding commit log for the descriptio= n. > > > > It was added to make it easier to run FreeBSD 1.x binaries on the m= odern > > > > kernels. > > >=20 > > > I saw CTLFLAG_TUN on the sysctl and assumed it is read-only... > > > How about defining BSD_PID_MAX in sys/proc.h, which would be visible = by > > > userland as well and setting PID_MAX to BSD_PID_MAX? > > >=20 > > > This would also help bsnmpd. > > >=20 > > > http://people.freebsd.org/~pjd/patches/PID_MAX.patch > >=20 > > This doesn't help your actual use case though where you want to boot a = kernel > > with a different PID_MAX. I would much rather our tools learn such con= stants > > from the kernel via sysctl than have them compiled in. So, I would add= a new > > sysctl which exports the true PID_MAX constant (and is read-only and ne= ver > > changes) and use that in ps, etc. >=20 > In that case I'd prefer to make existing kern.pid_max sysctl read-only > and make it loader tunable. I don't expect there are many users of this > sysctl... >=20 No, I described you the purpose of the sysctl. Requiring reboot just for running the old binaries is not useful. Please do not break it. --gWRamliw218YCZO9 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQIcBAEBAgAGBQJQy86bAAoJEJDCuSvBvK1B1UYQAJGxn1OlblMAxtkeUdIBTPNi WHqYuZpFYF/niLn0JJb1Xxw6CGb6mO+ECsI32QT7fZ7vzL9jMIlZk4n+cbnJLvLY +EeTThtHwRWAKIZodRV31GmDS0j8+HNqHhKrsVmskr+MRyOSu1zWSsim++gRjx3c ZlYc85D1yyfjQKTxDM/TepEBUUDPkTxZZTs75vsA6lWQnL572uTg5nIHJeyVekpj hkzZSGYa2fYmk7V+XYyRVxWGdDu9mkpJk77I07GScL0G4caSI5DsobB6i4VaWq3o 6LWMf+JzpUpqHVhz+63K5P19Fj9sqOHVVwr5Px8jPge7L8XE7oG6U6QXNr+W4Aip zOB5CaAMfTgL9LByeXuQJ3Is0GAJaiXH8PukGMrMvi9pP/EwZTPkM8ItlBunvOvH u9d7xclHuYTqtT1MJ16AJporwy9QbwCKiszHU1aOTAIJH7Yaou9GzRLLz8Q6aET/ vdytZ4IE7JuMOTKUVZnQIAgnwQglL0pOEl9IB2ATpp2knQVxeuyzd8uBPAD5pW6h pZ5UGtcJpGM809aFrpe54LWb36O+injXtk14n5GzZUiQeVT7miL4fdy1bWmfhXNA XiZ7YgGJ9X0aTZcfidupgJLH1WiOvsJT9QrJzHJMAANKBEwpNngxqg7N9o5O5QXh uAMHUBrk43hNH3Y0CUM/ =8Y1r -----END PGP SIGNATURE----- --gWRamliw218YCZO9-- From owner-svn-src-head@FreeBSD.ORG Sat Dec 15 02:02:12 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1658852C; Sat, 15 Dec 2012 02:02:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F05E08FC0C; Sat, 15 Dec 2012 02:02:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBF22Bvw013555; Sat, 15 Dec 2012 02:02:11 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBF22BZt013554; Sat, 15 Dec 2012 02:02:11 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201212150202.qBF22BZt013554@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 15 Dec 2012 02:02:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244237 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 15 Dec 2012 02:02:12 -0000 Author: kib Date: Sat Dec 15 02:02:11 2012 New Revision: 244237 URL: http://svnweb.freebsd.org/changeset/base/244237 Log: Remove a special case for XEN, which is erronous and makes vfork(2) behaviour to differ from the documented, only on XEN. If there are any issues with XEN pmap left, they should be fixed in pmap. MFC after: 2 weeks Modified: head/sys/kern/kern_fork.c Modified: head/sys/kern/kern_fork.c ============================================================================== --- head/sys/kern/kern_fork.c Sat Dec 15 00:03:35 2012 (r244236) +++ head/sys/kern/kern_fork.c Sat Dec 15 02:02:11 2012 (r244237) @@ -150,11 +150,7 @@ sys_vfork(struct thread *td, struct vfor int error, flags; struct proc *p2; -#ifdef XEN - flags = RFFDG | RFPROC; /* validate that this is still an issue */ -#else flags = RFFDG | RFPROC | RFPPWAIT | RFMEM; -#endif error = fork1(td, flags, 0, &p2, NULL, 0); if (error == 0) { td->td_retval[0] = p2->p_pid; From owner-svn-src-head@FreeBSD.ORG Sat Dec 15 02:03:07 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 97D916A6; Sat, 15 Dec 2012 02:03:07 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7CAB98FC12; Sat, 15 Dec 2012 02:03:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBF237wi013827; Sat, 15 Dec 2012 02:03:07 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBF237KO013825; Sat, 15 Dec 2012 02:03:07 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201212150203.qBF237KO013825@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 15 Dec 2012 02:03:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244238 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 15 Dec 2012 02:03:07 -0000 Author: kib Date: Sat Dec 15 02:03:06 2012 New Revision: 244238 URL: http://svnweb.freebsd.org/changeset/base/244238 Log: Line up the continuation backslashes. Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/sys/sys/mount.h Modified: head/sys/sys/mount.h ============================================================================== --- head/sys/sys/mount.h Sat Dec 15 02:02:11 2012 (r244237) +++ head/sys/sys/mount.h Sat Dec 15 02:03:06 2012 (r244238) @@ -199,8 +199,8 @@ struct vnode *__mnt_vnode_next_all(struc struct vnode *__mnt_vnode_first_all(struct vnode **mvp, struct mount *mp); void __mnt_vnode_markerfree_all(struct vnode **mvp, struct mount *mp); -#define MNT_VNODE_FOREACH_ALL(vp, mp, mvp) \ - for (vp = __mnt_vnode_first_all(&(mvp), (mp)); \ +#define MNT_VNODE_FOREACH_ALL(vp, mp, mvp) \ + for (vp = __mnt_vnode_first_all(&(mvp), (mp)); \ (vp) != NULL; vp = __mnt_vnode_next_all(&(mvp), (mp))) #define MNT_VNODE_FOREACH_ALL_ABORT(mp, mvp) \ From owner-svn-src-head@FreeBSD.ORG Sat Dec 15 02:04:00 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 33294827; Sat, 15 Dec 2012 02:04:00 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 17F9A8FC16; Sat, 15 Dec 2012 02:04:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBF23xcf014078; Sat, 15 Dec 2012 02:03:59 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBF23xOh014077; Sat, 15 Dec 2012 02:03:59 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201212150203.qBF23xOh014077@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 15 Dec 2012 02:03:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244239 - head/sys/ufs/ufs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 15 Dec 2012 02:04:00 -0000 Author: kib Date: Sat Dec 15 02:03:59 2012 New Revision: 244239 URL: http://svnweb.freebsd.org/changeset/base/244239 Log: Fix a typo, resulting in the NULL pointer dereference. Reported and tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/sys/ufs/ufs/ufs_quota.c Modified: head/sys/ufs/ufs/ufs_quota.c ============================================================================== --- head/sys/ufs/ufs/ufs_quota.c Sat Dec 15 02:03:06 2012 (r244238) +++ head/sys/ufs/ufs/ufs_quota.c Sat Dec 15 02:03:59 2012 (r244239) @@ -1044,7 +1044,7 @@ again: error = vget(vp, LK_EXCLUSIVE | LK_INTERLOCK, td); if (error) { if (error == ENOENT) { - MNT_VNODE_FOREACH_ALL_ABORT(mp, mvp); + MNT_VNODE_FOREACH_ACTIVE_ABORT(mp, mvp); goto again; } continue; From owner-svn-src-head@FreeBSD.ORG Sat Dec 15 02:04:47 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9BC0C98E; Sat, 15 Dec 2012 02:04:47 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7FF328FC0A; Sat, 15 Dec 2012 02:04:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBF24luu014328; Sat, 15 Dec 2012 02:04:47 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBF24lZd014326; Sat, 15 Dec 2012 02:04:47 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201212150204.qBF24lZd014326@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 15 Dec 2012 02:04:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244240 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 15 Dec 2012 02:04:47 -0000 Author: kib Date: Sat Dec 15 02:04:46 2012 New Revision: 244240 URL: http://svnweb.freebsd.org/changeset/base/244240 Log: When mnt_vnode_next_active iterator cannot lock the next vnode and yields, specify the user priority for the yield. Otherwise, a higher-priority (kernel) thread could fall into the priority-inversion with the thread owning the mutex lock. On single-processor machines or UP kernels, do not loop adaptively when the next vnode cannot be locked, instead yield unconditionally. Restructure the iteration initializer and the iterator to remove code duplication. Put the code to fetch and lock a vnode next to the current marker, into the mnt_vnode_next_active() function, and use it instead of repeating the loop. Reported by: hrs, rmacklem Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/sys/kern/vfs_subr.c head/sys/sys/mount.h Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Sat Dec 15 02:03:59 2012 (r244239) +++ head/sys/kern/vfs_subr.c Sat Dec 15 02:04:46 2012 (r244240) @@ -69,6 +69,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -4710,32 +4711,54 @@ __mnt_vnode_markerfree_all(struct vnode * These are helper functions for filesystems to traverse their * active vnodes. See MNT_VNODE_FOREACH_ACTIVE() in sys/mount.h */ -struct vnode * -__mnt_vnode_next_active(struct vnode **mvp, struct mount *mp) +static void +mnt_vnode_markerfree_active(struct vnode **mvp, struct mount *mp) +{ + + KASSERT((*mvp)->v_mount == mp, ("marker vnode mount list mismatch")); + + MNT_ILOCK(mp); + MNT_REL(mp); + MNT_IUNLOCK(mp); + free(*mvp, M_VNODE_MARKER); + *mvp = NULL; +} + +#ifdef SMP +#define ALWAYS_YIELD (mp_ncpus == 1) +#else +#define ALWAYS_YIELD 1 +#endif + +static struct vnode * +mnt_vnode_next_active(struct vnode **mvp, struct mount *mp) { struct vnode *vp, *nvp; - if (should_yield()) - kern_yield(PRI_UNCHANGED); - mtx_lock(&vnode_free_list_mtx); -restart: + mtx_assert(&vnode_free_list_mtx, MA_OWNED); KASSERT((*mvp)->v_mount == mp, ("marker vnode mount list mismatch")); +restart: vp = TAILQ_NEXT(*mvp, v_actfreelist); + TAILQ_REMOVE(&mp->mnt_activevnodelist, *mvp, v_actfreelist); while (vp != NULL) { if (vp->v_type == VMARKER) { vp = TAILQ_NEXT(vp, v_actfreelist); continue; } if (!VI_TRYLOCK(vp)) { - if (should_yield()) { + if (ALWAYS_YIELD || should_yield()) { + TAILQ_INSERT_BEFORE(vp, *mvp, v_actfreelist); mtx_unlock(&vnode_free_list_mtx); - kern_yield(PRI_UNCHANGED); + kern_yield(PRI_USER); mtx_lock(&vnode_free_list_mtx); + goto restart; } - goto restart; + continue; } - if (vp->v_mount == mp && vp->v_type != VMARKER && - (vp->v_iflag & VI_DOOMED) == 0) + KASSERT(vp->v_type != VMARKER, ("locked marker %p", vp)); + KASSERT(vp->v_mount == mp || vp->v_mount == NULL, + ("alien vnode on the active list %p %p", vp, mp)); + if (vp->v_mount == mp && (vp->v_iflag & VI_DOOMED) == 0) break; nvp = TAILQ_NEXT(vp, v_actfreelist); VI_UNLOCK(vp); @@ -4745,22 +4768,31 @@ restart: /* Check if we are done */ if (vp == NULL) { mtx_unlock(&vnode_free_list_mtx); - __mnt_vnode_markerfree_active(mvp, mp); - mtx_assert(MNT_MTX(mp), MA_NOTOWNED); + mnt_vnode_markerfree_active(mvp, mp); return (NULL); } - TAILQ_REMOVE(&mp->mnt_activevnodelist, *mvp, v_actfreelist); TAILQ_INSERT_AFTER(&mp->mnt_activevnodelist, vp, *mvp, v_actfreelist); mtx_unlock(&vnode_free_list_mtx); ASSERT_VI_LOCKED(vp, "active iter"); KASSERT((vp->v_iflag & VI_ACTIVE) != 0, ("Non-active vp %p", vp)); return (vp); } +#undef ALWAYS_YIELD + +struct vnode * +__mnt_vnode_next_active(struct vnode **mvp, struct mount *mp) +{ + + if (should_yield()) + kern_yield(PRI_UNCHANGED); + mtx_lock(&vnode_free_list_mtx); + return (mnt_vnode_next_active(mvp, mp)); +} struct vnode * __mnt_vnode_first_active(struct vnode **mvp, struct mount *mp) { - struct vnode *vp, *nvp; + struct vnode *vp; *mvp = malloc(sizeof(struct vnode), M_VNODE_MARKER, M_WAITOK | M_ZERO); MNT_ILOCK(mp); @@ -4770,44 +4802,14 @@ __mnt_vnode_first_active(struct vnode ** (*mvp)->v_mount = mp; mtx_lock(&vnode_free_list_mtx); -restart: vp = TAILQ_FIRST(&mp->mnt_activevnodelist); - while (vp != NULL) { - if (vp->v_type == VMARKER) { - vp = TAILQ_NEXT(vp, v_actfreelist); - continue; - } - if (!VI_TRYLOCK(vp)) { - if (should_yield()) { - mtx_unlock(&vnode_free_list_mtx); - kern_yield(PRI_UNCHANGED); - mtx_lock(&vnode_free_list_mtx); - } - goto restart; - } - if (vp->v_mount == mp && vp->v_type != VMARKER && - (vp->v_iflag & VI_DOOMED) == 0) - break; - nvp = TAILQ_NEXT(vp, v_actfreelist); - VI_UNLOCK(vp); - vp = nvp; - } - - /* Check if we are done */ if (vp == NULL) { mtx_unlock(&vnode_free_list_mtx); - MNT_ILOCK(mp); - MNT_REL(mp); - MNT_IUNLOCK(mp); - free(*mvp, M_VNODE_MARKER); - *mvp = NULL; + mnt_vnode_markerfree_active(mvp, mp); return (NULL); } - TAILQ_INSERT_AFTER(&mp->mnt_activevnodelist, vp, *mvp, v_actfreelist); - mtx_unlock(&vnode_free_list_mtx); - ASSERT_VI_LOCKED(vp, "active iter first"); - KASSERT((vp->v_iflag & VI_ACTIVE) != 0, ("Non-active vp %p", vp)); - return (vp); + TAILQ_INSERT_BEFORE(vp, *mvp, v_actfreelist); + return (mnt_vnode_next_active(mvp, mp)); } void @@ -4817,14 +4819,8 @@ __mnt_vnode_markerfree_active(struct vno if (*mvp == NULL) return; - KASSERT((*mvp)->v_mount == mp, ("marker vnode mount list mismatch")); - mtx_lock(&vnode_free_list_mtx); TAILQ_REMOVE(&mp->mnt_activevnodelist, *mvp, v_actfreelist); mtx_unlock(&vnode_free_list_mtx); - MNT_ILOCK(mp); - MNT_REL(mp); - MNT_IUNLOCK(mp); - free(*mvp, M_VNODE_MARKER); - *mvp = NULL; + mnt_vnode_markerfree_active(mvp, mp); } Modified: head/sys/sys/mount.h ============================================================================== --- head/sys/sys/mount.h Sat Dec 15 02:03:59 2012 (r244239) +++ head/sys/sys/mount.h Sat Dec 15 02:04:46 2012 (r244240) @@ -218,17 +218,12 @@ struct vnode *__mnt_vnode_next_active(st struct vnode *__mnt_vnode_first_active(struct vnode **mvp, struct mount *mp); void __mnt_vnode_markerfree_active(struct vnode **mvp, struct mount *); -#define MNT_VNODE_FOREACH_ACTIVE(vp, mp, mvp) \ - for (vp = __mnt_vnode_first_active(&(mvp), (mp)); \ +#define MNT_VNODE_FOREACH_ACTIVE(vp, mp, mvp) \ + for (vp = __mnt_vnode_first_active(&(mvp), (mp)); \ (vp) != NULL; vp = __mnt_vnode_next_active(&(mvp), (mp))) #define MNT_VNODE_FOREACH_ACTIVE_ABORT(mp, mvp) \ - do { \ - MNT_ILOCK(mp); \ - __mnt_vnode_markerfree_active(&(mvp), (mp)); \ - /* MNT_IUNLOCK(mp); -- done in above function */ \ - mtx_assert(MNT_MTX(mp), MA_NOTOWNED); \ - } while (0) + __mnt_vnode_markerfree_active(&(mvp), (mp)) /* * Definitions for MNT_VNODE_FOREACH. From owner-svn-src-head@FreeBSD.ORG Sat Dec 15 00:12:32 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6711AE04; Sat, 15 Dec 2012 00:12:32 +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 338C08FC17; Sat, 15 Dec 2012 00:12:32 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id D33E546B06; Fri, 14 Dec 2012 19:12:31 -0500 (EST) Date: Sat, 15 Dec 2012 00:12:31 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: John Baldwin Subject: Re: svn commit: r244112 - head/sys/kern In-Reply-To: <201212141149.07671.jhb@freebsd.org> Message-ID: References: <201212110708.qBB78EWx025288@svn.freebsd.org> <50C9271C.70803@mu.org> <20121213090215.GP97487@FreeBSD.org> <201212141149.07671.jhb@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 X-Mailman-Approved-At: Sat, 15 Dec 2012 02:27:50 +0000 Cc: Adrian Chadd , Alfred Perlstein , src-committers@freebsd.org, svn-src-all@freebsd.org, Alfred Perlstein , Andriy Gapon , Gleb Smirnoff , Navdeep Parhar , svn-src-head@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 15 Dec 2012 00:12:32 -0000 On Fri, 14 Dec 2012, John Baldwin wrote: > On Thursday, December 13, 2012 4:02:15 am Gleb Smirnoff wrote: >> On Wed, Dec 12, 2012 at 04:53:48PM -0800, Alfred Perlstein wrote: A> The >> problem again is that not all the KASSERTS are inviolable, if you A> want >> to do a project to split them, then please do, it would really be A> >> helpful, as for now, they are a mis-mash of death/warnings and there are A> >> at least three vendors who approve of this as well as 3 long term A> >> committers that approved my change (not including Adrian). >> >> Can you show examples of not inviolable KASSERTs? > > There are none. They are all assertions for a reason. However, in my > experience at several large consumers of FreeBSD, no one wants to run with > INVARIANTS in production. Not because we don't want panics (believe me, > Yahoo! gets plenty of panics even with INVARIANTS disabled), but because the > performance overhead, and redefining INVARIANTS into printf doesn't address > that at all. In the past, FYI, the two major INVARIANTS hits were un-inlining of locking, and UMA using additional global locking to perform heavier-weight sanity checking. For me, at least, the former wasn't such a problem, but the latter was extremely measurable. I have occasionally wondered if we should have another option name for heavier-duty sanity checking, as is the case with WITNESS, SOCKBUF_DEBUG, etc, so that INVARIANTS overhead can be made tolerable for more real-world installations. As you observe, our invariants tests are generally things where you catch critical problems in much more debuggable states, rather than sources of additional fragility, and it would be great if we could leave more in so that bug reports were able to contain more information. Robert From owner-svn-src-head@FreeBSD.ORG Sat Dec 15 00:21:26 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AC9B8365; Sat, 15 Dec 2012 00:21:26 +0000 (UTC) (envelope-from bright@mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 7E8AA8FC16; Sat, 15 Dec 2012 00:21:26 +0000 (UTC) Received: from Alfreds-MacBook-Pro-6.local (c-67-180-208-218.hsd1.ca.comcast.net [67.180.208.218]) by elvis.mu.org (Postfix) with ESMTPSA id B5D041A3CE3; Fri, 14 Dec 2012 16:21:25 -0800 (PST) Message-ID: <50CBC285.7060307@mu.org> Date: Fri, 14 Dec 2012 16:21:25 -0800 From: Alfred Perlstein User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Robert Watson Subject: Re: svn commit: r244112 - head/sys/kern References: <201212110708.qBB78EWx025288@svn.freebsd.org> <50C9271C.70803@mu.org> <20121213090215.GP97487@FreeBSD.org> <201212141149.07671.jhb@freebsd.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Mailman-Approved-At: Sat, 15 Dec 2012 02:50:52 +0000 Cc: Adrian Chadd , src-committers@freebsd.org, John Baldwin , svn-src-all@freebsd.org, Alfred Perlstein , Andriy Gapon , Gleb Smirnoff , Navdeep Parhar , svn-src-head@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 15 Dec 2012 00:21:26 -0000 On 12/14/12 4:12 PM, Robert Watson wrote: > On Fri, 14 Dec 2012, John Baldwin wrote: > >> On Thursday, December 13, 2012 4:02:15 am Gleb Smirnoff wrote: >>> On Wed, Dec 12, 2012 at 04:53:48PM -0800, Alfred Perlstein wrote: A> >>> The problem again is that not all the KASSERTS are inviolable, if >>> you A> want to do a project to split them, then please do, it would >>> really be A> helpful, as for now, they are a mis-mash of >>> death/warnings and there are A> at least three vendors who approve >>> of this as well as 3 long term A> committers that approved my change >>> (not including Adrian). >>> >>> Can you show examples of not inviolable KASSERTs? >> >> There are none. They are all assertions for a reason. However, in >> my experience at several large consumers of FreeBSD, no one wants to >> run with INVARIANTS in production. Not because we don't want panics >> (believe me, Yahoo! gets plenty of panics even with INVARIANTS >> disabled), but because the performance overhead, and redefining >> INVARIANTS into printf doesn't address that at all. > > In the past, FYI, the two major INVARIANTS hits were un-inlining of > locking, and UMA using additional global locking to perform > heavier-weight sanity checking. For me, at least, the former wasn't > such a problem, but the latter was extremely measurable. I have > occasionally wondered if we should have another option name for > heavier-duty sanity checking, as is the case with WITNESS, > SOCKBUF_DEBUG, etc, so that INVARIANTS overhead can be made tolerable > for more real-world installations. As you observe, our invariants > tests are generally things where you catch critical problems in much > more debuggable states, rather than sources of additional fragility, > and it would be great if we could leave more in so that bug reports > were able to contain more information. > > Robert > Yes. The KTR system offers an interesting reference for a model that allows us to make a compile time decision about which areas to trace. There used to be a DIAGNOSTIC option for the more heavy checks, this is either removed or just not used these days. Again, using a mask like KTR might be a win if we bring back the equivalent of heavy weight DIAGNOSTIC option. Often I've been guilty of putting KASSERT(ptr != NULL) checks into the code too. Those are really just to make it less painful when hitting that bug, so instead of having to do a lot of homework to figure out the fault address and line number, I can just get a pretty printed message under INVARIANTS. Maybe those "pretty null checks" need to go under another option, perhaps DIAGNOSTIC, or another .. ??PRETTY_PANIC. Anyhow, I've always been a huge fan of FreeBSD due the additional debugging checks it offered. I was the one that suggested splassert() back in the day when we would continually find issues with spl calls. Additionally I found doing filesystem work a ton easier with DEBUG_VFS_LOCKS under FreeBSD than under Darwin which at the time did not have such a feature. One of my great joys in developing FreeBSD is the flexibility and power it offers us as developers by giving us a huge library of debugging tools. -Alfred From owner-svn-src-head@FreeBSD.ORG Sat Dec 15 07:05:14 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B09ECB22; Sat, 15 Dec 2012 07:05:14 +0000 (UTC) (envelope-from rpaulo@felyko.com) Received: from felyko.com (felyko.com [IPv6:2607:f2f8:a528::3:1337:ca7]) by mx1.freebsd.org (Postfix) with ESMTP id 7B4F78FC15; Sat, 15 Dec 2012 07:05:14 +0000 (UTC) Received: from [IPv6:2601:9:4d00:85:5d89:5f66:6445:4383] (unknown [IPv6:2601:9:4d00:85:5d89:5f66:6445:4383]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by felyko.com (Postfix) with ESMTPSA id BD8913981E; Fri, 14 Dec 2012 23:05:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=felyko.com; s=mail; t=1355555114; bh=OfkUvTb1inY76Yf8Rzr75bjDrQijg+aMe/1RcY1mFYo=; h=Subject:From:In-Reply-To:Date:Cc:References:To; b=dbmdvrXhCvY1BNDSWVAYgVwlxri8lwVwLaU4B0RarNpxbWhkSAcwNy80FSdWJK0H5 hP9gqeSXfzsVXyd3AUHrL8bdZ3VKRAJnVnuQ8AxgEmavOzgs88p9jUtb824rlBC9QV ZBA3AxHlOHxRFwwSPae6jACBU0JFupDgvd4AwN/o= Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\)) Subject: Re: svn commit: r244105 - in head/sys: kern sys From: Rui Paulo In-Reply-To: <201212121042.51362.jhb@freebsd.org> Date: Fri, 14 Dec 2012 23:05:12 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201212110123.qBB1NpOV060501@svn.freebsd.org> <201212121042.51362.jhb@freebsd.org> To: Alfred Perlstein X-Mailer: Apple Mail (2.1499) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, John Baldwin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 15 Dec 2012 07:05:14 -0000 On 12 Dec 2012, at 07:42, John Baldwin wrote: > On Monday, December 10, 2012 8:23:51 pm Alfred Perlstein wrote: >> Author: alfred >> Date: Tue Dec 11 01:23:50 2012 >> New Revision: 244105 >> URL: http://svnweb.freebsd.org/changeset/base/244105 >>=20 >> Log: >> Switch the hardwired WITNESS panics to kassert_panic. >>=20 >> This is an ongoing effort to provide runtime debug information >> useful in the field that does not panic existing installations. >>=20 >> This gives us the flexibility needed when shipping images to a >> potentially large audience with WITNESS enabled without worrying >> about formerly non-fatal LORs hurting a release. >>=20 >> Sponsored by: iXsystems >=20 > Witness doesn't panic on LORs. These are all bigger violations for = things=20 > like doing sx_sunlock() on a exclusively locked sx lock. That is not = safe and=20 > is merely going to result in data corruption and other unpleasantness. = This=20 > sounds like a very bad idea. Did you talk about this anywhere (I have = not=20 > caught up on various lists yet, so apologies if this has been = discussed.) Eww. This is indeed pretty bad. I would like to see this commit = reverted. Regards, -- Rui Paulo From owner-svn-src-head@FreeBSD.ORG Sat Dec 15 07:28:21 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E1EDF161; Sat, 15 Dec 2012 07:28:21 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from fallbackmx08.syd.optusnet.com.au (fallbackmx08.syd.optusnet.com.au [211.29.132.10]) by mx1.freebsd.org (Postfix) with ESMTP id 631AD8FC14; Sat, 15 Dec 2012 07:28:20 +0000 (UTC) Received: from mail04.syd.optusnet.com.au (mail04.syd.optusnet.com.au [211.29.132.185]) by fallbackmx08.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id qBF7SEJ1024938; Sat, 15 Dec 2012 18:28:14 +1100 Received: from c122-106-175-26.carlnfd1.nsw.optusnet.com.au (c122-106-175-26.carlnfd1.nsw.optusnet.com.au [122.106.175.26]) by mail04.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id qBF7S4lJ030730 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 15 Dec 2012 18:28:05 +1100 Date: Sat, 15 Dec 2012 18:28:04 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov Subject: Re: svn commit: r244154 - head/bin/ps In-Reply-To: <20121215011300.GN71906@kib.kiev.ua> Message-ID: <20121215171150.U1295@besplex.bde.org> References: <201212121545.qBCFj4Hl086444@svn.freebsd.org> <20121212210652.GO3013@kib.kiev.ua> <20121213111240.GB1381@garage.freebsd.pl> <201212141152.15567.jhb@freebsd.org> <20121214214246.GB1411@garage.freebsd.pl> <20121215011300.GN71906@kib.kiev.ua> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.0 cv=EvuKNlgA c=1 sm=1 a=WqmuCUZ0mQMA:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=URALeSCvvZIA:10 a=6I5d2MoRAAAA:8 a=fh21wHrgMG6X0cUbLUoA:9 a=CjuIK1q_8ugA:10 a=cjgbkX1-xgueN3aY:21 a=Y5Lm4oOzTTMIlLbC:21 a=bxQHXO5Py4tHmhUgaywp5w==:117 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Pawel Jakub Dawidek , John Baldwin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 15 Dec 2012 07:28:22 -0000 On Sat, 15 Dec 2012, Konstantin Belousov wrote: > On Fri, Dec 14, 2012 at 10:42:47PM +0100, Pawel Jakub Dawidek wrote: >> On Fri, Dec 14, 2012 at 11:52:15AM -0500, John Baldwin wrote: >>> On Thursday, December 13, 2012 6:12:44 am Pawel Jakub Dawidek wrote: >>>> On Wed, Dec 12, 2012 at 11:06:52PM +0200, Konstantin Belousov wrote: >>>>> On Wed, Dec 12, 2012 at 03:45:04PM +0000, Pawel Jakub Dawidek wrote: >>>>>> Author: pjd >>>>>> Date: Wed Dec 12 15:45:03 2012 >>>>>> New Revision: 244154 >>>>>> URL: http://svnweb.freebsd.org/changeset/base/244154 >>>>>> >>>>>> Log: >>>>>> Use kern.max_pid sysctl to obtain maximum PID number instead of using local >>>>>> define. >>>>> It is pid_max, not max_pid. >>>>> >>>>> But the change is wrong. The kern.pid_max only limits newly allocated pids, >>>>> it does not magically moves existing pids, which are out of range, to the >>>>> limited region. See the corresponding commit log for the description. >>>>> It was added to make it easier to run FreeBSD 1.x binaries on the modern >>>>> kernels. >>>> >>>> I saw CTLFLAG_TUN on the sysctl and assumed it is read-only... >>>> How about defining BSD_PID_MAX in sys/proc.h, which would be visible by >>>> userland as well and setting PID_MAX to BSD_PID_MAX? >>>> >>>> This would also help bsnmpd. >>>> >>>> http://people.freebsd.org/~pjd/patches/PID_MAX.patch >>> >>> This doesn't help your actual use case though where you want to boot a kernel >>> with a different PID_MAX. I would much rather our tools learn such constants >>> from the kernel via sysctl than have them compiled in. So, I would add a new >>> sysctl which exports the true PID_MAX constant (and is read-only and never >>> changes) and use that in ps, etc. >> >> In that case I'd prefer to make existing kern.pid_max sysctl read-only >> and make it loader tunable. I don't expect there are many users of this >> sysctl... >> > No, I described you the purpose of the sysctl. Requiring reboot just for > running the old binaries is not useful. Please do not break it. ps doesn't make any useful use of either its BSD_PID_MAX or the kernel's PID_MAX anyway. Its only use is to break cases where these BSD_PID_MAX is smaller than the largest active pid. There are some useful uses of a limit: - to "optimize" the parsing function by not supporting pids larger than necessary - for formatting pids. The 99999 limit is useful for restricting the width of pid fields. With a dynamic limit, you need complications for dynamic widths. With a larger fixed limit, you need complications for dyamic widths anyway, since after expanding the pid fields there is no longer enough space for fixed widths in other fields. BTW, someone broke the formatting for ruptime(1) in -current. It now uses a fixed and _far too large_ width for the host name, so that most lines have length precisely 80 and get double-spaced by auto=linefeed on 80-column terminals. "ps l" still uses < 80 columns, with 2 5-digit fields for pids. Wide fields still eat into the field width for the COMMAND field. Interestingly, someone improved the formatting for the UID field -- it now seems to be dynamic and usually takes 3-4 columns, where it used to have the fixed width 5. ps of course doesn't use the limit for these useful uses: % #define BSD_PID_MAX 99999 /* Copy of PID_MAX from sys/proc.h. */ % static int % addelem_pid(struct listinfo *inf, const char *elem) % { % char *endp; % long tempid; % % if (*elem == '\0') { % warnx("Invalid (zero-length) process id"); % optfatal = 1; % return (0); /* Do not add this value. */ % } % % errno = 0; % tempid = strtol(elem, &endp, 10); Here ps assumes that the limit is < LONG_MAX. A reasonable assumption. % if (*endp != '\0' || tempid < 0 || elem == endp) { % warnx("Invalid %s: %s", inf->lname, elem); % errno = ERANGE; % } else if (errno != 0 || tempid > BSD_PID_MAX) { % warnx("%s too large: %s", inf->lname, elem); % errno = ERANGE; % } All ps does with BSD_PID_MAX is to give an up-front error for values that are so large that they can't match any pids. It would be harmless for it to simply accept all representable values and let them not match any actual pid later. Example uses: - ps -p 0,745,756: all 3 pids are accepted - ps -p -1: -1 is rejected because it gives tempid < -1 - ps -p 99999: 99999 is accepted because it is at the limit - ps -p 999999: 999999 is rejected because it is above the limit % if (errno == ERANGE) { % optfatal = 1; % return (0); % } % if (inf->count >= inf->maxcount) % expand_list(inf); % inf->l.pids[(inf->count)++] = tempid; l.pids[N] has type pid_t. We assume that the long tempid is representable as a pid. This is a valid assumption due to our earlier checks. 99999 is smaller than 2**31, so it fits in pid_t because pid_t happens to be int32_t. This would not necessarily be true of the limit were dynamic. The kern.pid_max sysctl actually returns an int. It makes sort of the opposite assumption -- that the max pid (which could reasonably be the max value representable by pid_t) in an int, instead of that the max value that we allow fits in a pid_t. Everything more or less assumes 32 bit ints and pid_t's. Anyway, a better value for BSD_PID_MAX is the maximum value representable by a pid_t. This has little to do with PID_MAX. We should use it just to ensure that tempid is representable in l.pids[]. % return (1); % } % #undef BSD_PID_MAX ps has not-quite-similar checks for UID_MAX and GID_MAX. I happen to have grepped ~100 utilities recently for their uid/gid parsing. I didn't find a single case of fully correct id parsing, but found many variations in the bugs. Their parsing in ps is better than in most places. UID_MAX and GID_MAX are now on the full max's for the types, so using them corresponds to the representability checks that I suggested above. Except UID_MAX and GID_MAX are not documented in any man page, so they shouldn't be assumed to have these values. And since uid_t and gid_t are unsigned types, it is very easy to spell their values portably as ((uid_t)-1) and ((gid_t)-1), respectively, so there is even less need for UID_MAX and GID_MAX than for PID_MAX. Bruce From owner-svn-src-head@FreeBSD.ORG Sat Dec 15 07:50:54 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 16B4C626; Sat, 15 Dec 2012 07:50:54 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) by mx1.freebsd.org (Postfix) with ESMTP id B5DB28FC0A; Sat, 15 Dec 2012 07:50:53 +0000 (UTC) Received: from JRE-MBP-2.local (ppp121-45-232-233.lns20.per1.internode.on.net [121.45.232.233]) (authenticated bits=0) by vps1.elischer.org (8.14.5/8.14.5) with ESMTP id qBF7omXh007186 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Fri, 14 Dec 2012 23:50:50 -0800 (PST) (envelope-from julian@freebsd.org) Message-ID: <50CC2BD2.9010601@freebsd.org> Date: Sat, 15 Dec 2012 15:50:42 +0800 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Andriy Gapon Subject: Re: svn commit: r244112 - head/sys/kern References: <201212110708.qBB78EWx025288@svn.freebsd.org> <201212121046.43706.jhb@freebsd.org> <50C9072A.6040605@FreeBSD.org> In-Reply-To: <50C9072A.6040605@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Adrian Chadd , src-committers@freebsd.org, John Baldwin , svn-src-all@freebsd.org, Alfred Perlstein , svn-src-head@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 15 Dec 2012 07:50:54 -0000 On 12/13/12 6:37 AM, Andriy Gapon wrote: > on 12/12/2012 19:06 Adrian Chadd said the following: >> kassert()s are already optional. Ie, you can choose to not compile them in. >> >> So the __dead2() code path bit for doing KASSERT() -> kassert_panic() >> at compile time isn't a problem. >> >> The problem is where you do panic() -> kassert_panic() (eg in the >> Witness code) which is what Alfred discovered shortly after doing up >> his initial patch. >> >> Anything which is a KASSERT() can and should be treated as a run-time >> warning just as much as a run-time "crash here so I can figure out >> what broke." Having the warning in a production box is going to be >> helpful for developers. > I have a quite different view on purpose and costs of KASSERTs. > Specifically referring to r243980 I do not think that "non-fatal asserts" should > really exist (or do exist). I wish all this muddying of KASSERT meaning > would get reverted. > > These quite sensitive changes were rushed in, IMO. having worked in a place where asserts were by default NON fatal, I can say that it is a REALLY BAD IDEA. it never did anything but cost us time and effort.. one reason it was there was the lack of a debugger in Linux at the time but all ports had top pay the price... (new linux does have one at last) > > >> On 12 December 2012 07:46, John Baldwin wrote: >>> On Tuesday, December 11, 2012 2:08:14 am Alfred Perlstein wrote: >>>> Author: alfred >>>> Date: Tue Dec 11 07:08:14 2012 >>>> New Revision: 244112 >>>> URL: http://svnweb.freebsd.org/changeset/base/244112 >>>> >>>> Log: >>>> Cleanup more of the kassert_panic. >>>> >>>> fix compile warnings on !amd64 and NULL derefs that would happen >>>> if kassert_panic() would return. >>> This is one reason why having kassert not panic is such a bad idea. There are >>> tons of places where the compiler knows that panic() is __dead2, and there is >>> no cleanup code to handle what happens when an invariant is violated. This is >>> not safe to run in the field unless your customers do not care about their >>> data. If you are interested in doing regression tests, I am using a very >>> different approach for some locking regression tests I am working on in p4 >>> that allow you to use a wrapper around setjmp/longjmp to "catch" panics >>> somewhat like exception handling in C++/Java (though much cruder). However, >>> evne that is only intended for testing, not for production cases where >>> production data is at stake. >>> >>> -- >>> John Baldwin > From owner-svn-src-head@FreeBSD.ORG Sat Dec 15 08:53:59 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 145C73AA; Sat, 15 Dec 2012 08:53:59 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id ED3D68FC13; Sat, 15 Dec 2012 08:53:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBF8rwtG011024; Sat, 15 Dec 2012 08:53:58 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBF8rwQa011023; Sat, 15 Dec 2012 08:53:58 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201212150853.qBF8rwQa011023@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sat, 15 Dec 2012 08:53:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244243 - head/sbin/growfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 15 Dec 2012 08:53:59 -0000 Author: trasz Date: Sat Dec 15 08:53:58 2012 New Revision: 244243 URL: http://svnweb.freebsd.org/changeset/base/244243 Log: Fix extending filesystems of weird size by making sure the actual size is always multiple of fragment size. Modified: head/sbin/growfs/growfs.c Modified: head/sbin/growfs/growfs.c ============================================================================== --- head/sbin/growfs/growfs.c Sat Dec 15 08:29:22 2012 (r244242) +++ head/sbin/growfs/growfs.c Sat Dec 15 08:53:58 2012 (r244243) @@ -1487,6 +1487,12 @@ main(int argc, char **argv) } } + /* + * Make sure the new size is a multiple of fs_fsize; /dev/ufssuspend + * only supports fragment-aligned IO requests. + */ + size -= size % osblock.fs_fsize; + if (size <= (uint64_t)(osblock.fs_size * osblock.fs_fsize)) { humanize_number(oldsizebuf, sizeof(oldsizebuf), osblock.fs_size * osblock.fs_fsize, From owner-svn-src-head@FreeBSD.ORG Sat Dec 15 10:02:12 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4752A521; Sat, 15 Dec 2012 10:02:12 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 123338FC0C; Sat, 15 Dec 2012 10:02:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBFA2Bhb028179; Sat, 15 Dec 2012 10:02:11 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBFA2BUr028178; Sat, 15 Dec 2012 10:02:11 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201212151002.qBFA2BUr028178@svn.freebsd.org> From: Martin Matuska Date: Sat, 15 Dec 2012 10:02:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244246 - head/cddl/contrib/opensolaris/cmd/zdb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 15 Dec 2012 10:02:12 -0000 Author: mm Date: Sat Dec 15 10:02:11 2012 New Revision: 244246 URL: http://svnweb.freebsd.org/changeset/base/244246 Log: MFV r244245: Merge two zdb bugfixes from vendor (illumos) illumos-gate 13894:f4af77f6bbd2 3397 zdb output is too verbose 3398 zdb can't dump feature flags zap objects References: https://www.illumos.org/issues/3397 https://www.illumos.org/issues/3398 MFC after: 1 week Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Directory Properties: head/cddl/contrib/opensolaris/ (props changed) Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Sat Dec 15 09:50:31 2012 (r244245) +++ head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Sat Dec 15 10:02:11 2012 (r244246) @@ -61,14 +61,16 @@ #undef verify #include -#define ZDB_COMPRESS_NAME(idx) ((idx) < ZIO_COMPRESS_FUNCTIONS ? \ - zio_compress_table[(idx)].ci_name : "UNKNOWN") -#define ZDB_CHECKSUM_NAME(idx) ((idx) < ZIO_CHECKSUM_FUNCTIONS ? \ - zio_checksum_table[(idx)].ci_name : "UNKNOWN") -#define ZDB_OT_NAME(idx) ((idx) < DMU_OT_NUMTYPES ? \ - dmu_ot[(idx)].ot_name : DMU_OT_IS_VALID(idx) ? \ - dmu_ot_byteswap[DMU_OT_BYTESWAP(idx)].ob_name : "UNKNOWN") -#define ZDB_OT_TYPE(idx) ((idx) < DMU_OT_NUMTYPES ? (idx) : DMU_OT_NUMTYPES) +#define ZDB_COMPRESS_NAME(idx) ((idx) < ZIO_COMPRESS_FUNCTIONS ? \ + zio_compress_table[(idx)].ci_name : "UNKNOWN") +#define ZDB_CHECKSUM_NAME(idx) ((idx) < ZIO_CHECKSUM_FUNCTIONS ? \ + zio_checksum_table[(idx)].ci_name : "UNKNOWN") +#define ZDB_OT_NAME(idx) ((idx) < DMU_OT_NUMTYPES ? \ + dmu_ot[(idx)].ot_name : DMU_OT_IS_VALID(idx) ? \ + dmu_ot_byteswap[DMU_OT_BYTESWAP(idx)].ob_name : "UNKNOWN") +#define ZDB_OT_TYPE(idx) ((idx) < DMU_OT_NUMTYPES ? (idx) : \ + (((idx) == DMU_OTN_ZAP_DATA || (idx) == DMU_OTN_ZAP_METADATA) ? \ + DMU_OT_ZAP_OTHER : DMU_OT_NUMTYPES)) #ifndef lint extern int zfs_recover; @@ -3194,7 +3196,13 @@ main(int argc, char **argv) argv[i], strerror(errno)); } } - (os != NULL) ? dump_dir(os) : dump_zpool(spa); + if (os != NULL) { + dump_dir(os); + } else if (zopt_objects > 0 && !dump_opt['m']) { + dump_dir(spa->spa_meta_objset); + } else { + dump_zpool(spa); + } } else { flagbits['b'] = ZDB_FLAG_PRINT_BLKPTR; flagbits['c'] = ZDB_FLAG_CHECKSUM; From owner-svn-src-head@FreeBSD.ORG Sat Dec 15 10:56:17 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7735D585; Sat, 15 Dec 2012 10:56:17 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4143E8FC0A; Sat, 15 Dec 2012 10:56:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBFAuHOa042515; Sat, 15 Dec 2012 10:56:17 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBFAuHsi042514; Sat, 15 Dec 2012 10:56:17 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201212151056.qBFAuHsi042514@svn.freebsd.org> From: Hans Petter Selasky Date: Sat, 15 Dec 2012 10:56:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244252 - head/etc/devd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 15 Dec 2012 10:56:17 -0000 Author: hselasky Date: Sat Dec 15 10:56:16 2012 New Revision: 244252 URL: http://svnweb.freebsd.org/changeset/base/244252 Log: Regenerate usb.conf MFC after: 1 week Modified: head/etc/devd/usb.conf Modified: head/etc/devd/usb.conf ============================================================================== --- head/etc/devd/usb.conf Sat Dec 15 10:48:10 2012 (r244251) +++ head/etc/devd/usb.conf Sat Dec 15 10:56:16 2012 (r244252) @@ -423,6 +423,14 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x0499"; + match "product" "(0x1000|0x1001|0x1002|0x1003|0x1004|0x1005|0x1006|0x1007|0x1008|0x1009|0x100a|0x100c|0x100d|0x100e|0x100f|0x1010|0x1011|0x1012|0x1013|0x1014|0x1015|0x1016|0x1017|0x1018|0x1019|0x101a|0x101b|0x101c|0x101d|0x101e|0x101f|0x1020|0x1021|0x1022|0x1023|0x1024|0x1025|0x1026|0x1027|0x1028|0x1029|0x102a|0x102b|0x102e|0x1030|0x1031|0x1032|0x1033|0x1034|0x1035|0x1036|0x1037|0x1038|0x1039|0x103a|0x103b|0x103c|0x103d|0x103e|0x103f|0x1040|0x1041|0x1042|0x1043|0x1044|0x1045|0x104e|0x104f|0x1050|0x1051|0x1052|0x1053|0x1054|0x1055|0x1056|0x1057|0x1058|0x1059|0x105a|0x105b|0x105c|0x105d|0x1503|0x2000|0x2001|0x2002|0x2003|0x5000|0x5001|0x5002|0x5003|0x5004|0x5005|0x5006|0x5007|0x5008|0x5009|0x500a|0x500b|0x500c|0x500d|0x500e|0x500f|0x7000|0x7010)"; + action "kldload -n snd_uaudio"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x049f"; match "product" "(0x0003|0x0032)"; action "kldload -n uipaq"; @@ -2647,6 +2655,14 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x0f3d"; + match "product" "0x68aa"; + action "kldload -n u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x0f4e"; match "product" "0x0200"; action "kldload -n uipaq"; @@ -4199,6 +4215,14 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x22de"; + match "product" "0x6801"; + action "kldload -n u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x2478"; match "product" "0x2008"; action "kldload -n uplcom"; @@ -4611,5 +4635,5 @@ nomatch 32 { action "kldload -n umass"; }; -# 2279 USB entries processed +# 2386 USB entries processed From owner-svn-src-head@FreeBSD.ORG Sat Dec 15 10:56:29 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5568B6DD; Sat, 15 Dec 2012 10:56:29 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail06.syd.optusnet.com.au (mail06.syd.optusnet.com.au [211.29.132.187]) by mx1.freebsd.org (Postfix) with ESMTP id CA3CD8FC12; Sat, 15 Dec 2012 10:56:28 +0000 (UTC) Received: from c122-106-175-26.carlnfd1.nsw.optusnet.com.au (c122-106-175-26.carlnfd1.nsw.optusnet.com.au [122.106.175.26]) by mail06.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id qBFAuOux003282 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 15 Dec 2012 21:56:25 +1100 Date: Sat, 15 Dec 2012 21:56:24 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Carl Delsey Subject: Re: svn commit: r244193 - head/sys/x86/include In-Reply-To: <50CBAD0E.5050907@intel.com> Message-ID: <20121215212259.F2058@besplex.bde.org> References: <201212132140.qBDLeBhd019751@svn.freebsd.org> <20121214154930.D973@besplex.bde.org> <50CBAD0E.5050907@intel.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.0 cv=L9pF2Jv8 c=1 sm=1 a=L6I1Zbe1xPYA:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=RQfEP2Kgk-UA:10 a=GAnm5n-mn4thhljHDL0A:9 a=CjuIK1q_8ugA:10 a=bxQHXO5Py4tHmhUgaywp5w==:117 Cc: svn-src-head@freebsd.org, Jim Harris , svn-src-all@freebsd.org, src-committers@freebsd.org, Bruce Evans X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 15 Dec 2012 10:56:29 -0000 On Fri, 14 Dec 2012, Carl Delsey wrote: > On 12/13/12 21:49, Bruce Evans wrote: >> On Thu, 13 Dec 2012, Jim Harris wrote: >> >>> Log: >>> Add bus_space_read_8 and bus_space_write_8 for amd64. >>> >>> Rather than trying to KASSERT for callers that invoke this on >>> IO tags, either do nothing (for write_8) or return ~0 (for read_8). >> >> read_8 returns a uint64_t, so it cannot return the signed integer ~0. >> It actually returns this signed integer converted to uint64_t. On >> amd64, this is the 32 bit value 0xffffffff. The 64-bit value >> 0xffffffffffffffff should be returned. > I double checked and 0xffffffffffffffff is being returned when compiled by > both clang and gcc. Oops. ~0 is (int)-1 (assuming 2's complement. This gets converted to (uint64_t)-1 = 0xfff...fffUL. I still prefer the explicit hex constant. Higher-level bus.h APIs and clients mostly use ~0ul (with that spelling) for this. This is the documented spelling in bus_alloc_resource(9). It is shorter and more portable than 0xfff...fffUL where the number of f's is MD. The ul in it avoids the sign extension problems that I was worried about here. ~0 is unportable (depends on 2's complement). ~0u is portable but even harder to use than ~0 in practice. It is what gives the 32-bit value unless it is actually ~0ul. I wonder how these ~0ul's work for PAE -- on i386, they only give 32-bit values, but bus addresses are 64 bits for PAE. I guess they just don't work for PAE. Nothing at all in the MI sys/bus.h supports PAE's 64-bit bus addresses, since sys/bus.h uses u_long for almost everything (int never uses [u]int64_t, [u]_quad_t or [unsigned] long long). >>> Modified: head/sys/x86/include/bus.h >>> ============================================================================== >>> --- head/sys/x86/include/bus.h Thu Dec 13 21:39:59 2012 (r244192) >>> +++ head/sys/x86/include/bus.h Thu Dec 13 21:40:11 2012 (r244193) >>> @@ -130,6 +130,7 @@ >>> #define BUS_SPACE_MAXADDR 0xFFFFFFFF >>> #endif >> >> This file spells the F in hex constants in upper case. >> >> In the above definition and in previous ones, it is careful to spell out >> the constants and not depend on sign extension. So it is also a style >> bug to use ~0. > Are you saying it is a style bug to not match the style used above, > regardless of whether that style is right or wrong, or are you saying (~0) > is always a style bug? You might as well match the above style. ~0 is at worst a style bug, not a wrong value like I said. It is harder to use since its correctness depends on the arch being 2's complement, and understanding its correctness depends on knowing C's promotion rules and not forgetting them like I did. I also don't mind using (~0ul) for most of the values, to be consistent with the MI spelling. This might reduce ifdefs. But there is only 1 ifdef for a 64-bit value now, and 1 would still be needed for the PAE case if 64 bits actually work for PAE. >> Style bug visible in the above: space instead of tab after #define. This >> style bugs is in all #define's near here, including the new one. >> >> Type error in #define's just before the above: the above BUS_SPACE_MAXADDR >> is for 32 bits. For amd64 and i386-PAE, BUS_SPACE_MAXADDR is of course >> 64 bits, but the ifdef tangle for it is not tangled enough to be correct: >> BUS_SPACE_MAXADDR is 0xFFFFFFFFFFFFFFFFULL, on both, but bus_addr_t is only >> unsigned long long on i386-PAE. > I think this should be a separate patch though, since it is unrelated to this > change. Fine. >>> +#ifdef __amd64__ >>> +static __inline uint64_t bus_space_read_8(bus_space_tag_t tag, >>> + bus_space_handle_t handle, >>> + bus_size_t offset); >>> +#endif >>> + >> >> This is style-bug for bug compatible with the existing forward >> declarations. Forward declarations of inline functions are nonsense. >> They are from NetBSD, for K&R support. But FreeBSD never supported >> K&R in bus-space headers, and the forward declarations never even >> compiled with K&R, since they never used __P(()). Almost 1/3 of the >> x86 bus.h consists of these negatively useful forward declarations. >> Some of them are almost as large as the full functions, since they are >> misformatted worse, with parameters starting at about column 40 instead >> of about column 20, so so that many lines are needed just for the >> parameters (to line them up in perfectly non-KNF gnu style). > Same with this - separate patch Fine. >>> -#if 0 /* Cause a link error for bus_space_read_8 */ >>> -#define bus_space_read_8(t, h, o) !!! bus_space_read_8 >>> unimplemented !!! >>> +#ifdef __amd64__ >>> +static __inline uint64_t >>> +bus_space_read_8(bus_space_tag_t tag, bus_space_handle_t handle, >>> + bus_size_t offset) >>> +{ >>> + >>> + if (tag == X86_BUS_SPACE_IO) /* No 8 byte IO space access on x86 */ >> >> The comment is not indented, and should probably not be placed to the >> right of the code. This file mostly doesn't place comments there, and >> when it does it doesn't capitalize them. One that does also spells IO >> as i/o. > All the #if 0 lines also start with an end of line comment, and they are all > capitalized. By "not indented" are you saying that all end of line comments > must be preceded by a tab? #if 0 lines tend to be sloppier. I would put the comments for them on separate lines. End of line comments should be preceded by enough tabs to reach the normal indentation level for such comments. This is 32 or 40 columns (indent -ci 33 or -ci 41). Verbose code may need more. Then it is impossible to use the normal indentation level. I use 2 spaces then, but prefer to avoid such code and comments to the right of any code (within functions). Bruce From owner-svn-src-head@FreeBSD.ORG Sat Dec 15 06:04:31 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 561AC25A; Sat, 15 Dec 2012 06:04:31 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail13.syd.optusnet.com.au (mail13.syd.optusnet.com.au [211.29.132.194]) by mx1.freebsd.org (Postfix) with ESMTP id C3A708FC17; Sat, 15 Dec 2012 06:04:29 +0000 (UTC) Received: from c122-106-175-26.carlnfd1.nsw.optusnet.com.au (c122-106-175-26.carlnfd1.nsw.optusnet.com.au [122.106.175.26]) by mail13.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id qBF64HxN017455 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 15 Dec 2012 17:04:19 +1100 Date: Sat, 15 Dec 2012 17:04:17 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Alfred Perlstein Subject: Re: svn commit: r244112 - head/sys/kern In-Reply-To: <50CBC285.7060307@mu.org> Message-ID: <20121215161414.V1029@besplex.bde.org> References: <201212110708.qBB78EWx025288@svn.freebsd.org> <50C9271C.70803@mu.org> <20121213090215.GP97487@FreeBSD.org> <201212141149.07671.jhb@freebsd.org> <50CBC285.7060307@mu.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.0 cv=BrrFWvr5 c=1 sm=1 a=9gktFwppygsA:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=M4roAWbnUW4A:10 a=mT7c94_YR1GvEF4OrkYA:9 a=CjuIK1q_8ugA:10 a=ggKEkdPFzXdPy3Qo:21 a=9UpuXnAP4qImuvuz:21 a=bxQHXO5Py4tHmhUgaywp5w==:117 X-Mailman-Approved-At: Sat, 15 Dec 2012 12:32:20 +0000 Cc: Adrian Chadd , src-committers@freebsd.org, John Baldwin , svn-src-all@freebsd.org, Alfred Perlstein , Andriy Gapon , Gleb Smirnoff , Robert Watson , Navdeep Parhar , svn-src-head@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 15 Dec 2012 06:04:31 -0000 On Fri, 14 Dec 2012, Alfred Perlstein wrote: > On 12/14/12 4:12 PM, Robert Watson wrote: >> On Fri, 14 Dec 2012, John Baldwin wrote: >> >>> On Thursday, December 13, 2012 4:02:15 am Gleb Smirnoff wrote: >>>> On Wed, Dec 12, 2012 at 04:53:48PM -0800, Alfred Perlstein wrote: A> The >>>> problem again is that not all the KASSERTS are inviolable, if you A> want >>>> to do a project to split them, then please do, it would really be A> >>>> helpful, as for now, they are a mis-mash of death/warnings and there are >>>> A> at least three vendors who approve of this as well as 3 long term A> >>>> committers that approved my change (not including Adrian). >>>> >>>> Can you show examples of not inviolable KASSERTs? >>> >>> There are none. They are all assertions for a reason. However, in my Not even one whose existence is a bug? :-) >>> experience at several large consumers of FreeBSD, no one wants to run with >>> INVARIANTS in production. Not because we don't want panics (believe me, >>> Yahoo! gets plenty of panics even with INVARIANTS disabled), but because >>> the performance overhead, and redefining INVARIANTS into printf doesn't >>> address that at all. I mostly don't use INVARIANTS, but once used Debugger() a lot. Now I only want to debug my own code and sometimes turn on INVARIANTS to try to do this, but it usually exposes more bugs not in my own code so I turn it off again :-). >> In the past, FYI, the two major INVARIANTS hits were un-inlining of >> locking, and UMA using additional global locking to perform heavier-weight >> sanity checking. For me, at least, the former wasn't such a problem, but >> the latter was extremely measurable. I have occasionally wondered if we >> should have another option name for heavier-duty sanity checking, as is the >> case with WITNESS, SOCKBUF_DEBUG, etc, so that INVARIANTS overhead can be >> made tolerable for more real-world installations. As you observe, our >> invariants tests are generally things where you catch critical problems in >> much more debuggable states, rather than sources of additional fragility, >> and it would be great if we could leave more in so that bug reports were >> able to contain more information. I think that KASSERT() is used too much: - the heavyweight uses that you mention - many lightweight unconditional panics in old code were turned into conditional panics using KASSERT(). So production code that turns off INVARIANTS no longer gets the benefit of the sanity checking for these. - newer code tends to use KASSERT() even for things that could reasonably be lightweight unconditional panics. So production code that turns off INVARIANTS never got the benefit of the sanity checking for these. - not many unconditional panics (with non-lightweight checking for them) can't be left in production code, so there were a limited number of them, with a few pushed under DIAGNOSTIC. In particular, ones for debugging didn't grow unboundedly. Now, KASSERT()s grow unboundedly and the cost of enabling INVARIANTS grows unboundedly. - the source code becomes unreadable, with half of it tending to consist ot misformatted KASSERT()s SHOUTING IN UPPER CASE. The latter bug is missing in assert(3). assert(3) has a better designed API in other respects too. For example it supplies the bloat for __func__, __FILE__ and __LINE__ whether you want this or not. This bloat was intentionally left out for KASSERT(). But many uses of KASSERT() supply this bloat in the caller, where it also bloat the source code. > The KTR system offers an interesting reference for a model that allows us to > make a compile time decision about which areas to trace. > > There used to be a DIAGNOSTIC option for the more heavy checks, this is > either removed or just not used these days. Again, using a mask like KTR > might be a win if we bring back the equivalent of heavy weight DIAGNOSTIC > option. DIGANOSTIC still exists. It is rarely used, and tends to be only used for heavyweight checks that are too buggy or too heavyweight or just too old to put in KASSERT(). > Often I've been guilty of putting KASSERT(ptr != NULL) checks into the code > too. Those are really just to make it less painful when hitting that bug, You mean to make it _more_ painful when hitting that bug. > so > instead of having to do a lot of homework to figure out the fault address and > line number, I can just get a pretty printed message under INVARIANTS. Maybe > those "pretty null checks" need to go under another option, perhaps > DIAGNOSTIC, or another .. ??PRETTY_PANIC. Null pointer panics give restartable page faults, with the fault address printed by trap_fatal() and the page fault often easy to restart using a debugger. trap_fatal() calls the debugger, so the page fault isn't completely transparent. This corresponds to gdb in userland stopping on the signal for the page fault. You might have to use "handle SIGFOO Stop/Print/Pass" to get back to the faulting instruction. In the kernel, continuing from trap_fatal() gives this behaviour. The page fault will repeat endlessly unless you fix it up. You can try various fixes until you find one that doesn't fault, or let it fault a few times to look at the context in different ways. If panic() is used for null pointers, then you get an unrestartable panic(), with the relevant context several frames back where it is hard to see and much more difficult to restart from (practically impossible now that panic() stops CPUs, etc., though it used to be possible to unwind the frame in some cases). The null pointer check doesn't even detect the common case where the pointer is &p->bar where p is null. Now the bad pointer is a small offset from a null pointer (normally at a small address). It would take an earlier check of p to detect this. > Anyhow, I've always been a huge fan of FreeBSD due the additional debugging > checks it offered. I was the one that suggested splassert() back in the day > when we would continually find issues with spl calls. Additionally I found SPLASSERT() was almost never used. The only uses that I can find of it are all in netipsec. > doing filesystem work a ton easier with DEBUG_VFS_LOCKS under FreeBSD than > under Darwin which at the time did not have such a feature. This was more useful I think :-). The main reason that SPLASSERT() was useless was because spl was a stable API that went away at about the same time that SPLASSERT() was added (SPLASSERT() was implemented about 6 months before SMPng killed spl). Bruce From owner-svn-src-head@FreeBSD.ORG Sat Dec 15 12:35:27 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 200593AD; Sat, 15 Dec 2012 12:35:27 +0000 (UTC) (envelope-from bright@mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id E10288FC15; Sat, 15 Dec 2012 12:35:26 +0000 (UTC) Received: from Alfreds-MacBook-Pro-6.local (c-67-180-208-218.hsd1.ca.comcast.net [67.180.208.218]) by elvis.mu.org (Postfix) with ESMTPSA id 3C6681A3C1D; Sat, 15 Dec 2012 04:35:26 -0800 (PST) Message-ID: <50CC6E8D.6040707@mu.org> Date: Sat, 15 Dec 2012 04:35:25 -0800 From: Alfred Perlstein User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Bruce Evans Subject: Re: svn commit: r244112 - head/sys/kern References: <201212110708.qBB78EWx025288@svn.freebsd.org> <50C9271C.70803@mu.org> <20121213090215.GP97487@FreeBSD.org> <201212141149.07671.jhb@freebsd.org> <50CBC285.7060307@mu.org> <20121215161414.V1029@besplex.bde.org> In-Reply-To: <20121215161414.V1029@besplex.bde.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Mailman-Approved-At: Sat, 15 Dec 2012 12:44:54 +0000 Cc: Adrian Chadd , src-committers@freebsd.org, John Baldwin , svn-src-all@freebsd.org, Alfred Perlstein , Andriy Gapon , Gleb Smirnoff , Robert Watson , Navdeep Parhar , svn-src-head@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 15 Dec 2012 12:35:27 -0000 On 12/14/12 10:04 PM, Bruce Evans wrote: > On Fri, 14 Dec 2012, Alfred Perlstein wrote: > >> On 12/14/12 4:12 PM, Robert Watson wrote: >>> On Fri, 14 Dec 2012, John Baldwin wrote: >>> >>>> On Thursday, December 13, 2012 4:02:15 am Gleb Smirnoff wrote: >>>>> On Wed, Dec 12, 2012 at 04:53:48PM -0800, Alfred Perlstein wrote: >>>>> A> The problem again is that not all the KASSERTS are inviolable, >>>>> if you A> want to do a project to split them, then please do, it >>>>> would really be A> helpful, as for now, they are a mis-mash of >>>>> death/warnings and there are A> at least three vendors who approve >>>>> of this as well as 3 long term A> committers that approved my >>>>> change (not including Adrian). >>>>> >>>>> Can you show examples of not inviolable KASSERTs? >>>> >>>> There are none. They are all assertions for a reason. However, in my > > Not even one whose existence is a bug? :-) This is my point exactly, and exactly what I've been experiencing. People keep beating this drum "all invariants/panics are there for a reason", no, some happen to be bugs, and when I'm shipping code to a customer, I may need to skip one of these buggy assertions. Some people have responded to this by saying "alfred show me the buggy assertions" to which my response is two fold "firstly, you're calling me a liar which I do not appreciate, second prove to me that all the 1000s of asserts have zero bugs and are not overly zealous about calling panic." >>>> experience at several large consumers of FreeBSD, no one wants to >>>> run with INVARIANTS in production. Not because we don't want >>>> panics (believe me, Yahoo! gets plenty of panics even with >>>> INVARIANTS disabled), but because the performance overhead, and >>>> redefining INVARIANTS into printf doesn't address that at all. > > I mostly don't use INVARIANTS, but once used Debugger() a lot. Now I > only want to debug my own code and sometimes turn on INVARIANTS to try > to do this, but it usually exposes more bugs not in my own code so I > turn it off again :-). *yup* > >>> In the past, FYI, the two major INVARIANTS hits were un-inlining of >>> locking, and UMA using additional global locking to perform >>> heavier-weight sanity checking. For me, at least, the former wasn't >>> such a problem, but the latter was extremely measurable. I have >>> occasionally wondered if we should have another option name for >>> heavier-duty sanity checking, as is the case with WITNESS, >>> SOCKBUF_DEBUG, etc, so that INVARIANTS overhead can be made >>> tolerable for more real-world installations. As you observe, our >>> invariants tests are generally things where you catch critical >>> problems in much more debuggable states, rather than sources of >>> additional fragility, and it would be great if we could leave more >>> in so that bug reports were able to contain more information. > > I think that KASSERT() is used too much: > - the heavyweight uses that you mention > - many lightweight unconditional panics in old code were turned into > conditional panics using KASSERT(). So production code that turns off > INVARIANTS no longer gets the benefit of the sanity checking for these. > - newer code tends to use KASSERT() even for things that could reasonably > be lightweight unconditional panics. So production code that turns off > INVARIANTS never got the benefit of the sanity checking for these. > - not many unconditional panics (with non-lightweight checking for them) > can't be left in production code, so there were a limited number of > them, > with a few pushed under DIAGNOSTIC. In particular, ones for debugging > didn't grow unboundedly. Now, KASSERT()s grow unboundedly and the > cost of enabling INVARIANTS grows unboundedly. > - the source code becomes unreadable, with half of it tending to consist > ot misformatted KASSERT()s SHOUTING IN UPPER CASE. The latter bug is > missing in assert(3). assert(3) has a better designed API in other > respects too. For example it supplies the bloat for __func__, __FILE__ > and __LINE__ whether you want this or not. This bloat was > intentionally > left out for KASSERT(). But many uses of KASSERT() supply this bloat > in the caller, where it also bloat the source code. BUT I LIKE TO PANIC IN UPPER CASE BRUCE. > >> The KTR system offers an interesting reference for a model that >> allows us to make a compile time decision about which areas to trace. >> >> There used to be a DIAGNOSTIC option for the more heavy checks, this >> is either removed or just not used these days. Again, using a mask >> like KTR might be a win if we bring back the equivalent of heavy >> weight DIAGNOSTIC option. > > DIGANOSTIC still exists. It is rarely used, and tends to be only used > for > heavyweight checks that are too buggy or too heavyweight or just too old > to put in KASSERT(). Yes. > >> Often I've been guilty of putting KASSERT(ptr != NULL) checks into >> the code too. Those are really just to make it less painful when >> hitting that bug, > > You mean to make it _more_ painful when hitting that bug. ha. :) > >> so instead of having to do a lot of homework to figure out the fault >> address and line number, I can just get a pretty printed message >> under INVARIANTS. Maybe those "pretty null checks" need to go under >> another option, perhaps DIAGNOSTIC, or another .. ??PRETTY_PANIC. > > Null pointer panics give restartable page faults, with the fault address > printed by trap_fatal() and the page fault often easy to restart using a > debugger. trap_fatal() calls the debugger, so the page fault isn't > completely transparent. This corresponds to gdb in userland stopping > on the signal for the page fault. You might have to use "handle SIGFOO > Stop/Print/Pass" to get back to the faulting instruction. In the kernel, > continuing from trap_fatal() gives this behaviour. The page fault will > repeat endlessly unless you fix it up. You can try various fixes until > you find one that doesn't fault, or let it fault a few times to look > at the context in different ways. > > If panic() is used for null pointers, then you get an unrestartable > panic(), with the relevant context several frames back where it is > hard to see and much more difficult to restart from (practically > impossible now that panic() stops CPUs, etc., though it used to be > possible to unwind the frame in some cases). > > The null pointer check doesn't even detect the common case where the > pointer is &p->bar where p is null. Now the bad pointer is a small > offset from a null pointer (normally at a small address). It would > take an earlier check of p to detect this. > >> Anyhow, I've always been a huge fan of FreeBSD due the additional >> debugging checks it offered. I was the one that suggested >> splassert() back in the day when we would continually find issues >> with spl calls. Additionally I found > > SPLASSERT() was almost never used. The only uses that I can find of it > are all in netipsec. > >> doing filesystem work a ton easier with DEBUG_VFS_LOCKS under FreeBSD >> than under Darwin which at the time did not have such a feature. > > This was more useful I think :-). The main reason that SPLASSERT() > was useless was because spl was a stable API that went away at about > the same time that SPLASSERT() was added (SPLASSERT() was implemented > about 6 months before SMPng killed spl). Yes, splassert was a bit of too little too late. -Alfred From owner-svn-src-head@FreeBSD.ORG Sat Dec 15 13:02:03 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 90C58B93; Sat, 15 Dec 2012 13:02:03 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) by mx1.freebsd.org (Postfix) with ESMTP id 06B488FC14; Sat, 15 Dec 2012 13:02:02 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.5/8.14.5) with ESMTP id qBFD1nmd097959; Sat, 15 Dec 2012 17:01:49 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.5/8.14.5/Submit) id qBFD1nRf097958; Sat, 15 Dec 2012 17:01:49 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Sat, 15 Dec 2012 17:01:49 +0400 From: Gleb Smirnoff To: Alfred Perlstein Subject: Re: svn commit: r244112 - head/sys/kern Message-ID: <20121215130149.GB94420@FreeBSD.org> References: <201212110708.qBB78EWx025288@svn.freebsd.org> <50C9271C.70803@mu.org> <20121213090215.GP97487@FreeBSD.org> <201212141149.07671.jhb@freebsd.org> <50CBC285.7060307@mu.org> <20121215161414.V1029@besplex.bde.org> <50CC6E8D.6040707@mu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <50CC6E8D.6040707@mu.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Mailman-Approved-At: Sat, 15 Dec 2012 13:18:30 +0000 Cc: Adrian Chadd , src-committers@FreeBSD.org, John Baldwin , svn-src-all@FreeBSD.org, Alfred Perlstein , Andriy Gapon , Robert Watson , Navdeep Parhar , Bruce Evans , svn-src-head@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 15 Dec 2012 13:02:03 -0000 On Sat, Dec 15, 2012 at 04:35:25AM -0800, Alfred Perlstein wrote: A> People keep beating this drum "all invariants/panics are there for a A> reason", no, some happen to be bugs, and when I'm shipping code to a A> customer, I may need to skip one of these buggy assertions. Yes, if you know any buggy assertions, please remove them from FreeBSD tree. A> Some people have responded to this by saying "alfred show me the buggy A> assertions" to which my response is two fold "firstly, you're calling me A> a liar which I do not appreciate, second prove to me that all the 1000s A> of asserts have zero bugs and are not overly zealous about calling panic." We are not going to prove that. If you claim that some assertion is buggy, you prove that it is buggy and happily remove it from source tree. Noone is going to spend time proving you that 1000s of assertions are not buggy. Home reading for you: http://en.wikipedia.org/wiki/Russell%27s_teapot -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Sat Dec 15 13:29:12 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2520E58E; Sat, 15 Dec 2012 13:29:12 +0000 (UTC) (envelope-from bright@mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id F0ED08FC12; Sat, 15 Dec 2012 13:29:11 +0000 (UTC) Received: from Alfreds-MacBook-Pro-6.local (c-67-180-208-218.hsd1.ca.comcast.net [67.180.208.218]) by elvis.mu.org (Postfix) with ESMTPSA id 1DBF41A3C1B; Sat, 15 Dec 2012 05:29:11 -0800 (PST) Message-ID: <50CC7B26.5000708@mu.org> Date: Sat, 15 Dec 2012 05:29:10 -0800 From: Alfred Perlstein User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Gleb Smirnoff Subject: Re: svn commit: r244112 - head/sys/kern References: <201212110708.qBB78EWx025288@svn.freebsd.org> <50C9271C.70803@mu.org> <20121213090215.GP97487@FreeBSD.org> <201212141149.07671.jhb@freebsd.org> <50CBC285.7060307@mu.org> <20121215161414.V1029@besplex.bde.org> <50CC6E8D.6040707@mu.org> <20121215130149.GB94420@FreeBSD.org> In-Reply-To: <20121215130149.GB94420@FreeBSD.org> Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit Cc: Adrian Chadd , src-committers@FreeBSD.org, John Baldwin , svn-src-all@FreeBSD.org, Andriy Gapon , Navdeep Parhar , svn-src-head@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 15 Dec 2012 13:29:12 -0000 On 12/15/12 5:01 AM, Gleb Smirnoff wrote: > On Sat, Dec 15, 2012 at 04:35:25AM -0800, Alfred Perlstein wrote: > A> People keep beating this drum "all invariants/panics are there for a > A> reason", no, some happen to be bugs, and when I'm shipping code to a > A> customer, I may need to skip one of these buggy assertions. > > Yes, if you know any buggy assertions, please remove them from FreeBSD tree. > > A> Some people have responded to this by saying "alfred show me the buggy > A> assertions" to which my response is two fold "firstly, you're calling me > A> a liar which I do not appreciate, second prove to me that all the 1000s > A> of asserts have zero bugs and are not overly zealous about calling panic." > > We are not going to prove that. If you claim that some assertion is buggy, > you prove that it is buggy and happily remove it from source tree. Noone > is going to spend time proving you that 1000s of assertions are not buggy. > > Home reading for you: > > http://en.wikipedia.org/wiki/Russell%27s_teapot > Here is some reading for you: ------------------------------------------------------------------------ r244044 | adrian | 2012-12-08 17:08:44 -0800 (Sat, 08 Dec 2012) | 10 lines Don't panic if the stageq here is empty; just fall through with NULL pointers and leave the stage queue flush routine to just do nothing (since both head and tail here will be NULL.) This should quieten the "stageq empty" panic where the stageq itself is empty, but it won't fix the second KASSERT() here "staging queue empty" as that's likely a different underlying problem. PR: kern/174283 ------------------------------------------------------------------------ svn diff -r244043:244044 This kassert bug has existed since rev 190579: r190579 | sam | 2009-03-30 14:53:27 -0700 (Mon, 30 Mar 2009) | 25 lines thanks, -Alfred From owner-svn-src-head@FreeBSD.ORG Sat Dec 15 14:18:09 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B0B252C8; Sat, 15 Dec 2012 14:18:09 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) by mx1.freebsd.org (Postfix) with ESMTP id 24EDA8FC18; Sat, 15 Dec 2012 14:18:08 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.5/8.14.5) with ESMTP id qBFEHuHY098221; Sat, 15 Dec 2012 18:17:56 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.5/8.14.5/Submit) id qBFEHtQi098220; Sat, 15 Dec 2012 18:17:55 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Sat, 15 Dec 2012 18:17:55 +0400 From: Gleb Smirnoff To: Alfred Perlstein Subject: Re: svn commit: r244112 - head/sys/kern Message-ID: <20121215141755.GC94420@FreeBSD.org> References: <201212110708.qBB78EWx025288@svn.freebsd.org> <50C9271C.70803@mu.org> <20121213090215.GP97487@FreeBSD.org> <201212141149.07671.jhb@freebsd.org> <50CBC285.7060307@mu.org> <20121215161414.V1029@besplex.bde.org> <50CC6E8D.6040707@mu.org> <20121215130149.GB94420@FreeBSD.org> <50CC7B26.5000708@mu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <50CC7B26.5000708@mu.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Adrian Chadd , src-committers@FreeBSD.org, John Baldwin , svn-src-all@FreeBSD.org, Andriy Gapon , Navdeep Parhar , svn-src-head@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 15 Dec 2012 14:18:09 -0000 On Sat, Dec 15, 2012 at 05:29:10AM -0800, Alfred Perlstein wrote: A> On 12/15/12 5:01 AM, Gleb Smirnoff wrote: A> > On Sat, Dec 15, 2012 at 04:35:25AM -0800, Alfred Perlstein wrote: A> > A> People keep beating this drum "all invariants/panics are there for a A> > A> reason", no, some happen to be bugs, and when I'm shipping code to a A> > A> customer, I may need to skip one of these buggy assertions. A> > A> > Yes, if you know any buggy assertions, please remove them from FreeBSD tree. A> > A> > A> Some people have responded to this by saying "alfred show me the buggy A> > A> assertions" to which my response is two fold "firstly, you're calling me A> > A> a liar which I do not appreciate, second prove to me that all the 1000s A> > A> of asserts have zero bugs and are not overly zealous about calling panic." A> > A> > We are not going to prove that. If you claim that some assertion is buggy, A> > you prove that it is buggy and happily remove it from source tree. Noone A> > is going to spend time proving you that 1000s of assertions are not buggy. A> > A> > Home reading for you: A> > A> > http://en.wikipedia.org/wiki/Russell%27s_teapot A> > A> Here is some reading for you: A> A> ------------------------------------------------------------------------ A> r244044 | adrian | 2012-12-08 17:08:44 -0800 (Sat, 08 Dec 2012) | 10 lines A> A> Don't panic if the stageq here is empty; just fall through with NULL A> pointers and leave the stage queue flush routine to just do nothing A> (since both head and tail here will be NULL.) A> A> This should quieten the "stageq empty" panic where the stageq itself A> is empty, but it won't fix the second KASSERT() here "staging queue empty" A> as that's likely a different underlying problem. A> A> PR: kern/174283 Yes, and important thing is that no one argued against this change, because Adrian explained that this particular assertion was incorrect and removed it. If you know any more incorrect assertions, please remove them as well, and no one will argue about that. But do not switch off all assertions in kernel. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Sat Dec 15 14:48:10 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0C77E702; Sat, 15 Dec 2012 14:48:10 +0000 (UTC) (envelope-from bright@mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id D8EC08FC14; Sat, 15 Dec 2012 14:48:09 +0000 (UTC) Received: from Alfreds-MacBook-Pro-6.local (c-67-180-208-218.hsd1.ca.comcast.net [67.180.208.218]) by elvis.mu.org (Postfix) with ESMTPSA id 07A071A3C29; Sat, 15 Dec 2012 06:48:08 -0800 (PST) Message-ID: <50CC8DA8.3010704@mu.org> Date: Sat, 15 Dec 2012 06:48:08 -0800 From: Alfred Perlstein User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Gleb Smirnoff Subject: Re: svn commit: r244112 - head/sys/kern References: <201212110708.qBB78EWx025288@svn.freebsd.org> <50C9271C.70803@mu.org> <20121213090215.GP97487@FreeBSD.org> <201212141149.07671.jhb@freebsd.org> <50CBC285.7060307@mu.org> <20121215161414.V1029@besplex.bde.org> <50CC6E8D.6040707@mu.org> <20121215130149.GB94420@FreeBSD.org> <50CC7B26.5000708@mu.org> <20121215141755.GC94420@FreeBSD.org> In-Reply-To: <20121215141755.GC94420@FreeBSD.org> Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit Cc: Adrian Chadd , src-committers@FreeBSD.org, John Baldwin , svn-src-all@FreeBSD.org, Andriy Gapon , Navdeep Parhar , svn-src-head@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 15 Dec 2012 14:48:10 -0000 On 12/15/12 6:17 AM, Gleb Smirnoff wrote: > On Sat, Dec 15, 2012 at 05:29:10AM -0800, Alfred Perlstein wrote: > A> On 12/15/12 5:01 AM, Gleb Smirnoff wrote: > A> > On Sat, Dec 15, 2012 at 04:35:25AM -0800, Alfred Perlstein wrote: > A> > A> People keep beating this drum "all invariants/panics are there for a > A> > A> reason", no, some happen to be bugs, and when I'm shipping code to a > A> > A> customer, I may need to skip one of these buggy assertions. > A> > > A> > Yes, if you know any buggy assertions, please remove them from FreeBSD tree. > A> > > A> > A> Some people have responded to this by saying "alfred show me the buggy > A> > A> assertions" to which my response is two fold "firstly, you're calling me > A> > A> a liar which I do not appreciate, second prove to me that all the 1000s > A> > A> of asserts have zero bugs and are not overly zealous about calling panic." > A> > > A> > We are not going to prove that. If you claim that some assertion is buggy, > A> > you prove that it is buggy and happily remove it from source tree. Noone > A> > is going to spend time proving you that 1000s of assertions are not buggy. > A> > > A> > Home reading for you: > A> > > A> > http://en.wikipedia.org/wiki/Russell%27s_teapot > A> > > A> Here is some reading for you: > A> > A> ------------------------------------------------------------------------ > A> r244044 | adrian | 2012-12-08 17:08:44 -0800 (Sat, 08 Dec 2012) | 10 lines > A> > A> Don't panic if the stageq here is empty; just fall through with NULL > A> pointers and leave the stage queue flush routine to just do nothing > A> (since both head and tail here will be NULL.) > A> > A> This should quieten the "stageq empty" panic where the stageq itself > A> is empty, but it won't fix the second KASSERT() here "staging queue empty" > A> as that's likely a different underlying problem. > A> > A> PR: kern/174283 > > Yes, and important thing is that no one argued against this change, because > Adrian explained that this particular assertion was incorrect and removed it. > > If you know any more incorrect assertions, please remove them as well, and > no one will argue about that. But do not switch off all assertions in kernel. > Excuse me? where are the assertions switched off? -Alfred From owner-svn-src-head@FreeBSD.ORG Sat Dec 15 14:59:03 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 11C0C941; Sat, 15 Dec 2012 14:59:03 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id EA2F38FC15; Sat, 15 Dec 2012 14:59:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBFEx2YO082359; Sat, 15 Dec 2012 14:59:02 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBFEx0Ve082342; Sat, 15 Dec 2012 14:59:00 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201212151459.qBFEx0Ve082342@svn.freebsd.org> From: Robert Watson Date: Sat, 15 Dec 2012 14:59:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244265 - in head/contrib/openbsm: . bin/auditdistd config etc sys/bsm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 15 Dec 2012 14:59:03 -0000 Author: rwatson Date: Sat Dec 15 14:59:00 2012 New Revision: 244265 URL: http://svnweb.freebsd.org/changeset/base/244265 Log: Merge OpenBSM 1.2-alpha3 from the vendor branch to 10-CURRENT; this version included various upstreamed patches from the FreeBSD base to make OpenBSM compile more easily with bmake, higher warning levels, clang, and several other loose ends. Obtained from: TrustedBSD Project Modified: head/contrib/openbsm/INSTALL head/contrib/openbsm/NEWS head/contrib/openbsm/VERSION head/contrib/openbsm/bin/auditdistd/auditdistd.conf.5 head/contrib/openbsm/config/config.h head/contrib/openbsm/configure head/contrib/openbsm/configure.ac head/contrib/openbsm/etc/audit_event head/contrib/openbsm/sys/bsm/audit_kevents.h head/contrib/openbsm/sys/bsm/audit_record.h Directory Properties: head/contrib/openbsm/ (props changed) Modified: head/contrib/openbsm/INSTALL ============================================================================== --- head/contrib/openbsm/INSTALL Sat Dec 15 14:45:32 2012 (r244264) +++ head/contrib/openbsm/INSTALL Sat Dec 15 14:59:00 2012 (r244265) @@ -9,8 +9,8 @@ suppport is found. Typical builds will make If doing development work on OpenBSM with gcc, the following invocation of -configure may be preferred in order to generate full compiler warnings and -force the compile to fail if a warning is found: +configure is preferred in order to generate full compiler warnings and force +the compile to fail if a warning is found: CFLAGS="-Wall -Werror" ./configure Modified: head/contrib/openbsm/NEWS ============================================================================== --- head/contrib/openbsm/NEWS Sat Dec 15 14:45:32 2012 (r244264) +++ head/contrib/openbsm/NEWS Sat Dec 15 14:59:00 2012 (r244265) @@ -1,5 +1,11 @@ OpenBSM Version History +OpenBSM 1.2 alpha 3 + +- Various minor tweaks to the auditdistd build to make it fit the FreeBSD + build environment better. +- AUE_WAIT6 merged from FreeBSD 9. + OpenBSM 1.2 alpha 2 - auditdistd, a distributed audit trail management daemon, has now been @@ -489,4 +495,4 @@ OpenBSM 1.0 alpha 1 to support reloading of kernel event table. - Allow comments in /etc/security configuration files. -$P4: //depot/projects/trustedbsd/openbsm/NEWS#53 $ +$P4: //depot/projects/trustedbsd/openbsm/NEWS#55 $ Modified: head/contrib/openbsm/VERSION ============================================================================== --- head/contrib/openbsm/VERSION Sat Dec 15 14:45:32 2012 (r244264) +++ head/contrib/openbsm/VERSION Sat Dec 15 14:59:00 2012 (r244265) @@ -1 +1 @@ -OPENBSM_1_2alpha2 +OPENBSM_1_2_alpha3 Modified: head/contrib/openbsm/bin/auditdistd/auditdistd.conf.5 ============================================================================== --- head/contrib/openbsm/bin/auditdistd/auditdistd.conf.5 Sat Dec 15 14:45:32 2012 (r244264) +++ head/contrib/openbsm/bin/auditdistd/auditdistd.conf.5 Sat Dec 15 14:59:00 2012 (r244265) @@ -355,7 +355,7 @@ receiver { .Xr auditdistd 8 . .Sh AUTHORS The -.Nm -was written by +.Nm auditdistd +was developed by .An Pawel Jakub Dawidek Aq pawel@dawidek.net under sponsorship of the FreeBSD Foundation. Modified: head/contrib/openbsm/config/config.h ============================================================================== --- head/contrib/openbsm/config/config.h Sat Dec 15 14:45:32 2012 (r244264) +++ head/contrib/openbsm/config/config.h Sat Dec 15 14:59:00 2012 (r244265) @@ -235,7 +235,7 @@ #define PACKAGE_NAME "OpenBSM" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "OpenBSM 1.2alpha2" +#define PACKAGE_STRING "OpenBSM 1.2-alpha3" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "openbsm" @@ -244,7 +244,7 @@ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "1.2alpha2" +#define PACKAGE_VERSION "1.2-alpha3" /* Define as the return type of signal handlers (`int' or `void'). */ #define RETSIGTYPE void @@ -280,7 +280,7 @@ #define USE_SYS_ENDIAN_H /**/ /* Version number of package */ -#define VERSION "1.2alpha2" +#define VERSION "1.2-alpha3" /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ Modified: head/contrib/openbsm/configure ============================================================================== --- head/contrib/openbsm/configure Sat Dec 15 14:45:32 2012 (r244264) +++ head/contrib/openbsm/configure Sat Dec 15 14:59:00 2012 (r244265) @@ -1,7 +1,7 @@ #! /bin/sh -# From configure.ac P4: //depot/projects/trustedbsd/openbsm/configure.ac#62 . +# From configure.ac P4: //depot/projects/trustedbsd/openbsm/configure.ac#65 . # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for OpenBSM 1.2alpha2. +# Generated by GNU Autoconf 2.69 for OpenBSM 1.2-alpha3. # # Report bugs to . # @@ -591,8 +591,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='OpenBSM' PACKAGE_TARNAME='openbsm' -PACKAGE_VERSION='1.2alpha2' -PACKAGE_STRING='OpenBSM 1.2alpha2' +PACKAGE_VERSION='1.2-alpha3' +PACKAGE_STRING='OpenBSM 1.2-alpha3' PACKAGE_BUGREPORT='trustedbsd-audit@TrustesdBSD.org' PACKAGE_URL='' @@ -1327,7 +1327,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures OpenBSM 1.2alpha2 to adapt to many kinds of systems. +\`configure' configures OpenBSM 1.2-alpha3 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1397,7 +1397,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of OpenBSM 1.2alpha2:";; + short | recursive ) echo "Configuration of OpenBSM 1.2-alpha3:";; esac cat <<\_ACEOF @@ -1511,7 +1511,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -OpenBSM configure 1.2alpha2 +OpenBSM configure 1.2-alpha3 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1991,7 +1991,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by OpenBSM $as_me 1.2alpha2, which was +It was created by OpenBSM $as_me 1.2-alpha3, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -11552,7 +11552,7 @@ fi # Define the identity of the package. PACKAGE=OpenBSM - VERSION=1.2alpha2 + VERSION=1.2-alpha3 cat >>confdefs.h <<_ACEOF @@ -13559,12 +13559,14 @@ int main () { - bswap16(0); - bswap32(0); - bswap64(0); + int i; + + i = bswap16(0); + i = bswap32(0); + i = bswap64(0); be32enc(NULL, 0); - htole64(0); - le64toh(0); + i = htole64(0); + i = le64toh(0); ; return 0; @@ -14172,7 +14174,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by OpenBSM $as_me 1.2alpha2, which was +This file was extended by OpenBSM $as_me 1.2-alpha3, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -14238,7 +14240,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -OpenBSM config.status 1.2alpha2 +OpenBSM config.status 1.2-alpha3 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Modified: head/contrib/openbsm/configure.ac ============================================================================== --- head/contrib/openbsm/configure.ac Sat Dec 15 14:45:32 2012 (r244264) +++ head/contrib/openbsm/configure.ac Sat Dec 15 14:59:00 2012 (r244265) @@ -2,8 +2,8 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.59) -AC_INIT([OpenBSM], [1.2alpha2], [trustedbsd-audit@TrustesdBSD.org],[openbsm]) -AC_REVISION([$P4: //depot/projects/trustedbsd/openbsm/configure.ac#63 $]) +AC_INIT([OpenBSM], [1.2-alpha3], [trustedbsd-audit@TrustesdBSD.org],[openbsm]) +AC_REVISION([$P4: //depot/projects/trustedbsd/openbsm/configure.ac#66 $]) AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_SRCDIR([bin/auditreduce/auditreduce.c]) AC_CONFIG_AUX_DIR(config) @@ -217,12 +217,14 @@ AC_TRY_LINK([ #endif #include ], [ - bswap16(0); - bswap32(0); - bswap64(0); + int i; + + i = bswap16(0); + i = bswap32(0); + i = bswap64(0); be32enc(NULL, 0); - htole64(0); - le64toh(0); + i = htole64(0); + i = le64toh(0); ], [], [ AC_DEFINE(USE_COMPAT_ENDIAN_ENC_H,, Define if compat/endian_enc.h is required) AC_MSG_RESULT([using compat/endian_enc.h]) Modified: head/contrib/openbsm/etc/audit_event ============================================================================== --- head/contrib/openbsm/etc/audit_event Sat Dec 15 14:45:32 2012 (r244264) +++ head/contrib/openbsm/etc/audit_event Sat Dec 15 14:59:00 2012 (r244265) @@ -1,5 +1,5 @@ # -# $P4: //depot/projects/trustedbsd/openbsm/etc/audit_event#42 $ +# $P4: //depot/projects/trustedbsd/openbsm/etc/audit_event#43 $ # $FreeBSD$ # # The mapping between event identifiers and values is also hard-coded in @@ -562,6 +562,7 @@ 43198:AUE_PDKILL:pdkill(2):pc 43199:AUE_PDGETPID:pdgetpid(2):pc 43200:AUE_PDWAIT:pdwait(2):pc +43201:AUE_WAIT6:wait6(2):pc # # Solaris userspace events. # Modified: head/contrib/openbsm/sys/bsm/audit_kevents.h ============================================================================== --- head/contrib/openbsm/sys/bsm/audit_kevents.h Sat Dec 15 14:45:32 2012 (r244264) +++ head/contrib/openbsm/sys/bsm/audit_kevents.h Sat Dec 15 14:59:00 2012 (r244265) @@ -26,7 +26,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $P4: //depot/projects/trustedbsd/openbsm/sys/bsm/audit_kevents.h#9 $ + * $P4: //depot/projects/trustedbsd/openbsm/sys/bsm/audit_kevents.h#10 $ */ #ifndef _BSM_AUDIT_KEVENTS_H_ @@ -601,6 +601,7 @@ #define AUE_PDKILL 43198 /* FreeBSD. */ #define AUE_PDGETPID 43199 /* FreeBSD. */ #define AUE_PDWAIT 43200 /* FreeBSD. */ +#define AUE_WAIT6 43201 /* FreeBSD. */ /* * Darwin BSM uses a number of AUE_O_* definitions, which are aliased to the Modified: head/contrib/openbsm/sys/bsm/audit_record.h ============================================================================== --- head/contrib/openbsm/sys/bsm/audit_record.h Sat Dec 15 14:45:32 2012 (r244264) +++ head/contrib/openbsm/sys/bsm/audit_record.h Sat Dec 15 14:59:00 2012 (r244265) @@ -26,7 +26,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $P4: //depot/projects/trustedbsd/openbsm/sys/bsm/audit_record.h#10 $ + * $P4: //depot/projects/trustedbsd/openbsm/sys/bsm/audit_record.h#12 $ */ #ifndef _BSM_AUDIT_RECORD_H_ @@ -233,6 +233,7 @@ token_t *au_to_ipc_perm(struct ipc_perm token_t *au_to_iport(uint16_t iport); token_t *au_to_opaque(const char *data, uint16_t bytes); token_t *au_to_path(const char *path); +token_t *au_to_privset(char *privtypestr, char *privstr); token_t *au_to_process(au_id_t auid, uid_t euid, gid_t egid, uid_t ruid, gid_t rgid, pid_t pid, au_asid_t sid, au_tid_t *tid); token_t *au_to_process32(au_id_t auid, uid_t euid, gid_t egid, uid_t ruid, @@ -278,6 +279,7 @@ token_t *au_to_exec_env(char **envp); token_t *au_to_text(const char *text); token_t *au_to_kevent(struct kevent *kev); token_t *au_to_trailer(int rec_size); +token_t *au_to_upriv(char sorf, char *priv); token_t *au_to_zonename(const char *zonename); /* From owner-svn-src-head@FreeBSD.ORG Sat Dec 15 15:21:10 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B67B6234; Sat, 15 Dec 2012 15:21:10 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9AA058FC0A; Sat, 15 Dec 2012 15:21:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBFFLA3r086115; Sat, 15 Dec 2012 15:21:10 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBFFLAVt086110; Sat, 15 Dec 2012 15:21:10 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201212151521.qBFFLAVt086110@svn.freebsd.org> From: Robert Watson Date: Sat, 15 Dec 2012 15:21:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244267 - in head/sys: conf security/audit X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 15 Dec 2012 15:21:10 -0000 Author: rwatson Date: Sat Dec 15 15:21:09 2012 New Revision: 244267 URL: http://svnweb.freebsd.org/changeset/base/244267 Log: Four .c files from OpenBSM are used, in modified form, by the kernel to implement the BSM audit trail format. Rename the kernel versions of the files to match the userspace filenames so that it's easier to work out what they correspond to, and therefore ensure they are kept in-sync. Obtained from: TrustedBSD Project Added: head/sys/security/audit/bsm_domain.c - copied unchanged from r244254, head/sys/security/audit/audit_bsm_domain.c head/sys/security/audit/bsm_errno.c - copied unchanged from r244254, head/sys/security/audit/audit_bsm_errno.c head/sys/security/audit/bsm_fcntl.c - copied unchanged from r244254, head/sys/security/audit/audit_bsm_fcntl.c head/sys/security/audit/bsm_socket_type.c - copied unchanged from r244254, head/sys/security/audit/audit_bsm_socket_type.c head/sys/security/audit/bsm_token.c - copied unchanged from r244254, head/sys/security/audit/audit_bsm_token.c Deleted: head/sys/security/audit/audit_bsm_domain.c head/sys/security/audit/audit_bsm_errno.c head/sys/security/audit/audit_bsm_fcntl.c head/sys/security/audit/audit_bsm_socket_type.c head/sys/security/audit/audit_bsm_token.c Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sat Dec 15 15:01:46 2012 (r244266) +++ head/sys/conf/files Sat Dec 15 15:21:09 2012 (r244267) @@ -3531,16 +3531,16 @@ rpc/rpcsec_gss/svc_rpcsec_gss.c optional security/audit/audit.c optional audit security/audit/audit_arg.c optional audit security/audit/audit_bsm.c optional audit -security/audit/audit_bsm_domain.c optional audit -security/audit/audit_bsm_errno.c optional audit -security/audit/audit_bsm_fcntl.c optional audit security/audit/audit_bsm_klib.c optional audit -security/audit/audit_bsm_socket_type.c optional audit -security/audit/audit_bsm_token.c optional audit security/audit/audit_pipe.c optional audit security/audit/audit_syscalls.c standard security/audit/audit_trigger.c optional audit security/audit/audit_worker.c optional audit +security/audit/bsm_domain.c optional audit +security/audit/bsm_errno.c optional audit +security/audit/bsm_fcntl.c optional audit +security/audit/bsm_socket_type.c optional audit +security/audit/bsm_token.c optional audit security/mac/mac_atalk.c optional mac netatalk security/mac/mac_audit.c optional mac audit security/mac/mac_cred.c optional mac Copied: head/sys/security/audit/bsm_domain.c (from r244254, head/sys/security/audit/audit_bsm_domain.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/security/audit/bsm_domain.c Sat Dec 15 15:21:09 2012 (r244267, copy of r244254, head/sys/security/audit/audit_bsm_domain.c) @@ -0,0 +1,495 @@ +/*- + * Copyright (c) 2008 Apple 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 Apple Inc. ("Apple") 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 APPLE AND ITS 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 APPLE OR ITS 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. + * + * P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_domain.c#3 + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#include + +#include +#include + +struct bsm_domain { + u_short bd_bsm_domain; + int bd_local_domain; +}; + +#define PF_NO_LOCAL_MAPPING -600 + +static const struct bsm_domain bsm_domains[] = { + { BSM_PF_UNSPEC, PF_UNSPEC }, + { BSM_PF_LOCAL, PF_LOCAL }, + { BSM_PF_INET, PF_INET }, + { BSM_PF_IMPLINK, +#ifdef PF_IMPLINK + PF_IMPLINK +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_PUP, +#ifdef PF_PUP + PF_PUP +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_CHAOS, +#ifdef PF_CHAOS + PF_CHAOS +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_NS, +#ifdef PF_NS + PF_NS +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_NBS, +#ifdef PF_NBS + PF_NBS +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_ECMA, +#ifdef PF_ECMA + PF_ECMA +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_DATAKIT, +#ifdef PF_DATAKIT + PF_DATAKIT +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_CCITT, +#ifdef PF_CCITT + PF_CCITT +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_SNA, PF_SNA }, + { BSM_PF_DECnet, PF_DECnet }, + { BSM_PF_DLI, +#ifdef PF_DLI + PF_DLI +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_LAT, +#ifdef PF_LAT + PF_LAT +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_HYLINK, +#ifdef PF_HYLINK + PF_HYLINK +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_APPLETALK, PF_APPLETALK }, + { BSM_PF_NIT, +#ifdef PF_NIT + PF_NIT +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_802, +#ifdef PF_802 + PF_802 +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_OSI, +#ifdef PF_OSI + PF_OSI +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_X25, +#ifdef PF_X25 + PF_X25 +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_OSINET, +#ifdef PF_OSINET + PF_OSINET +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_GOSIP, +#ifdef PF_GOSIP + PF_GOSIP +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_IPX, PF_IPX }, + { BSM_PF_ROUTE, PF_ROUTE }, + { BSM_PF_LINK, +#ifdef PF_LINK + PF_LINK +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_INET6, PF_INET6 }, + { BSM_PF_KEY, PF_KEY }, + { BSM_PF_NCA, +#ifdef PF_NCA + PF_NCA +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_POLICY, +#ifdef PF_POLICY + PF_POLICY +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_INET_OFFLOAD, +#ifdef PF_INET_OFFLOAD + PF_INET_OFFLOAD +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_NETBIOS, +#ifdef PF_NETBIOS + PF_NETBIOS +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_ISO, +#ifdef PF_ISO + PF_ISO +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_XTP, +#ifdef PF_XTP + PF_XTP +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_COIP, +#ifdef PF_COIP + PF_COIP +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_CNT, +#ifdef PF_CNT + PF_CNT +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_RTIP, +#ifdef PF_RTIP + PF_RTIP +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_SIP, +#ifdef PF_SIP + PF_SIP +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_PIP, +#ifdef PF_PIP + PF_PIP +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_ISDN, +#ifdef PF_ISDN + PF_ISDN +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_E164, +#ifdef PF_E164 + PF_E164 +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_NATM, +#ifdef PF_NATM + PF_NATM +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_ATM, +#ifdef PF_ATM + PF_ATM +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_NETGRAPH, +#ifdef PF_NETGRAPH + PF_NETGRAPH +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_SLOW, +#ifdef PF_SLOW + PF_SLOW +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_SCLUSTER, +#ifdef PF_SCLUSTER + PF_SCLUSTER +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_ARP, +#ifdef PF_ARP + PF_ARP +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_BLUETOOTH, +#ifdef PF_BLUETOOTH + PF_BLUETOOTH +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_AX25, +#ifdef PF_AX25 + PF_AX25 +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_ROSE, +#ifdef PF_ROSE + PF_ROSE +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_NETBEUI, +#ifdef PF_NETBEUI + PF_NETBEUI +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_SECURITY, +#ifdef PF_SECURITY + PF_SECURITY +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_PACKET, +#ifdef PF_PACKET + PF_PACKET +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_ASH, +#ifdef PF_ASH + PF_ASH +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_ECONET, +#ifdef PF_ECONET + PF_ECONET +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_ATMSVC, +#ifdef PF_ATMSVC + PF_ATMSVC +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_IRDA, +#ifdef PF_IRDA + PF_IRDA +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_PPPOX, +#ifdef PF_PPPOX + PF_PPPOX +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_WANPIPE, +#ifdef PF_WANPIPE + PF_WANPIPE +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_LLC, +#ifdef PF_LLC + PF_LLC +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_CAN, +#ifdef PF_CAN + PF_CAN +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_TIPC, +#ifdef PF_TIPC + PF_TIPC +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_IUCV, +#ifdef PF_IUCV + PF_IUCV +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_RXRPC, +#ifdef PF_RXRPC + PF_RXRPC +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_PHONET, +#ifdef PF_PHONET + PF_PHONET +#else + PF_NO_LOCAL_MAPPING +#endif + }, +}; +static const int bsm_domains_count = sizeof(bsm_domains) / + sizeof(bsm_domains[0]); + +static const struct bsm_domain * +bsm_lookup_local_domain(int local_domain) +{ + int i; + + for (i = 0; i < bsm_domains_count; i++) { + if (bsm_domains[i].bd_local_domain == local_domain) + return (&bsm_domains[i]); + } + return (NULL); +} + +u_short +au_domain_to_bsm(int local_domain) +{ + const struct bsm_domain *bstp; + + bstp = bsm_lookup_local_domain(local_domain); + if (bstp == NULL) + return (BSM_PF_UNKNOWN); + return (bstp->bd_bsm_domain); +} + +static const struct bsm_domain * +bsm_lookup_bsm_domain(u_short bsm_domain) +{ + int i; + + for (i = 0; i < bsm_domains_count; i++) { + if (bsm_domains[i].bd_bsm_domain == bsm_domain) + return (&bsm_domains[i]); + } + return (NULL); +} + +int +au_bsm_to_domain(u_short bsm_domain, int *local_domainp) +{ + const struct bsm_domain *bstp; + + bstp = bsm_lookup_bsm_domain(bsm_domain); + if (bstp == NULL || bstp->bd_local_domain) + return (-1); + *local_domainp = bstp->bd_local_domain; + return (0); +} Copied: head/sys/security/audit/bsm_errno.c (from r244254, head/sys/security/audit/audit_bsm_errno.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/security/audit/bsm_errno.c Sat Dec 15 15:21:09 2012 (r244267, copy of r244254, head/sys/security/audit/audit_bsm_errno.c) @@ -0,0 +1,775 @@ +/*- + * Copyright (c) 2008 Apple 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 Apple Inc. ("Apple") 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 APPLE AND ITS 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 APPLE OR ITS 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. + * + * P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_errno.c#22 + */ + +#include +__FBSDID("$FreeBSD$"); + +#include + +#include + +#include +#include + +#include + +/* + * Different operating systems use different numeric constants for different + * error numbers, and sometimes error numbers don't exist in more than one + * operating system. These routines convert between BSM and local error + * number spaces, subject to the above realities. BSM error numbers are + * stored in a single 8-bit character, so don't have a byte order. + * + * Don't include string definitions when this code is compiled into a kernel. + */ +struct bsm_errno { + int be_bsm_errno; + int be_local_errno; +#if !defined(KERNEL) && !defined(_KERNEL) + const char *be_strerror; +#endif +}; + +#define ERRNO_NO_LOCAL_MAPPING -600 + +#if !defined(KERNEL) && !defined(_KERNEL) +#define ES(x) x +#else +#define ES(x) +#endif + +/* + * Mapping table -- please maintain in numeric sorted order with respect to + * the BSM constant. Today we do a linear lookup, but could switch to a + * binary search if it makes sense. We only ifdef errors that aren't + * generally available, but it does make the table a lot more ugly. + * + * XXXRW: It would be nice to have a similar ordered table mapping to BSM + * constant from local constant, but the order of local constants varies by + * OS. Really we need to build that table at compile-time but don't do that + * yet. + * + * XXXRW: We currently embed English-language error strings here, but should + * support catalogues; these are only used if the OS doesn't have an error + * string using strerror(3). + */ +static const struct bsm_errno bsm_errnos[] = { + { BSM_ERRNO_ESUCCESS, 0, ES("Success") }, + { BSM_ERRNO_EPERM, EPERM, ES("Operation not permitted") }, + { BSM_ERRNO_ENOENT, ENOENT, ES("No such file or directory") }, + { BSM_ERRNO_ESRCH, ESRCH, ES("No such process") }, + { BSM_ERRNO_EINTR, EINTR, ES("Interrupted system call") }, + { BSM_ERRNO_EIO, EIO, ES("Input/output error") }, + { BSM_ERRNO_ENXIO, ENXIO, ES("Device not configured") }, + { BSM_ERRNO_E2BIG, E2BIG, ES("Argument list too long") }, + { BSM_ERRNO_ENOEXEC, ENOEXEC, ES("Exec format error") }, + { BSM_ERRNO_EBADF, EBADF, ES("Bad file descriptor") }, + { BSM_ERRNO_ECHILD, ECHILD, ES("No child processes") }, + { BSM_ERRNO_EAGAIN, EAGAIN, ES("Resource temporarily unavailable") }, + { BSM_ERRNO_ENOMEM, ENOMEM, ES("Cannot allocate memory") }, + { BSM_ERRNO_EACCES, EACCES, ES("Permission denied") }, + { BSM_ERRNO_EFAULT, EFAULT, ES("Bad address") }, + { BSM_ERRNO_ENOTBLK, ENOTBLK, ES("Block device required") }, + { BSM_ERRNO_EBUSY, EBUSY, ES("Device busy") }, + { BSM_ERRNO_EEXIST, EEXIST, ES("File exists") }, + { BSM_ERRNO_EXDEV, EXDEV, ES("Cross-device link") }, + { BSM_ERRNO_ENODEV, ENODEV, ES("Operation not supported by device") }, + { BSM_ERRNO_ENOTDIR, ENOTDIR, ES("Not a directory") }, + { BSM_ERRNO_EISDIR, EISDIR, ES("Is a directory") }, + { BSM_ERRNO_EINVAL, EINVAL, ES("Invalid argument") }, + { BSM_ERRNO_ENFILE, ENFILE, ES("Too many open files in system") }, + { BSM_ERRNO_EMFILE, EMFILE, ES("Too many open files") }, + { BSM_ERRNO_ENOTTY, ENOTTY, ES("Inappropriate ioctl for device") }, + { BSM_ERRNO_ETXTBSY, ETXTBSY, ES("Text file busy") }, + { BSM_ERRNO_EFBIG, EFBIG, ES("File too large") }, + { BSM_ERRNO_ENOSPC, ENOSPC, ES("No space left on device") }, + { BSM_ERRNO_ESPIPE, ESPIPE, ES("Illegal seek") }, + { BSM_ERRNO_EROFS, EROFS, ES("Read-only file system") }, + { BSM_ERRNO_EMLINK, EMLINK, ES("Too many links") }, + { BSM_ERRNO_EPIPE, EPIPE, ES("Broken pipe") }, + { BSM_ERRNO_EDOM, EDOM, ES("Numerical argument out of domain") }, + { BSM_ERRNO_ERANGE, ERANGE, ES("Result too large") }, + { BSM_ERRNO_ENOMSG, ENOMSG, ES("No message of desired type") }, + { BSM_ERRNO_EIDRM, EIDRM, ES("Identifier removed") }, + { BSM_ERRNO_ECHRNG, +#ifdef ECHRNG + ECHRNG, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES("Channel number out of range") }, + { BSM_ERRNO_EL2NSYNC, +#ifdef EL2NSYNC + EL2NSYNC, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES("Level 2 not synchronized") }, + { BSM_ERRNO_EL3HLT, +#ifdef EL3HLT + EL3HLT, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES("Level 3 halted") }, + { BSM_ERRNO_EL3RST, +#ifdef EL3RST + EL3RST, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES("Level 3 reset") }, + { BSM_ERRNO_ELNRNG, +#ifdef ELNRNG + ELNRNG, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES("Link number out of range") }, + { BSM_ERRNO_EUNATCH, +#ifdef EUNATCH + EUNATCH, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES("Protocol driver not attached") }, + { BSM_ERRNO_ENOCSI, +#ifdef ENOCSI + ENOCSI, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES("No CSI structure available") }, + { BSM_ERRNO_EL2HLT, +#ifdef EL2HLT + EL2HLT, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES("Level 2 halted") }, + { BSM_ERRNO_EDEADLK, EDEADLK, ES("Resource deadlock avoided") }, + { BSM_ERRNO_ENOLCK, ENOLCK, ES("No locks available") }, + { BSM_ERRNO_ECANCELED, ECANCELED, ES("Operation canceled") }, + { BSM_ERRNO_ENOTSUP, ENOTSUP, ES("Operation not supported") }, + { BSM_ERRNO_EDQUOT, EDQUOT, ES("Disc quota exceeded") }, + { BSM_ERRNO_EBADE, +#ifdef EBADE + EBADE, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES("Invalid exchange") }, + { BSM_ERRNO_EBADR, +#ifdef EBADR + EBADR, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES("Invalid request descriptor") }, + { BSM_ERRNO_EXFULL, +#ifdef EXFULL + EXFULL, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES("Exchange full") }, + { BSM_ERRNO_ENOANO, +#ifdef ENOANO + ENOANO, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES("No anode") }, + { BSM_ERRNO_EBADRQC, +#ifdef EBADRQC + EBADRQC, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES("Invalid request descriptor") }, + { BSM_ERRNO_EBADSLT, +#ifdef EBADSLT + EBADSLT, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES("Invalid slot") }, + { BSM_ERRNO_EDEADLOCK, +#ifdef EDEADLOCK + EDEADLOCK, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES("Resource deadlock avoided") }, + { BSM_ERRNO_EBFONT, +#ifdef EBFONT + EBFONT, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES("Bad font file format") }, + { BSM_ERRNO_EOWNERDEAD, +#ifdef EOWNERDEAD + EOWNERDEAD, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES("Process died with the lock") }, + { BSM_ERRNO_ENOTRECOVERABLE, +#ifdef ENOTRECOVERABLE + ENOTRECOVERABLE, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES("Lock is not recoverable") }, + { BSM_ERRNO_ENOSTR, +#ifdef ENOSTR + ENOSTR, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES("Device not a stream") }, + { BSM_ERRNO_ENONET, +#ifdef ENONET + ENONET, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES("Machine is not on the network") }, + { BSM_ERRNO_ENOPKG, +#ifdef ENOPKG + ENOPKG, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES("Package not installed") }, + { BSM_ERRNO_EREMOTE, EREMOTE, + ES("Too many levels of remote in path") }, + { BSM_ERRNO_ENOLINK, +#ifdef ENOLINK + ENOLINK, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES("Link has been severed") }, + { BSM_ERRNO_EADV, +#ifdef EADV + EADV, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES("Advertise error") }, + { BSM_ERRNO_ESRMNT, +#ifdef ESRMNT + ESRMNT, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES("srmount error") }, + { BSM_ERRNO_ECOMM, +#ifdef ECOMM + ECOMM, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES("Communication error on send") }, + { BSM_ERRNO_EPROTO, +#ifdef EPROTO + EPROTO, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES("Protocol error") }, + { BSM_ERRNO_ELOCKUNMAPPED, +#ifdef ELOCKUNMAPPED + ELOCKUNMAPPED, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES("Locked lock was unmapped") }, + { BSM_ERRNO_ENOTACTIVE, +#ifdef ENOTACTIVE + ENOTACTIVE, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES("Facility is not active") }, + { BSM_ERRNO_EMULTIHOP, +#ifdef EMULTIHOP + EMULTIHOP, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES("Multihop attempted") }, + { BSM_ERRNO_EBADMSG, +#ifdef EBADMSG + EBADMSG, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES("Bad message") }, + { BSM_ERRNO_ENAMETOOLONG, ENAMETOOLONG, ES("File name too long") }, + { BSM_ERRNO_EOVERFLOW, EOVERFLOW, + ES("Value too large to be stored in data type") }, + { BSM_ERRNO_ENOTUNIQ, +#ifdef ENOTUNIQ + ENOTUNIQ, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES("Given log name not unique") }, + { BSM_ERRNO_EBADFD, +#ifdef EBADFD + EBADFD, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES("Given f.d. invalid for this operation") }, + { BSM_ERRNO_EREMCHG, +#ifdef EREMCHG + EREMCHG, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES("Remote address changed") }, + { BSM_ERRNO_ELIBACC, +#ifdef ELIBACC + ELIBACC, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES("Can't access a needed shared lib") }, + { BSM_ERRNO_ELIBBAD, +#ifdef ELIBBAD + ELIBBAD, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES("Accessing a corrupted shared lib") }, + { BSM_ERRNO_ELIBSCN, +#ifdef ELIBSCN + ELIBSCN, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES(".lib section in a.out corrupted") }, + { BSM_ERRNO_ELIBMAX, +#ifdef ELIBMAX + ELIBMAX, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES("Attempting to link in too many libs") }, + { BSM_ERRNO_ELIBEXEC, +#ifdef ELIBEXEC + ELIBEXEC, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES("Attempting to exec a shared library") }, + { BSM_ERRNO_EILSEQ, EILSEQ, ES("Illegal byte sequence") }, + { BSM_ERRNO_ENOSYS, ENOSYS, ES("Function not implemented") }, + { BSM_ERRNO_ELOOP, ELOOP, ES("Too many levels of symbolic links") }, + { BSM_ERRNO_ERESTART, +#ifdef ERESTART + ERESTART, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES("Restart syscall") }, + { BSM_ERRNO_ESTRPIPE, +#ifdef ESTRPIPE + ESTRPIPE, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES("If pipe/FIFO, don't sleep in stream head") }, + { BSM_ERRNO_ENOTEMPTY, ENOTEMPTY, ES("Directory not empty") }, + { BSM_ERRNO_EUSERS, EUSERS, ES("Too many users") }, + { BSM_ERRNO_ENOTSOCK, ENOTSOCK, + ES("Socket operation on non-socket") }, + { BSM_ERRNO_EDESTADDRREQ, EDESTADDRREQ, + ES("Destination address required") }, + { BSM_ERRNO_EMSGSIZE, EMSGSIZE, ES("Message too long") }, + { BSM_ERRNO_EPROTOTYPE, EPROTOTYPE, + ES("Protocol wrong type for socket") }, + { BSM_ERRNO_ENOPROTOOPT, ENOPROTOOPT, ES("Protocol not available") }, + { BSM_ERRNO_EPROTONOSUPPORT, EPROTONOSUPPORT, + ES("Protocol not supported") }, + { BSM_ERRNO_ESOCKTNOSUPPORT, ESOCKTNOSUPPORT, + ES("Socket type not supported") }, + { BSM_ERRNO_EOPNOTSUPP, EOPNOTSUPP, ES("Operation not supported") }, + { BSM_ERRNO_EPFNOSUPPORT, EPFNOSUPPORT, + ES("Protocol family not supported") }, + { BSM_ERRNO_EAFNOSUPPORT, EAFNOSUPPORT, + ES("Address family not supported by protocol family") }, + { BSM_ERRNO_EADDRINUSE, EADDRINUSE, ES("Address already in use") }, + { BSM_ERRNO_EADDRNOTAVAIL, EADDRNOTAVAIL, + ES("Can't assign requested address") }, + { BSM_ERRNO_ENETDOWN, ENETDOWN, ES("Network is down") }, + { BSM_ERRNO_ENETRESET, ENETRESET, + ES("Network dropped connection on reset") }, + { BSM_ERRNO_ECONNABORTED, ECONNABORTED, + ES("Software caused connection abort") }, + { BSM_ERRNO_ECONNRESET, ECONNRESET, ES("Connection reset by peer") }, + { BSM_ERRNO_ENOBUFS, ENOBUFS, ES("No buffer space available") }, + { BSM_ERRNO_EISCONN, EISCONN, ES("Socket is already connected") }, + { BSM_ERRNO_ENOTCONN, ENOTCONN, ES("Socket is not connected") }, + { BSM_ERRNO_ESHUTDOWN, ESHUTDOWN, + ES("Can't send after socket shutdown") }, + { BSM_ERRNO_ETOOMANYREFS, ETOOMANYREFS, + ES("Too many references: can't splice") }, + { BSM_ERRNO_ETIMEDOUT, ETIMEDOUT, ES("Operation timed out") }, + { BSM_ERRNO_ECONNREFUSED, ECONNREFUSED, ES("Connection refused") }, + { BSM_ERRNO_EHOSTDOWN, EHOSTDOWN, ES("Host is down") }, + { BSM_ERRNO_EHOSTUNREACH, EHOSTUNREACH, ES("No route to host") }, + { BSM_ERRNO_EALREADY, EALREADY, ES("Operation already in progress") }, + { BSM_ERRNO_EINPROGRESS, EINPROGRESS, + ES("Operation now in progress") }, + { BSM_ERRNO_ESTALE, ESTALE, ES("Stale NFS file handle") }, + { BSM_ERRNO_EPROCLIM, +#ifdef EPROCLIM + EPROCLIM, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES("Too many processes") }, + { BSM_ERRNO_EBADRPC, +#ifdef EBADRPC + EBADRPC, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES("RPC struct is bad") }, + { BSM_ERRNO_ERPCMISMATCH, +#ifdef ERPCMISMATCH + ERPCMISMATCH, +#else *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sat Dec 15 17:19:37 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A3C6F43D; Sat, 15 Dec 2012 17:19:37 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 87F8E8FC0A; Sat, 15 Dec 2012 17:19:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBFHJbWX003554; Sat, 15 Dec 2012 17:19:37 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBFHJbj1003553; Sat, 15 Dec 2012 17:19:37 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201212151719.qBFHJbj1003553@svn.freebsd.org> From: Mikolaj Golub Date: Sat, 15 Dec 2012 17:19:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244268 - head/sys/netpfil/pf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 15 Dec 2012 17:19:37 -0000 Author: trociny Date: Sat Dec 15 17:19:36 2012 New Revision: 244268 URL: http://svnweb.freebsd.org/changeset/base/244268 Log: In pfioctl, if the permission checks failed we returned with vnet context set. As the checks don't require vnet context, this is fixed by setting vnet after the checks. PR: kern/160541 Submitted by: Nikos Vassiliadis (slightly different approach) Modified: head/sys/netpfil/pf/pf_ioctl.c Modified: head/sys/netpfil/pf/pf_ioctl.c ============================================================================== --- head/sys/netpfil/pf/pf_ioctl.c Sat Dec 15 15:21:09 2012 (r244267) +++ head/sys/netpfil/pf/pf_ioctl.c Sat Dec 15 17:19:36 2012 (r244268) @@ -963,8 +963,6 @@ pfioctl(struct cdev *dev, u_long cmd, ca { int error = 0; - CURVNET_SET(TD_TO_VNET(td)); - /* XXX keep in sync with switch() below */ if (securelevel_gt(td->td_ucred, 2)) switch (cmd) { @@ -1068,6 +1066,8 @@ pfioctl(struct cdev *dev, u_long cmd, ca return (EACCES); } + CURVNET_SET(TD_TO_VNET(td)); + switch (cmd) { case DIOCSTART: PF_RULES_WLOCK(); From owner-svn-src-head@FreeBSD.ORG Sat Dec 15 17:54:30 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0C96DD51; Sat, 15 Dec 2012 17:54:30 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C9F878FC13; Sat, 15 Dec 2012 17:54:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBFHsTDL008580; Sat, 15 Dec 2012 17:54:29 GMT (envelope-from phk@svn.freebsd.org) Received: (from phk@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBFHsT5D008579; Sat, 15 Dec 2012 17:54:29 GMT (envelope-from phk@svn.freebsd.org) Message-Id: <201212151754.qBFHsT5D008579@svn.freebsd.org> From: Poul-Henning Kamp Date: Sat, 15 Dec 2012 17:54:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244269 - head/tools/tools/sysbuild X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 15 Dec 2012 17:54:30 -0000 Author: phk Date: Sat Dec 15 17:54:29 2012 New Revision: 244269 URL: http://svnweb.freebsd.org/changeset/base/244269 Log: Update to the new and brighter pkg world Modified: head/tools/tools/sysbuild/sysbuild.sh Modified: head/tools/tools/sysbuild/sysbuild.sh ============================================================================== --- head/tools/tools/sysbuild/sysbuild.sh Sat Dec 15 17:19:36 2012 (r244268) +++ head/tools/tools/sysbuild/sysbuild.sh Sat Dec 15 17:54:29 2012 (r244269) @@ -225,37 +225,49 @@ ports_build() ( # Now build & install them for p in `cat /tmp/_.plist` do + b=`echo $p | tr / _` t=`echo $p | sed 's,/usr/ports/,,'` pn=`cd $p && make package-name` - if [ "x${PKG_DIR}" != "x" -a -f ${PKG_DIR}/$pn.tbz ] ; then - if [ "x$use_pkg" = "x-p" ] ; then - log_it "install $p from ${PKG_DIR}/$pn.tbz" - pkg_add ${PKG_DIR}/$pn.tbz - fi + + if pkg info $pn > /dev/null 2>&1 ; then + log_it "Already installed: $t ($pn)" + continue fi - i=`pkg_info -qO $t` - if [ -z "$i" ] ; then - log_it "build $p" - b=`echo $p | tr / _` + + if [ "x$p" == "x/usr/ports/ports-mgmt/pkg" ] ; then + log_it "Very Special: $t ($pn)" ( - set -x - cd /usr/ports - cd $p - set +e - make clean ${PORTS_OPTS} - if make install ${PORTS_OPTS} ; then - if [ "x${PKG_DIR}" != "x" ] ; then - make package ${PORTS_OPTS} - mkdir -p ${PKG_DIR} - mv *.tbz ${PKG_DIR} - fi - else - log_it FAIL build $p - fi - make clean + cd $p + make clean all install ${PORTS_OPTS} ) > _.$b 2>&1 < /dev/null - date + continue + fi + + if [ "x${PKG_DIR}" != "x" -a -f ${PKG_DIR}/$pn.txz ] ; then + if [ "x$use_pkg" = "x-p" ] ; then + log_it "Install $t ($pn)" + ( + set +e + pkg add ${PKG_DIR}/$pn.txz || true + ) > _.$b 2>&1 < /dev/null + continue + fi fi + + log_it "build $pn ($p)" + ( + set +e + cd $p + make clean ${PORTS_OPTS} + if make install ${PORTS_OPTS} ; then + if [ "x${PKG_DIR}" != "x" ] ; then + make package ${PORTS_OPTS} + fi + else + log_it FAIL build $p + fi + make clean + ) > _.$b 2>&1 < /dev/null done ) @@ -463,7 +475,7 @@ export PORTS_OPTS ####################################################################### log_it Prepare destination partition -newfs -O2 -U /dev/${TARGET_PART} > /dev/null +newfs -t -E -O2 -U /dev/${TARGET_PART} > /dev/null mount /dev/${TARGET_PART} ${SBMNT} mkdir -p ${SBMNT}/dev mount -t devfs devfs ${SBMNT}/dev @@ -564,7 +576,7 @@ sed "/[ ]\/[ ]/s;^[^ ]*[ ];/dev/${TA /etc/fstab > ${SBMNT}/etc/fstab log_it build ports -pwd + cp $0 ${SBMNT}/root cp /tmp/_sb_log ${SBMNT}/tmp b=`basename $0` From owner-svn-src-head@FreeBSD.ORG Sat Dec 15 18:08:38 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C20A346E; Sat, 15 Dec 2012 18:08:38 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-pa0-f54.google.com (mail-pa0-f54.google.com [209.85.220.54]) by mx1.freebsd.org (Postfix) with ESMTP id 79BB18FC16; Sat, 15 Dec 2012 18:08:38 +0000 (UTC) Received: by mail-pa0-f54.google.com with SMTP id bi5so2827979pad.13 for ; Sat, 15 Dec 2012 10:08:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; bh=17dSUo+uexAJLnOWu/y1IqEk5jHb/Gx9hH35ud5LYcE=; b=D093P63QXoiC+TcdqcCoH1nThQ1M9zfvB5SQWp2EJ8aelu2kv1ehiFezFVC6ooATIb bWwEcX71EPN1CTx3qpZb1IKGuYRP10v55JEsK22Pdeu7W3qwW4jAmbMICV0gZ4yGM4DR NJoOIVYqnLsQYZXJ2QNsNP2jYM+M33pICKJVjyl0X8MHBloN2EsMih1WWJ8aGq9DDXTl 3U5DInvr1slqzGyhqzagYXKZAITJ7bLmLGpMTo1cQRlvC90BELIeRcoxwwOREyik9w97 uwJhrczK0BGtwQf0oVSAsWXB694JZBbUFMs6Ncf2Ig+r5/OxD6xi8L/dWLqfn5U9K66T riyw== Received: by 10.68.242.38 with SMTP id wn6mr26979755pbc.28.1355594917682; Sat, 15 Dec 2012 10:08:37 -0800 (PST) Received: from [192.168.20.11] (c-24-19-191-56.hsd1.wa.comcast.net. [24.19.191.56]) by mx.google.com with ESMTPS id vs3sm5045988pbc.61.2012.12.15.10.08.32 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 15 Dec 2012 10:08:35 -0800 (PST) Subject: Re: svn commit: r244269 - head/tools/tools/sysbuild Mime-Version: 1.0 (Apple Message framework v1283) Content-Type: text/plain; charset=us-ascii From: Garrett Cooper In-Reply-To: <201212151754.qBFHsT5D008579@svn.freebsd.org> Date: Sat, 15 Dec 2012 10:08:30 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: <7855873A-AC30-4511-AA9B-F9B0E380FF92@gmail.com> References: <201212151754.qBFHsT5D008579@svn.freebsd.org> To: Poul-Henning Kamp X-Mailer: Apple Mail (2.1283) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 15 Dec 2012 18:08:38 -0000 On Dec 15, 2012, at 9:54 AM, Poul-Henning Kamp wrote: > Author: phk > Date: Sat Dec 15 17:54:29 2012 > New Revision: 244269 > URL: http://svnweb.freebsd.org/changeset/base/244269 >=20 > Log: > Update to the new and brighter pkg world If you have a ports tree, setting the appropriate variables and = then running make check-already-installed is both forwards and backwards = compatible. HTH, -Garrett= From owner-svn-src-head@FreeBSD.ORG Sat Dec 15 18:19:49 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D6387DA2; Sat, 15 Dec 2012 18:19:49 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AF6C38FC12; Sat, 15 Dec 2012 18:19:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBFIJnMT012849; Sat, 15 Dec 2012 18:19:49 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBFIJnQ9012845; Sat, 15 Dec 2012 18:19:49 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201212151819.qBFIJnQ9012845@svn.freebsd.org> From: Mikolaj Golub Date: Sat, 15 Dec 2012 18:19:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244270 - head/lib/libdevstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 15 Dec 2012 18:19:50 -0000 Author: trociny Date: Sat Dec 15 18:19:48 2012 New Revision: 244270 URL: http://svnweb.freebsd.org/changeset/base/244270 Log: New devstat metrics for devstat_compute_statistics(): DSM_TOTAL_DURATION DSM_TOTAL_DURATION_READ DSM_TOTAL_DURATION_WRITE DSM_TOTAL_DURATION_FREE DSM_TOTAL_DURATION_OTHER DSM_TOTAL_BUSY_TIME Modified: head/lib/libdevstat/devstat.3 head/lib/libdevstat/devstat.c head/lib/libdevstat/devstat.h Modified: head/lib/libdevstat/devstat.3 ============================================================================== --- head/lib/libdevstat/devstat.3 Sat Dec 15 17:54:29 2012 (r244269) +++ head/lib/libdevstat/devstat.3 Sat Dec 15 18:19:48 2012 (r244270) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 18, 2003 +.Dd December 15, 2012 .Dt DEVSTAT 3 .Os .Sh NAME @@ -526,6 +526,35 @@ the acquisition of .Fa previous and .Fa current . +.It Dv DSM_TOTAL_DURATION +type: +.Vt "long double *" +.Pp +The total duration of transactions, in seconds, between the acquisition of +.Fa previous +and +.Fa current . +.It Dv DSM_TOTAL_DURATION_OTHER +.It Dv DSM_TOTAL_DURATION_READ +.It Dv DSM_TOTAL_DURATION_WRITE +.It Dv DSM_TOTAL_DURATION_FREE +type: +.Vt "long double *" +.Pp +The total duration of transactions of the specified type between +the acquisition of +.Fa previous +and +.Fa current . +.It Dv DSM_TOTAL_BUSY_TIME +type: +.Vt "long double *" +.Pp +Total time the device had one or more transactions outstanding +between the acquisition of +.Fa previous +and +.Fa current . .It Dv DSM_TOTAL_BLOCKS type: .Vt "uint64_t *" Modified: head/lib/libdevstat/devstat.c ============================================================================== --- head/lib/libdevstat/devstat.c Sat Dec 15 17:54:29 2012 (r244269) +++ head/lib/libdevstat/devstat.c Sat Dec 15 18:19:48 2012 (r244270) @@ -133,6 +133,12 @@ struct devstat_args { { DSM_MS_PER_TRANSACTION_FREE, DEVSTAT_ARG_LD }, { DSM_BUSY_PCT, DEVSTAT_ARG_LD }, { DSM_QUEUE_LENGTH, DEVSTAT_ARG_UINT64 }, + { DSM_TOTAL_DURATION, DEVSTAT_ARG_LD }, + { DSM_TOTAL_DURATION_READ, DEVSTAT_ARG_LD }, + { DSM_TOTAL_DURATION_WRITE, DEVSTAT_ARG_LD }, + { DSM_TOTAL_DURATION_FREE, DEVSTAT_ARG_LD }, + { DSM_TOTAL_DURATION_OTHER, DEVSTAT_ARG_LD }, + { DSM_TOTAL_BUSY_TIME, DEVSTAT_ARG_LD }, }; static const char *namelist[] = { @@ -1217,11 +1223,13 @@ devstat_compute_statistics(struct devsta u_int64_t totaltransfers, totaltransfersread, totaltransferswrite; u_int64_t totaltransfersother, totalblocks, totalblocksread; u_int64_t totalblockswrite, totaltransfersfree, totalblocksfree; + long double totalduration, totaldurationread, totaldurationwrite; + long double totaldurationfree, totaldurationother; va_list ap; devstat_metric metric; u_int64_t *destu64; long double *destld; - int retval, i; + int retval; retval = 0; @@ -1263,6 +1271,13 @@ devstat_compute_statistics(struct devsta totalblocksfree /= 512; } + totaldurationread = DELTA_T(duration[DEVSTAT_READ]); + totaldurationwrite = DELTA_T(duration[DEVSTAT_WRITE]); + totaldurationfree = DELTA_T(duration[DEVSTAT_FREE]); + totaldurationother = DELTA_T(duration[DEVSTAT_NO_DATA]); + totalduration = totaldurationread + totaldurationwrite + + totaldurationfree + totaldurationother; + va_start(ap, etime); while ((metric = (devstat_metric)va_arg(ap, devstat_metric)) != 0) { @@ -1484,9 +1499,7 @@ devstat_compute_statistics(struct devsta */ case DSM_MS_PER_TRANSACTION: if (totaltransfers > 0) { - *destld = 0; - for (i = 0; i < DEVSTAT_N_TRANS_FLAGS; i++) - *destld += DELTA_T(duration[i]); + *destld = totalduration; *destld /= totaltransfers; *destld *= 1000; } else @@ -1499,7 +1512,7 @@ devstat_compute_statistics(struct devsta */ case DSM_MS_PER_TRANSACTION_READ: if (totaltransfersread > 0) { - *destld = DELTA_T(duration[DEVSTAT_READ]); + *destld = totaldurationread; *destld /= totaltransfersread; *destld *= 1000; } else @@ -1507,7 +1520,7 @@ devstat_compute_statistics(struct devsta break; case DSM_MS_PER_TRANSACTION_WRITE: if (totaltransferswrite > 0) { - *destld = DELTA_T(duration[DEVSTAT_WRITE]); + *destld = totaldurationwrite; *destld /= totaltransferswrite; *destld *= 1000; } else @@ -1515,7 +1528,7 @@ devstat_compute_statistics(struct devsta break; case DSM_MS_PER_TRANSACTION_FREE: if (totaltransfersfree > 0) { - *destld = DELTA_T(duration[DEVSTAT_FREE]); + *destld = totaldurationfree; *destld /= totaltransfersfree; *destld *= 1000; } else @@ -1523,7 +1536,7 @@ devstat_compute_statistics(struct devsta break; case DSM_MS_PER_TRANSACTION_OTHER: if (totaltransfersother > 0) { - *destld = DELTA_T(duration[DEVSTAT_NO_DATA]); + *destld = totaldurationother; *destld /= totaltransfersother; *destld *= 1000; } else @@ -1541,6 +1554,24 @@ devstat_compute_statistics(struct devsta case DSM_QUEUE_LENGTH: *destu64 = current->start_count - current->end_count; break; + case DSM_TOTAL_DURATION: + *destld = totalduration; + break; + case DSM_TOTAL_DURATION_READ: + *destld = totaldurationread; + break; + case DSM_TOTAL_DURATION_WRITE: + *destld = totaldurationwrite; + break; + case DSM_TOTAL_DURATION_FREE: + *destld = totaldurationfree; + break; + case DSM_TOTAL_DURATION_OTHER: + *destld = totaldurationother; + break; + case DSM_TOTAL_BUSY_TIME: + *destld = DELTA_T(busy_time); + break; /* * XXX: comment out the default block to see if any case's are missing. */ Modified: head/lib/libdevstat/devstat.h ============================================================================== --- head/lib/libdevstat/devstat.h Sat Dec 15 17:54:29 2012 (r244269) +++ head/lib/libdevstat/devstat.h Sat Dec 15 18:19:48 2012 (r244270) @@ -97,6 +97,12 @@ typedef enum { DSM_MS_PER_TRANSACTION_FREE, DSM_BUSY_PCT, DSM_QUEUE_LENGTH, + DSM_TOTAL_DURATION, + DSM_TOTAL_DURATION_READ, + DSM_TOTAL_DURATION_WRITE, + DSM_TOTAL_DURATION_FREE, + DSM_TOTAL_DURATION_OTHER, + DSM_TOTAL_BUSY_TIME, DSM_MAX } devstat_metric; From owner-svn-src-head@FreeBSD.ORG Sat Dec 15 18:21:10 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D182BF4C; Sat, 15 Dec 2012 18:21:10 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B71758FC0A; Sat, 15 Dec 2012 18:21:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBFILA8c013126; Sat, 15 Dec 2012 18:21:10 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBFILAOP013123; Sat, 15 Dec 2012 18:21:10 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201212151821.qBFILAOP013123@svn.freebsd.org> From: Mikolaj Golub Date: Sat, 15 Dec 2012 18:21:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244271 - head/usr.sbin/iostat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 15 Dec 2012 18:21:11 -0000 Author: trociny Date: Sat Dec 15 18:21:09 2012 New Revision: 244271 URL: http://svnweb.freebsd.org/changeset/base/244271 Log: Change `iostat -Ix` to display total duration of transactions instead of average duration, and total busy time instead of %. This looks more useful when one runs `iostat -Ix` periodically to collect statistics: e.g. now it is possible to calculate busy % between two runs subtracting total busy times and dividing per time period. Average duration and % busy are still available via `iostat -x`. Modified: head/usr.sbin/iostat/iostat.8 head/usr.sbin/iostat/iostat.c Modified: head/usr.sbin/iostat/iostat.8 ============================================================================== --- head/usr.sbin/iostat/iostat.8 Sat Dec 15 18:19:48 2012 (r244270) +++ head/usr.sbin/iostat/iostat.8 Sat Dec 15 18:21:09 2012 (r244271) @@ -56,7 +56,7 @@ .\" .\" @(#)iostat.8 8.1 (Berkeley) 6/6/93 .\" -.Dd November 24, 2010 +.Dd December 15, 2012 .Dt IOSTAT 8 .Os .Sh NAME @@ -366,6 +366,32 @@ average duration of transactions, in mil % of time the device had one or more outstanding transactions .El .Pp +The extended +.Nm +device display, with the +.Fl x +and +.Fl I +flags specified, shows the following statistics: +.Pp +.Bl -tag -width indent -compact +.It r/i +read operations per time period +.It w/i +write operations per time period +.It kr/i +kilobytes read per time period +.It kw/i +kilobytes write per time period +.It qlen +transactions queue length +.It tsvc_t/i +total duration of transactions per time period, in seconds +.It sb/i +total time the device had one or more outstanding transactions per +time period, in seconds +.El +.Pp The old-style .Nm display (using Modified: head/usr.sbin/iostat/iostat.c ============================================================================== --- head/usr.sbin/iostat/iostat.c Sat Dec 15 18:19:48 2012 (r244270) +++ head/usr.sbin/iostat/iostat.c Sat Dec 15 18:21:09 2012 (r244271) @@ -731,10 +731,10 @@ devstats(int perf_select, long double et u_int64_t total_bytes, total_transfers, total_blocks; u_int64_t total_bytes_read, total_transfers_read; u_int64_t total_bytes_write, total_transfers_write; - long double busy_pct; + long double busy_pct, busy_time; u_int64_t queue_len; long double total_mb; - long double blocks_per_second, ms_per_transaction; + long double blocks_per_second, ms_per_transaction, total_duration; int firstline = 1; char *devname; @@ -745,14 +745,13 @@ devstats(int perf_select, long double et if (Cflag > 0) printf(" cpu "); printf("\n"); - if (Iflag == 0) - printf( - "device r/s w/s kr/s kw/s qlen svc_t %%b " - ); - else - printf( - "device r/i w/i kr/i kw/i qlen svc_t %%b " - ); + if (Iflag == 0) { + printf("device r/s w/s kr/s kw/s qlen " + "svc_t %%b "); + } else { + printf("device r/i w/i kr/i" + " kw/i qlen tsvc_t/i sb/i "); + } if (Tflag > 0) printf("tin tout "); if (Cflag > 0) @@ -789,6 +788,8 @@ devstats(int perf_select, long double et DSM_MS_PER_TRANSACTION, &ms_per_transaction, DSM_BUSY_PCT, &busy_pct, DSM_QUEUE_LENGTH, &queue_len, + DSM_TOTAL_DURATION, &total_duration, + DSM_TOTAL_BUSY_TIME, &busy_time, DSM_NONE) != 0) errx(1, "%s", devstat_errbuf); @@ -827,7 +828,9 @@ devstats(int perf_select, long double et queue_len, ms_per_transaction, busy_pct); else - printf("%-8.8s %5.1Lf %5.1Lf %7.1Lf %7.1Lf %4" PRIu64 " %5.1Lf %3.0Lf ", + printf("%-8.8s %11.1Lf %11.1Lf " + "%12.1Lf %12.1Lf %4" PRIu64 + " %10.1Lf %9.1Lf ", devname, (long double)total_transfers_read, (long double)total_transfers_write, @@ -836,7 +839,7 @@ devstats(int perf_select, long double et (long double) total_bytes_write / 1024, queue_len, - ms_per_transaction, busy_pct); + total_duration, busy_time); if (firstline) { /* * If this is the first device From owner-svn-src-head@FreeBSD.ORG Sat Dec 15 18:24:38 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5645A1F7; Sat, 15 Dec 2012 18:24:38 +0000 (UTC) (envelope-from phk@phk.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.freebsd.org (Postfix) with ESMTP id EB3A48FC0C; Sat, 15 Dec 2012 18:24:37 +0000 (UTC) Received: from critter.freebsd.dk (unknown [192.168.61.101]) by phk.freebsd.dk (Postfix) with ESMTP id 2E6EE89EAF; Sat, 15 Dec 2012 18:24:31 +0000 (UTC) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.14.5/8.14.5) with ESMTP id qBFIOUwl039008; Sat, 15 Dec 2012 18:24:30 GMT (envelope-from phk@phk.freebsd.dk) To: Garrett Cooper Subject: Re: svn commit: r244269 - head/tools/tools/sysbuild In-reply-to: <7855873A-AC30-4511-AA9B-F9B0E380FF92@gmail.com> From: "Poul-Henning Kamp" References: <201212151754.qBFHsT5D008579@svn.freebsd.org> <7855873A-AC30-4511-AA9B-F9B0E380FF92@gmail.com> Date: Sat, 15 Dec 2012 18:24:30 +0000 Message-ID: <39007.1355595870@critter.freebsd.dk> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 15 Dec 2012 18:24:38 -0000 -------- In message <7855873A-AC30-4511-AA9B-F9B0E380FF92@gmail.com>, Garrett Cooper wri tes: > If you have a ports tree, setting the appropriate variables and >then running make check-already-installed is both forwards and backwards >compatible. Uhm, I'm not sure I understand how this would apply to sysbuild, which constructs an disk-image from scratch... -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. From owner-svn-src-head@FreeBSD.ORG Sat Dec 15 18:45:54 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9F03B71F; Sat, 15 Dec 2012 18:45:54 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-da0-f54.google.com (mail-da0-f54.google.com [209.85.210.54]) by mx1.freebsd.org (Postfix) with ESMTP id 594648FC13; Sat, 15 Dec 2012 18:45:54 +0000 (UTC) Received: by mail-da0-f54.google.com with SMTP id n2so1848918dad.13 for ; Sat, 15 Dec 2012 10:45:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; bh=wLxk4uZaWhxwF9eb9hWTzbTk1S+gdkiVhl+6wpFxe3M=; b=O4/EZDyVbGuRZxBvywQCLoMViri3EMIO8hD0+CwHNWPJc34wqIAW+43+A+M3lRCYxY htvLZoQMjNCEIydYDTBxSeoJGxvGJdsmJtOzxTa4x9ZDi/CvT6xhQ+YZNCcWAmocBLaH bVztc5qfv/Y0ftwPiS7Yh9vJBtNfm5OVYb3h+GWtumQrFFMrPzH9KPNtLnWZDbS59vT1 5DmoQsv2tAfM53N9fhulR1rcUlEAupUfFaYYgsQLvduxEGow6syQ+wV+o4ycjLYT5b+5 An6B4f2JUgD4oOtPfitk4idShBmRvAfAH/wU+YK86/9CFT7ok+sUeJAqk/3LedcwQTAR 8mAw== Received: by 10.66.78.168 with SMTP id c8mr8568288pax.16.1355597148261; Sat, 15 Dec 2012 10:45:48 -0800 (PST) Received: from [192.168.20.11] (c-24-19-191-56.hsd1.wa.comcast.net. [24.19.191.56]) by mx.google.com with ESMTPS id rk17sm5101566pbb.3.2012.12.15.10.45.46 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 15 Dec 2012 10:45:47 -0800 (PST) Subject: Re: svn commit: r244269 - head/tools/tools/sysbuild Mime-Version: 1.0 (Apple Message framework v1283) Content-Type: text/plain; charset=us-ascii From: Garrett Cooper In-Reply-To: <39007.1355595870@critter.freebsd.dk> Date: Sat, 15 Dec 2012 10:45:44 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: <72791331-4C62-4ACD-ADB1-94A109647032@gmail.com> References: <201212151754.qBFHsT5D008579@svn.freebsd.org> <7855873A-AC30-4511-AA9B-F9B0E380FF92@gmail.com> <39007.1355595870@critter.freebsd.dk> To: "Poul-Henning Kamp" X-Mailer: Apple Mail (2.1283) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 15 Dec 2012 18:45:54 -0000 On Dec 15, 2012, at 10:24 AM, Poul-Henning Kamp wrote: > -------- > In message <7855873A-AC30-4511-AA9B-F9B0E380FF92@gmail.com>, Garrett = Cooper wri > tes: >=20 >> If you have a ports tree, setting the appropriate variables and=20= >> then running make check-already-installed is both forwards and = backwards=20 >> compatible. >=20 > Uhm, I'm not sure I understand how this would apply to sysbuild, which > constructs an disk-image from scratch... You're checking whether or not the package has been installed on the = running system via `pkg info`. I discovered (after poking around = bsd.port.mk a bit for other things) that `make check-already-installed` = in the ports directory is an equivalent backwards compatible way of = doing this (again, setting PORTSDIR, PKGDBDIR, etc to the right values). = Example: # for i in shells/bash shells/zsh; do (cd /usr/ports/$i; make = check-already-installed; echo ec =3D $?); done =3D=3D=3D> Checking if shells/bash already installed =3D=3D=3D> bash-4.2.37 is already installed You may wish to ``make deinstall'' and install this port again by ``make reinstall'' to upgrade it properly. If you really wish to overwrite the old port of shells/bash without deleting it first, set the variable "FORCE_PKG_REGISTER" in your environment or the "make install" command line. *** Error code 1 Stop. make: stopped in /usr/ports/shells/bash ec =3D 1 =3D=3D=3D> Checking if shells/zsh already installed ec =3D 0 All you have to do is test for the exit code being non-zero (already = installed) or zero (not installed). It's unfortunate that things are = flip-flopped, but I understand the reason for it being that way in the = make rules. Also, your last commit snuck in a =3D=3D instead of a =3D -- this breaks = on older copies of /bin/sh . HTH, -Garrett PS Just trying to help make sure things are backwards compatible because = there are random people who have reported breakage issues in the past = with various tools like nanobsd, picobsd, etc that aren't tied to a = particular release.= From owner-svn-src-head@FreeBSD.ORG Sat Dec 15 20:04:25 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 64392669; Sat, 15 Dec 2012 20:04:25 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 433628FC12; Sat, 15 Dec 2012 20:04:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBFK4Pwd027938; Sat, 15 Dec 2012 20:04:25 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBFK4Oo7027935; Sat, 15 Dec 2012 20:04:24 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201212152004.qBFK4Oo7027935@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Sat, 15 Dec 2012 20:04:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244272 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 15 Dec 2012 20:04:25 -0000 Author: ae Date: Sat Dec 15 20:04:24 2012 New Revision: 244272 URL: http://svnweb.freebsd.org/changeset/base/244272 Log: In additional to the tailq of IPv6 addresses add the hash table. For now use 256 buckets and fnv_hash function. Use xor'ed 32-bit s6_addr32 parts of in6_addr structure as a hash key. Update in6_localip and in6_is_addr_deprecated to use hash table for fastest lookup. Sponsored by: Yandex LLC Discussed with: dwmalone, glebius, bz Modified: head/sys/netinet6/in6.c head/sys/netinet6/in6_var.h head/sys/netinet6/ip6_input.c Modified: head/sys/netinet6/in6.c ============================================================================== --- head/sys/netinet6/in6.c Sat Dec 15 18:21:09 2012 (r244271) +++ head/sys/netinet6/in6.c Sat Dec 15 20:04:24 2012 (r244272) @@ -1149,6 +1149,8 @@ in6_update_ifa(struct ifnet *ifp, struct ifa_ref(&ia->ia_ifa); /* in6_ifaddrhead */ IN6_IFADDR_WLOCK(); TAILQ_INSERT_TAIL(&V_in6_ifaddrhead, ia, ia_link); + LIST_INSERT_HEAD(IN6ADDR_HASH(&ifra->ifra_addr.sin6_addr), + ia, ia6_hash); IN6_IFADDR_WUNLOCK(); } @@ -1534,6 +1536,7 @@ in6_unlink_ifa(struct in6_ifaddr *ia, st */ IN6_IFADDR_WLOCK(); TAILQ_REMOVE(&V_in6_ifaddrhead, ia, ia_link); + LIST_REMOVE(ia, ia6_hash); IN6_IFADDR_WUNLOCK(); /* @@ -2083,7 +2086,7 @@ in6_localip(struct in6_addr *in6) struct in6_ifaddr *ia; IN6_IFADDR_RLOCK(); - TAILQ_FOREACH(ia, &V_in6_ifaddrhead, ia_link) { + LIST_FOREACH(ia, IN6ADDR_HASH(in6), ia6_hash) { if (IN6_ARE_ADDR_EQUAL(in6, &ia->ia_addr.sin6_addr)) { IN6_IFADDR_RUNLOCK(); return (1); @@ -2093,22 +2096,20 @@ in6_localip(struct in6_addr *in6) return (0); } - int in6_is_addr_deprecated(struct sockaddr_in6 *sa6) { struct in6_ifaddr *ia; IN6_IFADDR_RLOCK(); - TAILQ_FOREACH(ia, &V_in6_ifaddrhead, ia_link) { - if (IN6_ARE_ADDR_EQUAL(&ia->ia_addr.sin6_addr, - &sa6->sin6_addr) && - (ia->ia6_flags & IN6_IFF_DEPRECATED) != 0) { - IN6_IFADDR_RUNLOCK(); - return (1); /* true */ + LIST_FOREACH(ia, IN6ADDR_HASH(&sa6->sin6_addr), ia6_hash) { + if (IN6_ARE_ADDR_EQUAL(IA6_IN6(ia), &sa6->sin6_addr)) { + if (ia->ia6_flags & IN6_IFF_DEPRECATED) { + IN6_IFADDR_RUNLOCK(); + return (1); /* true */ + } + break; } - - /* XXX: do we still have to go thru the rest of the list? */ } IN6_IFADDR_RUNLOCK(); Modified: head/sys/netinet6/in6_var.h ============================================================================== --- head/sys/netinet6/in6_var.h Sat Dec 15 18:21:09 2012 (r244271) +++ head/sys/netinet6/in6_var.h Sat Dec 15 20:04:24 2012 (r244272) @@ -67,6 +67,7 @@ #include #ifdef _KERNEL +#include #include #endif @@ -131,10 +132,13 @@ struct in6_ifaddr { /* multicast addresses joined from the kernel */ LIST_HEAD(, in6_multi_mship) ia6_memberships; + /* entry in bucket of inet6 addresses */ + LIST_ENTRY(in6_ifaddr) ia6_hash; }; /* List of in6_ifaddr's. */ TAILQ_HEAD(in6_ifaddrhead, in6_ifaddr); +LIST_HEAD(in6_ifaddrlisthead, in6_ifaddr); /* control structure to manage address selection policy */ struct in6_addrpolicy { @@ -499,7 +503,27 @@ struct in6_rrenumreq { #ifdef _KERNEL VNET_DECLARE(struct in6_ifaddrhead, in6_ifaddrhead); +VNET_DECLARE(struct in6_ifaddrlisthead *, in6_ifaddrhashtbl); +VNET_DECLARE(u_long, in6_ifaddrhmask); #define V_in6_ifaddrhead VNET(in6_ifaddrhead) +#define V_in6_ifaddrhashtbl VNET(in6_ifaddrhashtbl) +#define V_in6_ifaddrhmask VNET(in6_ifaddrhmask) + +#define IN6ADDR_NHASH_LOG2 8 +#define IN6ADDR_NHASH (1 << IN6ADDR_NHASH_LOG2) +#define IN6ADDR_HASHVAL(x) (in6_addrhash(x)) +#define IN6ADDR_HASH(x) \ + (&V_in6_ifaddrhashtbl[IN6ADDR_HASHVAL(x) & V_in6_ifaddrhmask]) + +static __inline uint32_t +in6_addrhash(struct in6_addr *in6) +{ + uint32_t x; + + x = in6->s6_addr32[0] ^ in6->s6_addr32[1] ^ in6->s6_addr32[2] ^ + in6->s6_addr32[3]; + return (fnv_32_buf(&x, sizeof(x), FNV1_32_INIT)); +} extern struct rwlock in6_ifaddr_lock; #define IN6_IFADDR_LOCK_ASSERT( ) rw_assert(&in6_ifaddr_lock, RA_LOCKED) Modified: head/sys/netinet6/ip6_input.c ============================================================================== --- head/sys/netinet6/ip6_input.c Sat Dec 15 18:21:09 2012 (r244271) +++ head/sys/netinet6/ip6_input.c Sat Dec 15 20:04:24 2012 (r244272) @@ -126,6 +126,8 @@ extern struct domain inet6domain; u_char ip6_protox[IPPROTO_MAX]; VNET_DEFINE(struct in6_ifaddrhead, in6_ifaddrhead); +VNET_DEFINE(struct in6_ifaddrlisthead *, in6_ifaddrhashtbl); +VNET_DEFINE(u_long, in6_ifaddrhmask); static struct netisr_handler ip6_nh = { .nh_name = "ip6", @@ -170,6 +172,8 @@ ip6_init(void) TUNABLE_INT_FETCH("net.inet6.ip6.no_radr", &V_ip6_no_radr); TAILQ_INIT(&V_in6_ifaddrhead); + V_in6_ifaddrhashtbl = hashinit(IN6ADDR_NHASH, M_IFADDR, + &V_in6_ifaddrhmask); /* Initialize packet filter hooks. */ V_inet6_pfil_hook.ph_type = PFIL_TYPE_AF; @@ -297,6 +301,7 @@ void ip6_destroy() { + hashdestroy(V_in6_ifaddrhashtbl, M_IFADDR, V_in6_ifaddrhmask); nd6_destroy(); callout_drain(&V_in6_tmpaddrtimer_ch); } From owner-svn-src-head@FreeBSD.ORG Sat Dec 15 20:50:30 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2C7C31D8; Sat, 15 Dec 2012 20:50:30 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (garage.dawidek.net [91.121.88.72]) by mx1.freebsd.org (Postfix) with ESMTP id 840B68FC0A; Sat, 15 Dec 2012 20:50:28 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id 4F3F1B76; Sat, 15 Dec 2012 21:48:23 +0100 (CET) Date: Sat, 15 Dec 2012 21:52:03 +0100 From: Pawel Jakub Dawidek To: Navdeep Parhar Subject: Re: svn commit: r244112 - head/sys/kern Message-ID: <20121215205202.GF1411@garage.freebsd.pl> References: <201212110708.qBB78EWx025288@svn.freebsd.org> <201212121046.43706.jhb@freebsd.org> <201212121658.49048.jhb@freebsd.org> <50C90567.8080406@FreeBSD.org> <50C909BD.9090709@mu.org> <50C91B32.4080904@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="jkO+KyKz7TfD21mV" Content-Disposition: inline In-Reply-To: <50C91B32.4080904@FreeBSD.org> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Adrian Chadd , Alfred Perlstein , John Baldwin , svn-src-all@FreeBSD.org, Alfred Perlstein , Andriy Gapon , src-committers@FreeBSD.org, svn-src-head@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 15 Dec 2012 20:50:30 -0000 --jkO+KyKz7TfD21mV Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Dec 12, 2012 at 04:02:58PM -0800, Navdeep Parhar wrote: > On 12/12/12 14:48, Alfred Perlstein wrote: > > On 12/12/12 2:29 PM, Andriy Gapon wrote: > >> Now we get a new middle-ground: get both worse performance (because > >> KASSERTs are compiled in) and a risk of harming your data (because > >> KASSERTs no longer panic). The upside: there is no panic! There's just > >> a log message (or etc). and chance to get more log messages because > >> the insanity propagates. And a chance to lose your data (your > >> customer's) - but I've already mentioned this. I am not sure that I > >> like this kind of middle-ground.=20 > > I have a number of points here: > >=20 > > The most important one being: > > 1) without kassert you would still have the bug, just that it would be > > unreported. > > The upside: there is no panic! There's **NO** log message (or etc). > > and chance to get more log messages because the insanity propagates. > >=20 > > Terrible! > >=20 > > Let me explain that again: > > If you don't compile in KASSERT, then it's not like the condition is > > never going to happen. Instead it will just be unreported. >=20 > A KASSERT() really is for a condition that should never happen. It is > primarily useful during development and testing (and when the code is > reworked or redesigned). I agree with Andriy here -- a non-fatal assert > shouldn't really exist. I have sort of mixed feelings about this change, but in reality we have three cases: 1. Fatal conditions that shouldn't happen, but may happen for some reason and we definiately want to stop running (corrupted file system metadata that can mess up the file system more badly). For those we have direct panic(9) calls. 2. Fatal conditions that cannot happen and for those we have KASSERT(9). 3. Non-fatal conditions that cannot happen, which we have no way to report more gracefully and we do it through KASSERT(9). It is annoying to run INVARIANTS kernel and trigger 3. I had this problem few times, for example in TCP/IP stack. It turned out to be non-fatal and KASSERT(9) was there to understand the code better. I'd much prefer to see it logged than to panic my box. Of course it is also sometimes hard to judge if it is fatal or not. I use plenty of assertions in my code to catch bugs early, but assertions like any other part of the code might have bugs and during rapid development they help a lot when the code around is changing a lot and some earlier assumptions are no longer valid. Many of those assertions are non-fatal. For me this problem is pretty complex, because: 1. It would be nice to have a macro to test non-fatal conditions, but it is hard to tell sometimes if it is fatal or not. This macro could be also used when code is hard to understand and it needs some special workload to really figure out if something is possible or not. 2. Buggy assertions can be used for DoS attack. Lack of assertions can be used for much worse problems. 3. Logging non-fatal "assertions" might make them go unnoticed, but we currently don't enable kernel dumps by default, so when panic occurs user has no idea what has happend, especially if he is in X. Logging would give better chance to actually notice the problem currently. 4. We develop using HEAD, which can have bugs, also buggy assertions and it is annoying to trigger assertions not in your code when you try to work on something. But I'm talking here about test boxes, on my laptop I'd probably prefer panic too often than too rarely and corrupt my system. In my opinion we should do the following: 1. Leave the option to make KASSERTs non-fatal, but log big fat warning that this is development feature and should not be used in production. 2. Introduce handy macro that would log the problem, but won't panic the box for non-fatal conditions, just like we do with LORs. 3. Enable kernel dumps by default. The main obstacle to do that was lack of a way to limit number of kernel dumps, which could lead to filling /var/ after hitting some panic/reboot cycle. My contribution to solve this is implementation of 3: http://people.freebsd.org/~pjd/patches/savecore.patch The first two should be easy to do. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --jkO+KyKz7TfD21mV Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlDM4vIACgkQForvXbEpPzQXLgCeLch1lhyOcSZdeleToPhoRe2/ 588AoOCn0RN1zNo2+8p242SCNIO7z2pG =oVGw -----END PGP SIGNATURE----- --jkO+KyKz7TfD21mV-- From owner-svn-src-head@FreeBSD.ORG Sat Dec 15 20:56:46 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5B0AF684; Sat, 15 Dec 2012 20:56:46 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (garage.dawidek.net [91.121.88.72]) by mx1.freebsd.org (Postfix) with ESMTP id 0C3738FC18; Sat, 15 Dec 2012 20:56:45 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id C185CB7D; Sat, 15 Dec 2012 21:54:40 +0100 (CET) Date: Sat, 15 Dec 2012 21:58:21 +0100 From: Pawel Jakub Dawidek To: Adrian Chadd Subject: Re: svn commit: r244112 - head/sys/kern Message-ID: <20121215205821.GG1411@garage.freebsd.pl> References: <201212110708.qBB78EWx025288@svn.freebsd.org> <201212121046.43706.jhb@freebsd.org> <201212121658.49048.jhb@freebsd.org> <50C90567.8080406@FreeBSD.org> <50C909BD.9090709@mu.org> <50C91B32.4080904@FreeBSD.org> <50C91CD3.7030900@mu.org> <50C9206D.6080502@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="jt0yj30bxbg11sci" Content-Disposition: inline In-Reply-To: X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: src-committers@freebsd.org, John Baldwin , Alfred Perlstein , svn-src-all@freebsd.org, Alfred Perlstein , Andriy Gapon , Navdeep Parhar , svn-src-head@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 15 Dec 2012 20:56:46 -0000 --jt0yj30bxbg11sci Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Dec 12, 2012 at 04:41:45PM -0800, Adrian Chadd wrote: > If a kassert is inviolable, then make it a panic() and include in the > default kernel. It is inviolable. We don't include it in default kernel as panic for performance reasons, but it doesn't mean it can happen. If it happens it is unexpected condition that is most likely not handled at all. We use plain panic(9) in places that should not but can eventually happen for reasons out of our control. For example if you are running in VM and someone is corruption your disk image as you run. We do want to detect it as quickly as possible. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --jt0yj30bxbg11sci Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlDM5G0ACgkQForvXbEpPzTtJwCdHp1eSsxHlvwtlJUfuqcNWOZQ DFIAoIhM3SjQp8p3/cFu2xFCwheDy3Yd =gnDn -----END PGP SIGNATURE----- --jt0yj30bxbg11sci-- From owner-svn-src-head@FreeBSD.ORG Sat Dec 15 21:01:58 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AD6AC876; Sat, 15 Dec 2012 21:01:58 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (garage.dawidek.net [91.121.88.72]) by mx1.freebsd.org (Postfix) with ESMTP id 5E6A98FC17; Sat, 15 Dec 2012 21:01:58 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id 4A65DB87; Sat, 15 Dec 2012 21:59:53 +0100 (CET) Date: Sat, 15 Dec 2012 22:03:34 +0100 From: Pawel Jakub Dawidek To: Alfred Perlstein Subject: Re: svn commit: r244112 - head/sys/kern Message-ID: <20121215210333.GH1411@garage.freebsd.pl> References: <201212110708.qBB78EWx025288@svn.freebsd.org> <201212121046.43706.jhb@freebsd.org> <201212121658.49048.jhb@freebsd.org> <50C90567.8080406@FreeBSD.org> <50C909BD.9090709@mu.org> <50C91B32.4080904@FreeBSD.org> <50C91CD3.7030900@mu.org> <50C9206D.6080502@FreeBSD.org> <50C9271C.70803@mu.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="lrvsYIebpInmECXG" Content-Disposition: inline In-Reply-To: <50C9271C.70803@mu.org> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Adrian Chadd , src-committers@FreeBSD.org, John Baldwin , svn-src-all@FreeBSD.org, Alfred Perlstein , Andriy Gapon , Navdeep Parhar , svn-src-head@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 15 Dec 2012 21:01:58 -0000 --lrvsYIebpInmECXG Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Dec 12, 2012 at 04:53:48PM -0800, Alfred Perlstein wrote: > Like what if I do gzipp'd kernel dumps next? (on my todo list) How many= =20 > people will complain that "gzip is too dangerous in kernel context foo=20 > foo!!!!" >=20 > Not sure, I guess I'll find out? Well... :) savecore(8) has an option to compress the dumps. The only use case for compressing-while-dumping I see is small swap/dump partition. I'm not against this change, but I would not use it myself. When you are dumping your kernel is in undefined state, so the less code you execute in that state the higher chances your dump will succeed. I much prefer to either compress the dumps with savecore(8) or use ZFS dataset with compression enabled for /var/crash/. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --lrvsYIebpInmECXG Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlDM5aUACgkQForvXbEpPzTYUQCffdIM0UphsgrI6l2OrcYCnKfF ftQAoI5hra1A2f4Rn5tJclT1nmoJi7c3 =5xrR -----END PGP SIGNATURE----- --lrvsYIebpInmECXG-- From owner-svn-src-head@FreeBSD.ORG Sat Dec 15 21:06:14 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CEFFECE3; Sat, 15 Dec 2012 21:06:14 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B2E018FC15; Sat, 15 Dec 2012 21:06:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBFL6ESC036982; Sat, 15 Dec 2012 21:06:14 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBFL6E43036979; Sat, 15 Dec 2012 21:06:14 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201212152106.qBFL6E43036979@svn.freebsd.org> From: Andrew Turner Date: Sat, 15 Dec 2012 21:06:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244273 - head/contrib/gcc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 15 Dec 2012 21:06:14 -0000 Author: andrew Date: Sat Dec 15 21:06:14 2012 New Revision: 244273 URL: http://svnweb.freebsd.org/changeset/base/244273 Log: Fix a comment in an asm block to work with compilers other than GCC Modified: head/contrib/gcc/longlong.h Modified: head/contrib/gcc/longlong.h ============================================================================== --- head/contrib/gcc/longlong.h Sat Dec 15 20:04:24 2012 (r244272) +++ head/contrib/gcc/longlong.h Sat Dec 15 21:06:14 2012 (r244273) @@ -205,7 +205,7 @@ UDItype __umulsidi3 (USItype, USItype); "rI" ((USItype) (bl)) __CLOBBER_CC) #define umul_ppmm(xh, xl, a, b) \ {register USItype __t0, __t1, __t2; \ - __asm__ ("%@ Inlined umul_ppmm\n" \ + __asm__ ("/* Inlined umul_ppmm */\n" \ " mov %2, %5, lsr #16\n" \ " mov %0, %6, lsr #16\n" \ " bic %3, %5, %2, lsl #16\n" \ From owner-svn-src-head@FreeBSD.ORG Sat Dec 15 21:12:14 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id ADCA1FD3; Sat, 15 Dec 2012 21:12:14 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 92AD28FC16; Sat, 15 Dec 2012 21:12:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBFLCETl038355; Sat, 15 Dec 2012 21:12:14 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBFLCEVo038354; Sat, 15 Dec 2012 21:12:14 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201212152112.qBFLCEVo038354@svn.freebsd.org> From: Andrew Turner Date: Sat, 15 Dec 2012 21:12:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244274 - head/contrib/binutils/gas/config X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 15 Dec 2012 21:12:14 -0000 Author: andrew Date: Sat Dec 15 21:12:13 2012 New Revision: 244274 URL: http://svnweb.freebsd.org/changeset/base/244274 Log: Recognise vfpv2 as a value for the ARM .fpu asm directive. Clang generates these even when building soft floating-point code Submitted by: Daisuke Aoyama Modified: head/contrib/binutils/gas/config/tc-arm.c Modified: head/contrib/binutils/gas/config/tc-arm.c ============================================================================== --- head/contrib/binutils/gas/config/tc-arm.c Sat Dec 15 21:06:14 2012 (r244273) +++ head/contrib/binutils/gas/config/tc-arm.c Sat Dec 15 21:12:13 2012 (r244274) @@ -20107,6 +20107,7 @@ static const struct arm_option_cpu_value {"softvfp", FPU_ARCH_VFP}, {"softvfp+vfp", FPU_ARCH_VFP_V2}, {"vfp", FPU_ARCH_VFP_V2}, + {"vfpv2", FPU_ARCH_VFP_V2}, {"vfp9", FPU_ARCH_VFP_V2}, {"vfp3", FPU_ARCH_VFP_V3}, {"vfpv3", FPU_ARCH_VFP_V3}, From owner-svn-src-head@FreeBSD.ORG Sat Dec 15 21:24:32 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 539C29B6; Sat, 15 Dec 2012 21:24:32 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 37AC48FC1E; Sat, 15 Dec 2012 21:24:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBFLOWYI040209; Sat, 15 Dec 2012 21:24:32 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBFLOWDO040208; Sat, 15 Dec 2012 21:24:32 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201212152124.qBFLOWDO040208@svn.freebsd.org> From: Andrew Turner Date: Sat, 15 Dec 2012 21:24:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244276 - head/contrib/gcc/config/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 15 Dec 2012 21:24:32 -0000 Author: andrew Date: Sat Dec 15 21:24:31 2012 New Revision: 244276 URL: http://svnweb.freebsd.org/changeset/base/244276 Log: Don't define CTORS_SECTION_ASM_OP and DTORS_SECTION_ASM_OP on arm when built with clang. When these are defined the lists are defined similar to: asm(".section .ctors"); STATIC func_ptr __CTOR_LIST__[1] = { (func_ptr) (-1) }; asm(".section .dtors"); STATIC func_ptr __DTOR_LIST__[1] = { (func_ptr) (-1) }; The problem is clang will move the two arrays out of the .ctors and .dtors sections causing these sections to contain a single null address. By not defining these macros we use the version of the code that places the arrays is their sections by using __attribute__((section(".ctors"))) and similar for .dtors. Submitted by: Daisuke Aoyama Modified: head/contrib/gcc/config/arm/arm.h Modified: head/contrib/gcc/config/arm/arm.h ============================================================================== --- head/contrib/gcc/config/arm/arm.h Sat Dec 15 21:15:43 2012 (r244275) +++ head/contrib/gcc/config/arm/arm.h Sat Dec 15 21:24:31 2012 (r244276) @@ -1866,8 +1866,10 @@ typedef struct # define DTOR_LIST_BEGIN asm (ARM_EABI_DTORS_SECTION_OP) # define DTOR_LIST_END /* empty */ # else /* !defined (__ARM_EABI__) */ +# ifndef __clang__ # define CTORS_SECTION_ASM_OP ARM_CTORS_SECTION_OP # define DTORS_SECTION_ASM_OP ARM_DTORS_SECTION_OP +# endif # endif /* !defined (__ARM_EABI__) */ #endif /* !defined (IN_LIBCC2) */ From owner-svn-src-head@FreeBSD.ORG Sat Dec 15 21:33:13 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 36684D05; Sat, 15 Dec 2012 21:33:13 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1A9488FC13; Sat, 15 Dec 2012 21:33:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBFLXCD2041379; Sat, 15 Dec 2012 21:33:12 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBFLXCMA041378; Sat, 15 Dec 2012 21:33:12 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201212152133.qBFLXCMA041378@svn.freebsd.org> From: Andrew Turner Date: Sat, 15 Dec 2012 21:33:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244277 - head/gnu/usr.bin/binutils/as X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 15 Dec 2012 21:33:13 -0000 Author: andrew Date: Sat Dec 15 21:33:12 2012 New Revision: 244277 URL: http://svnweb.freebsd.org/changeset/base/244277 Log: Also remove -Werror on arm with clang as there are warnings. Modified: head/gnu/usr.bin/binutils/as/Makefile Modified: head/gnu/usr.bin/binutils/as/Makefile ============================================================================== --- head/gnu/usr.bin/binutils/as/Makefile Sat Dec 15 21:24:31 2012 (r244276) +++ head/gnu/usr.bin/binutils/as/Makefile Sat Dec 15 21:33:12 2012 (r244277) @@ -8,7 +8,7 @@ .PATH: ${SRCDIR}/gas ${SRCDIR}/gas/config -.if ${TARGET_ARCH} == "powerpc64" +.if ${TARGET} == "arm" || ${TARGET_ARCH} == "powerpc64" NO_WERROR.clang= .endif From owner-svn-src-head@FreeBSD.ORG Sat Dec 15 21:35:12 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7E06CE7B; Sat, 15 Dec 2012 21:35:12 +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 6C6CC8FC0A; Sat, 15 Dec 2012 21:35:10 +0000 (UTC) Received: from porto.starpoint.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 XAA10491; Sat, 15 Dec 2012 23:35:02 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1TjzNu-00024L-Cs; Sat, 15 Dec 2012 23:35:02 +0200 Message-ID: <50CCED04.1000101@FreeBSD.org> Date: Sat, 15 Dec 2012 23:35:00 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Pawel Jakub Dawidek Subject: Re: svn commit: r244112 - head/sys/kern References: <201212110708.qBB78EWx025288@svn.freebsd.org> <201212121046.43706.jhb@freebsd.org> <201212121658.49048.jhb@freebsd.org> <50C90567.8080406@FreeBSD.org> <50C909BD.9090709@mu.org> <50C91B32.4080904@FreeBSD.org> <50C91CD3.7030900@mu.org> <50C9206D.6080502@FreeBSD.org> <50C9271C.70803@mu.org> <20121215210333.GH1411@garage.freebsd.pl> In-Reply-To: <20121215210333.GH1411@garage.freebsd.pl> X-Enigmail-Version: 1.4.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Adrian Chadd , Alfred Perlstein , John Baldwin , svn-src-all@FreeBSD.org, Alfred Perlstein , src-committers@FreeBSD.org, Navdeep Parhar , svn-src-head@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 15 Dec 2012 21:35:12 -0000 on 15/12/2012 23:03 Pawel Jakub Dawidek said the following: > On Wed, Dec 12, 2012 at 04:53:48PM -0800, Alfred Perlstein wrote: >> Like what if I do gzipp'd kernel dumps next? (on my todo list) How many >> people will complain that "gzip is too dangerous in kernel context foo >> foo!!!!" >> >> Not sure, I guess I'll find out? > > Well... :) savecore(8) has an option to compress the dumps. The only use > case for compressing-while-dumping I see is small swap/dump partition. I'm > not against this change, but I would not use it myself. When you are > dumping your kernel is in undefined state, so the less code you execute in > that state the higher chances your dump will succeed. I much prefer to > either compress the dumps with savecore(8) or use ZFS dataset with > compression enabled for /var/crash/. Actually compressing core is a good thing when done right. It can speed up the core dumping process in addition to requiring less space. -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Sat Dec 15 21:41:53 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DCDF0F8 for ; Sat, 15 Dec 2012 21:41:53 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id 530BA8FC13 for ; Sat, 15 Dec 2012 21:41:52 +0000 (UTC) Received: by mail-la0-f54.google.com with SMTP id j13so3701035lah.13 for ; Sat, 15 Dec 2012 13:41:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=GcOgCH1cONqHFa4a6EVgVnbTRzcSL5cm4FlySe+/9OE=; b=XB+XXgBEDe0k+tsLgIdObFfuPCOvBDoBEs1J8IVshxhiphukQ3LLabzIfyYSCY5CsD uJqwwy6q3elH9KtCzR0bgbPLTOU4htCi83h+ZbVCEcYY+7IqpARxRzCz7FUBnKiqTRK2 liRX+0cLRPf0/03kvdH85v91Rr1GynCdOE95E= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :x-gm-message-state; bh=GcOgCH1cONqHFa4a6EVgVnbTRzcSL5cm4FlySe+/9OE=; b=fdXUOuO7i0BjmRTdy3BJdCuaDJHxt4pJI6VKgXO/0t7mn1RqHs00NWzojVNLR306n4 BIbUbyJL8LqZQJv3pF0VRF4PU2xxt0d/YN8eolrOvof39cRZ5NhThfaT53lzTbFvezoo xWRrYzR6dYCL4n4VI2bwWmerEScMtU7Hqxtm40pYdoKonX28vNI/PjAvRiBetvM2FBnW 21baP88V0hqUb9K8Z5XmmGFwlX4IL2Kppq4HorhSJmXYjs/clpapDj2ScoQkdCTN5YwC CMK1szfNDP3zXONHaRq+y2bE/9G6y67udhape1NIl5Fvm+KWXW4ylUqlNCi6xfs0zho7 CY7w== Received: by 10.152.125.136 with SMTP id mq8mr6513183lab.41.1355607712149; Sat, 15 Dec 2012 13:41:52 -0800 (PST) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.112.149.225 with HTTP; Sat, 15 Dec 2012 13:41:22 -0800 (PST) In-Reply-To: <201212152133.qBFLXCMA041378@svn.freebsd.org> References: <201212152133.qBFLXCMA041378@svn.freebsd.org> From: Eitan Adler Date: Sat, 15 Dec 2012 16:41:22 -0500 X-Google-Sender-Auth: pkF0QRoN3ianLTpclSKkAaX0ioY Message-ID: Subject: Re: svn commit: r244277 - head/gnu/usr.bin/binutils/as To: Andrew Turner Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQngjsizRwTjfeQx4DsBgJgHJbKHRh7jf8u82FDxHD9gPyVkTxPfpSnrzeFns9uHflwzv0Ff Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 15 Dec 2012 21:41:53 -0000 On 15 December 2012 16:33, Andrew Turner wrote: > Author: andrew > Date: Sat Dec 15 21:33:12 2012 > New Revision: 244277 > URL: http://svnweb.freebsd.org/changeset/base/244277 > > Log: > Also remove -Werror on arm with clang as there are warnings. I think it makes more sense to lower WARNS instead of making these NO_WERROR. This way the warnings that are a problem still get noticed. -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-head@FreeBSD.ORG Sat Dec 15 21:47:06 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A793929C; Sat, 15 Dec 2012 21:47:06 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8D5428FC0A; Sat, 15 Dec 2012 21:47:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBFLl6Ym043014; Sat, 15 Dec 2012 21:47:06 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBFLl6f1043013; Sat, 15 Dec 2012 21:47:06 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201212152147.qBFLl6f1043013@svn.freebsd.org> From: Andrew Turner Date: Sat, 15 Dec 2012 21:47:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244278 - head/sys/boot/arm/uboot X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 15 Dec 2012 21:47:06 -0000 Author: andrew Date: Sat Dec 15 21:47:05 2012 New Revision: 244278 URL: http://svnweb.freebsd.org/changeset/base/244278 Log: Ignore a warning in ubldr where clang doesn't understand the %D printf specifier from libstand. Modified: head/sys/boot/arm/uboot/Makefile Modified: head/sys/boot/arm/uboot/Makefile ============================================================================== --- head/sys/boot/arm/uboot/Makefile Sat Dec 15 21:33:12 2012 (r244277) +++ head/sys/boot/arm/uboot/Makefile Sat Dec 15 21:47:05 2012 (r244278) @@ -109,6 +109,9 @@ CFLAGS+= -I${.OBJDIR}/../../uboot/lib # where to get libstand from CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ +# clang doesn't understand %D as a specifier to printf +NO_WERROR.clang= + DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBSTAND} LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} -lstand From owner-svn-src-head@FreeBSD.ORG Sat Dec 15 21:52:08 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1F9D34F4 for ; Sat, 15 Dec 2012 21:52:08 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx1.freebsd.org (Postfix) with ESMTP id 8BF648FC1A for ; Sat, 15 Dec 2012 21:52:07 +0000 (UTC) Received: by mail-lb0-f182.google.com with SMTP id go10so3710859lbb.13 for ; Sat, 15 Dec 2012 13:52:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=HfXy1gBGWim4JhhW/BUziheRtFAcEk2umNaMGAUMW5w=; b=n3coRFwscLizGxaamtSDzIPp71YRAAsWVuy9TiI31qMR+sBwuPX8R2ezO6aLmRMp0L bV22enrOgUBpqf1bdQjivoI7kOvpDGXimpWCO449j6XZYnWzCallPh+CbKwTzOQRCJ8y PJLHnfembKKnvPIwlpMsNKOS7mJ3L5bcwQToo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:x-gm-message-state; bh=HfXy1gBGWim4JhhW/BUziheRtFAcEk2umNaMGAUMW5w=; b=bTrDBKYPqrPx2IIG8aLT8nexh3qcSAVxUYtFprt9gXAk2PktDpbSRDb0ANLfO705Rc NoC6ckY6GfNdFnSHO6D7Vo//wViTQAAKyDRES8eXaUVjHqi8cXUL3yw2GDjYewewrIdp MxROCGhtPjd6482t2xJ6SLF2jIiDkEoewk6DDOdscKbcpyUdWP57zpalAAHm7SVp0D9d 1wkZuwpMwNQE1SJFlIbcVQPjt80IIUWQ5W+Zeg8LcYLFa6TYp+zzdEsmx0X1FiN0u6zS l5mZwKQVrAj14sHSAEYm4HzUQ73mwC7IJ9pXI772BUSsHFGOwAqwLt2r+B8aQV8E2w1i AYcw== Received: by 10.152.148.40 with SMTP id tp8mr6452368lab.30.1355608326507; Sat, 15 Dec 2012 13:52:06 -0800 (PST) MIME-Version: 1.0 Received: by 10.112.149.225 with HTTP; Sat, 15 Dec 2012 13:51:36 -0800 (PST) In-Reply-To: <201212152147.qBFLl6f1043013@svn.freebsd.org> References: <201212152147.qBFLl6f1043013@svn.freebsd.org> From: Eitan Adler Date: Sat, 15 Dec 2012 16:51:36 -0500 Message-ID: Subject: Re: svn commit: r244278 - head/sys/boot/arm/uboot To: Andrew Turner Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQlp/Q9LLNy4+h+YFkXf79PnncOS1AsBI30r3uduvdcI23IJTa22pogKcvuJO7jKZsLf6NRX Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 15 Dec 2012 21:52:08 -0000 On 15 December 2012 16:47, Andrew Turner wrote: > Author: andrew > Date: Sat Dec 15 21:47:05 2012 > New Revision: 244278 > URL: http://svnweb.freebsd.org/changeset/base/244278 > > Log: > Ignore a warning in ubldr where clang doesn't understand the %D printf > specifier from libstand. > > Modified: > head/sys/boot/arm/uboot/Makefile > > Modified: head/sys/boot/arm/uboot/Makefile > ============================================================================== > --- head/sys/boot/arm/uboot/Makefile Sat Dec 15 21:33:12 2012 (r244277) > +++ head/sys/boot/arm/uboot/Makefile Sat Dec 15 21:47:05 2012 (r244278) > @@ -109,6 +109,9 @@ CFLAGS+= -I${.OBJDIR}/../../uboot/lib > # where to get libstand from > CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ > > +# clang doesn't understand %D as a specifier to printf > +NO_WERROR.clang= why not NO_WFORMAT or WFORMAT=0 ? Is there a need to eliminate the value of all the warnings? -- Eitan Adler From owner-svn-src-head@FreeBSD.ORG Sat Dec 15 21:57:08 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CDA3F8A7; Sat, 15 Dec 2012 21:57:08 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-da0-f54.google.com (mail-da0-f54.google.com [209.85.210.54]) by mx1.freebsd.org (Postfix) with ESMTP id 880728FC0C; Sat, 15 Dec 2012 21:57:08 +0000 (UTC) Received: by mail-da0-f54.google.com with SMTP id n2so1883004dad.13 for ; Sat, 15 Dec 2012 13:57:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; bh=lO9DI04kbGziBm3VuXj2qkYOgldWx7ZNnkYx/m2mlOU=; b=dxwlefzKul/5xC2MItISXwjMJ5PG/BX3s6/VxMGkq367gKS0myiAfR9AMfK33DNuag xk2a8razpkXjkGN+46sBpjZDl0iWOVdbUsSWfyLIPXLKTQQjmFTPCGARKuIgCjKuvEz5 otPeCJQdqdRbn6Ant4wEDE+giEGcchCCcCCC8wW1SZ8B+MdQfzFC3VJ1yYeqxNyFCLwM FBbaXLLf7Z7pRiKj9SaZw9dx71iv2vifpiWXGIpvFXwF0oXKUOmhbg0gKepPL0I9hVSK +L0UkKZwrfdVikoHycxMRCJqwluh9O7LzO9FR+ECWRtXDoloJkgO3QghLNf5mB6Bqe0o 0kZQ== Received: by 10.68.225.201 with SMTP id rm9mr28580498pbc.124.1355608628075; Sat, 15 Dec 2012 13:57:08 -0800 (PST) Received: from [192.168.20.11] (c-24-19-191-56.hsd1.wa.comcast.net. [24.19.191.56]) by mx.google.com with ESMTPS id rk6sm5293887pbc.20.2012.12.15.13.57.03 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 15 Dec 2012 13:57:07 -0800 (PST) Subject: Re: svn commit: r244278 - head/sys/boot/arm/uboot Mime-Version: 1.0 (Apple Message framework v1283) Content-Type: text/plain; charset=us-ascii From: Garrett Cooper In-Reply-To: <201212152147.qBFLl6f1043013@svn.freebsd.org> Date: Sat, 15 Dec 2012 13:57:02 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201212152147.qBFLl6f1043013@svn.freebsd.org> To: Andrew Turner X-Mailer: Apple Mail (2.1283) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 15 Dec 2012 21:57:08 -0000 On Dec 15, 2012, at 1:47 PM, Andrew Turner wrote: > Author: andrew > Date: Sat Dec 15 21:47:05 2012 > New Revision: 244278 > URL: http://svnweb.freebsd.org/changeset/base/244278 >=20 > Log: > Ignore a warning in ubldr where clang doesn't understand the %D = printf > specifier from libstand. >=20 > Modified: > head/sys/boot/arm/uboot/Makefile >=20 > Modified: head/sys/boot/arm/uboot/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/sys/boot/arm/uboot/Makefile Sat Dec 15 21:33:12 2012 = (r244277) > +++ head/sys/boot/arm/uboot/Makefile Sat Dec 15 21:47:05 2012 = (r244278) > @@ -109,6 +109,9 @@ CFLAGS+=3D -I${.OBJDIR}/../../uboot/lib > # where to get libstand from > CFLAGS+=3D -I${.CURDIR}/../../../../lib/libstand/ >=20 > +# clang doesn't understand %D as a specifier to printf > +NO_WERROR.clang=3D > + > DPADD=3D ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBSTAND} > LDADD=3D ${LIBFICL} ${LIBUBOOT} ${LIBFDT} -lstand Why not fix it similar to how I fixed libi386/pxe.c on my git = branch ( = https://github.com/yaneurabeya/freebsd/commit/709c2b0a47ec887f8df3a886d318= c309a0659bf6 )? Thanks, -Garrett= From owner-svn-src-head@FreeBSD.ORG Sat Dec 15 22:26:17 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 43B0E669; Sat, 15 Dec 2012 22:26:17 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 29B6E8FC0C; Sat, 15 Dec 2012 22:26:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBFMQH3K048930; Sat, 15 Dec 2012 22:26:17 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBFMQHA3048929; Sat, 15 Dec 2012 22:26:17 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201212152226.qBFMQHA3048929@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 15 Dec 2012 22:26:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244280 - head/sys/dev/wbwd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 15 Dec 2012 22:26:17 -0000 Author: pjd Date: Sat Dec 15 22:26:16 2012 New Revision: 244280 URL: http://svnweb.freebsd.org/changeset/base/244280 Log: sbuf_trim() cannot be used on sbuf with drain function set. This fixes panic when listing sysctls on INVARIANTS-enabled kernel while having wbwd loaded. This panic was not fatal, at worst one additional space was printed. Also sbuf_trim() makes some sense even if drain function is set. The drain function is called only when buffer is to be expanded. So we could still trim existing buffer before drain is called. In this case it worked just fine - the trailing space was correctly trimmed. Obtained from: WHEEL Systems MFC after: 1 week Modified: head/sys/dev/wbwd/wbwd.c Modified: head/sys/dev/wbwd/wbwd.c ============================================================================== --- head/sys/dev/wbwd/wbwd.c Sat Dec 15 21:57:34 2012 (r244279) +++ head/sys/dev/wbwd/wbwd.c Sat Dec 15 22:26:16 2012 (r244280) @@ -208,9 +208,8 @@ sysctl_wb_debug(SYSCTL_HANDLER_ARGS) sbuf_printf(&sb, "LDN8 (GPIO2, Watchdog): "); sbuf_printf(&sb, "CRF5 0x%02x ", sc->reg_1); sbuf_printf(&sb, "CRF6 0x%02x ", sc->reg_timeout); - sbuf_printf(&sb, "CRF7 0x%02x ", sc->reg_2); + sbuf_printf(&sb, "CRF7 0x%02x", sc->reg_2); - sbuf_trim(&sb); error = sbuf_finish(&sb); sbuf_delete(&sb); return (error); From owner-svn-src-head@FreeBSD.ORG Sat Dec 15 22:33:47 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 36F85843; Sat, 15 Dec 2012 22:33:47 +0000 (UTC) (envelope-from bright@mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 0CD6A8FC1A; Sat, 15 Dec 2012 22:33:47 +0000 (UTC) Received: from [10.0.1.102] (c-67-180-208-218.hsd1.ca.comcast.net [67.180.208.218]) by elvis.mu.org (Postfix) with ESMTPSA id EC49C1A3C1E; Sat, 15 Dec 2012 14:33:39 -0800 (PST) References: <201212110708.qBB78EWx025288@svn.freebsd.org> <201212121046.43706.jhb@freebsd.org> <201212121658.49048.jhb@freebsd.org> <50C90567.8080406@FreeBSD.org> <50C909BD.9090709@mu.org> <50C91B32.4080904@FreeBSD.org> <50C91CD3.7030900@mu.org> <50C9206D.6080502@FreeBSD.org> <50C9271C.70803@mu.org> <20121215210333.GH1411@garage.freebsd.pl> Mime-Version: 1.0 (1.0) In-Reply-To: <20121215210333.GH1411@garage.freebsd.pl> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Message-Id: <03D95002-35FE-4880-80FA-3E97944AB988@mu.org> X-Mailer: iPhone Mail (10A523) From: Alfred Perlstein Subject: Re: svn commit: r244112 - head/sys/kern Date: Sat, 15 Dec 2012 14:33:37 -0800 To: Pawel Jakub Dawidek Cc: Adrian Chadd , "src-committers@FreeBSD.org" , John Baldwin , "svn-src-all@FreeBSD.org" , Alfred Perlstein , Andriy Gapon , Navdeep Parhar , "svn-src-head@FreeBSD.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 15 Dec 2012 22:33:47 -0000 Your use case (small swap & large ram) is exactly why I would like to try th= is.=20 Do you object? Sent from my iPhone On Dec 15, 2012, at 1:03 PM, Pawel Jakub Dawidek wrote: > On Wed, Dec 12, 2012 at 04:53:48PM -0800, Alfred Perlstein wrote: >> Like what if I do gzipp'd kernel dumps next? (on my todo list) How many=20= >> people will complain that "gzip is too dangerous in kernel context foo=20= >> foo!!!!" >>=20 >> Not sure, I guess I'll find out? >=20 > Well... :) savecore(8) has an option to compress the dumps. The only use > case for compressing-while-dumping I see is small swap/dump partition. > I'm not against this change, but I would not use it myself. When you are > dumping your kernel is in undefined state, so the less code you execute > in that state the higher chances your dump will succeed. I much prefer > to either compress the dumps with savecore(8) or use ZFS dataset with > compression enabled for /var/crash/. >=20 > --=20 > Pawel Jakub Dawidek http://www.wheelsystems.com > FreeBSD committer http://www.FreeBSD.org > Am I Evil? Yes, I Am! http://tupytaj.pl From owner-svn-src-head@FreeBSD.ORG Sat Dec 15 22:36:02 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 39F6D9BE; Sat, 15 Dec 2012 22:36:02 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from smtp3.clear.net.nz (smtp3.clear.net.nz [203.97.33.64]) by mx1.freebsd.org (Postfix) with ESMTP id E9E098FC13; Sat, 15 Dec 2012 22:36:01 +0000 (UTC) Received: from mxin1-orange.clear.net.nz (lb2-srcnat.clear.net.nz [203.97.32.237]) by smtp3.clear.net.nz (CLEAR Net Mail) with ESMTP id <0MF300KV7G3TY120@smtp3.clear.net.nz>; Sun, 16 Dec 2012 11:35:53 +1300 (NZDT) Received: from 202-0-48-19.paradise.net.nz (HELO localhost) ([202.0.48.19]) by smtpin1.paradise.net.nz with ESMTP; Sun, 16 Dec 2012 11:35:53 +1300 Date: Sun, 16 Dec 2012 11:35:40 +1300 From: Andrew Turner Subject: Re: svn commit: r244278 - head/sys/boot/arm/uboot In-reply-to: To: Eitan Adler Message-id: <20121216113540.37e5b58a@fubar.geek.nz> MIME-version: 1.0 X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.6; i386-portbld-freebsd8.1) Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7bit X-Pirate: Arrrr References: <201212152147.qBFLl6f1043013@svn.freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 15 Dec 2012 22:36:02 -0000 On Sat, 15 Dec 2012 16:51:36 -0500 Eitan Adler wrote: > On 15 December 2012 16:47, Andrew Turner wrote: > > Author: andrew > > Date: Sat Dec 15 21:47:05 2012 > > New Revision: 244278 > > URL: http://svnweb.freebsd.org/changeset/base/244278 > > > > Log: > > Ignore a warning in ubldr where clang doesn't understand the %D > > printf specifier from libstand. > > > > Modified: > > head/sys/boot/arm/uboot/Makefile > > > > Modified: head/sys/boot/arm/uboot/Makefile > > ============================================================================== > > --- head/sys/boot/arm/uboot/Makefile Sat Dec 15 21:33:12 > > 2012 (r244277) +++ head/sys/boot/arm/uboot/Makefile Sat > > Dec 15 21:47:05 2012 (r244278) @@ -109,6 +109,9 @@ > > CFLAGS+= -I${.OBJDIR}/../../uboot/lib # where to get libstand > > from CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ > > > > +# clang doesn't understand %D as a specifier to printf > > +NO_WERROR.clang= > > why not NO_WFORMAT or WFORMAT=0 ? Is there a need to eliminate the > value of all the warnings? Because, as far as I can tell, NO_WFORMAT and WFORMAT=0 are not documented so I didn't know about them. Andrew From owner-svn-src-head@FreeBSD.ORG Sat Dec 15 22:41:18 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A44E3B9A; Sat, 15 Dec 2012 22:41:18 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (garage.dawidek.net [91.121.88.72]) by mx1.freebsd.org (Postfix) with ESMTP id 552EB8FC0A; Sat, 15 Dec 2012 22:41:17 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id C8EB5BBF; Sat, 15 Dec 2012 23:39:05 +0100 (CET) Date: Sat, 15 Dec 2012 23:42:46 +0100 From: Pawel Jakub Dawidek To: Alfred Perlstein Subject: Re: svn commit: r244112 - head/sys/kern Message-ID: <20121215224245.GI1411@garage.freebsd.pl> References: <201212121658.49048.jhb@freebsd.org> <50C90567.8080406@FreeBSD.org> <50C909BD.9090709@mu.org> <50C91B32.4080904@FreeBSD.org> <50C91CD3.7030900@mu.org> <50C9206D.6080502@FreeBSD.org> <50C9271C.70803@mu.org> <20121215210333.GH1411@garage.freebsd.pl> <03D95002-35FE-4880-80FA-3E97944AB988@mu.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="QDIl5R72YNOeCxaP" Content-Disposition: inline In-Reply-To: <03D95002-35FE-4880-80FA-3E97944AB988@mu.org> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Adrian Chadd , "src-committers@FreeBSD.org" , John Baldwin , "svn-src-all@FreeBSD.org" , Alfred Perlstein , Andriy Gapon , Navdeep Parhar , "svn-src-head@FreeBSD.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 15 Dec 2012 22:41:18 -0000 --QDIl5R72YNOeCxaP Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Dec 15, 2012 at 02:33:37PM -0800, Alfred Perlstein wrote: > Your use case (small swap & large ram) is exactly why I would like to try= this.=20 >=20 > Do you object? Let me quote myself, because you clearly missed my position: "I'm not against this change, but I would not use it myself." I hope that's fine by you!:) > > Well... :) savecore(8) has an option to compress the dumps. The only use > > case for compressing-while-dumping I see is small swap/dump partition. > > I'm not against this change, but I would not use it myself. When you are > > dumping your kernel is in undefined state, so the less code you execute > > in that state the higher chances your dump will succeed. I much prefer > > to either compress the dumps with savecore(8) or use ZFS dataset with > > compression enabled for /var/crash/. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --QDIl5R72YNOeCxaP Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlDM/OUACgkQForvXbEpPzSeLQCgpAte8MHVLofWEO6DVFlCUzYZ KTgAn1sL8lczexUsX4u/HFVTNEFNA/eI =DmaK -----END PGP SIGNATURE----- --QDIl5R72YNOeCxaP-- From owner-svn-src-head@FreeBSD.ORG Sat Dec 15 22:54:42 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D640EEC8; Sat, 15 Dec 2012 22:54:42 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from smtp4.clear.net.nz (smtp4.clear.net.nz [203.97.37.64]) by mx1.freebsd.org (Postfix) with ESMTP id 915B48FC0A; Sat, 15 Dec 2012 22:54:42 +0000 (UTC) Received: from mxin1-orange.clear.net.nz (lb2-srcnat.clear.net.nz [203.97.32.237]) by smtp4.clear.net.nz (CLEAR Net Mail) with ESMTP id <0MF300HJJG9O5950@smtp4.clear.net.nz>; Sun, 16 Dec 2012 11:39:35 +1300 (NZDT) Received: from 202-0-48-19.paradise.net.nz (HELO localhost) ([202.0.48.19]) by smtpin1.paradise.net.nz with ESMTP; Sun, 16 Dec 2012 11:39:34 +1300 Date: Sun, 16 Dec 2012 11:39:21 +1300 From: Andrew Turner Subject: Re: svn commit: r244278 - head/sys/boot/arm/uboot In-reply-to: To: Garrett Cooper Message-id: <20121216113921.0c9e2c9b@fubar.geek.nz> MIME-version: 1.0 X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.6; i386-portbld-freebsd8.1) Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7bit X-Pirate: Arrrr References: <201212152147.qBFLl6f1043013@svn.freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 15 Dec 2012 22:54:42 -0000 On Sat, 15 Dec 2012 13:57:02 -0800 Garrett Cooper wrote: > On Dec 15, 2012, at 1:47 PM, Andrew Turner wrote: > > > Author: andrew > > Date: Sat Dec 15 21:47:05 2012 > > New Revision: 244278 > > URL: http://svnweb.freebsd.org/changeset/base/244278 > > > > Log: > > Ignore a warning in ubldr where clang doesn't understand the %D > > printf specifier from libstand. > > > > Modified: > > head/sys/boot/arm/uboot/Makefile > > > > Modified: head/sys/boot/arm/uboot/Makefile > > ============================================================================== > > --- head/sys/boot/arm/uboot/Makefile Sat Dec 15 21:33:12 > > 2012 (r244277) +++ head/sys/boot/arm/uboot/Makefile > > Sat Dec 15 21:47:05 2012 (r244278) @@ -109,6 +109,9 @@ > > CFLAGS+= -I${.OBJDIR}/../../uboot/lib # where to get > > libstand from CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ > > > > +# clang doesn't understand %D as a specifier to printf > > +NO_WERROR.clang= > > + > > DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBSTAND} > > LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} -lstand > > Why not fix it similar to how I fixed libi386/pxe.c on my git > branch > ( https://github.com/yaneurabeya/freebsd/commit/709c2b0a47ec887f8df3a886d318c309a0659bf6 > )? Thanks, -Garrett > When you commit the sys/boot/common/dev_net.c change from that patch we should be able to revert this commit. Andrew