svn commit: r236541 - in stable/9/sys: cam dev/ahci dev/ata dev/mvs dev/siis

2012-06-04 Thread Alexander Motin
Author: mav
Date: Mon Jun  4 07:03:56 2012
New Revision: 236541
URL: http://svn.freebsd.org/changeset/base/236541

Log:
  MFC r235333:
  Add two functions xpt_batch_start() and xpt_batch_done() to the CAM SIM KPI
  to allow drivers to handle request completion directly without passing
  them to the CAM SWI thread removing extra context switch.
  Modify all ATA/SATA drivers to use them.

Modified:
  stable/9/sys/cam/cam_sim.h
  stable/9/sys/cam/cam_xpt.c
  stable/9/sys/cam/cam_xpt_sim.h
  stable/9/sys/dev/ahci/ahci.c
  stable/9/sys/dev/ata/ata-all.c
  stable/9/sys/dev/mvs/mvs.c
  stable/9/sys/dev/siis/siis.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/sys/cam/cam_sim.h
==
--- stable/9/sys/cam/cam_sim.h  Mon Jun  4 06:45:49 2012(r236540)
+++ stable/9/sys/cam/cam_sim.h  Mon Jun  4 07:03:56 2012(r236541)
@@ -106,6 +106,7 @@ struct cam_sim {
 #defineCAM_SIM_MPSAFE  0x02
 #defineCAM_SIM_ON_DONEQ0x04
 #defineCAM_SIM_POLLED  0x08
+#defineCAM_SIM_BATCH   0x10
struct callout  callout;
struct cam_devq *devq;  /* Device Queue to use for this SIM */
int refcount; /* References to the SIM. */

Modified: stable/9/sys/cam/cam_xpt.c
==
--- stable/9/sys/cam/cam_xpt.c  Mon Jun  4 06:45:49 2012(r236540)
+++ stable/9/sys/cam/cam_xpt.c  Mon Jun  4 07:03:56 2012(r236541)
@@ -4332,7 +4332,8 @@ xpt_done(union ccb *done_ccb)
TAILQ_INSERT_TAIL(&sim->sim_doneq, &done_ccb->ccb_h,
sim_links.tqe);
done_ccb->ccb_h.pinfo.index = CAM_DONEQ_INDEX;
-   if ((sim->flags & (CAM_SIM_ON_DONEQ | CAM_SIM_POLLED)) == 0) {
+   if ((sim->flags & (CAM_SIM_ON_DONEQ | CAM_SIM_POLLED |
+   CAM_SIM_BATCH)) == 0) {
mtx_lock(&cam_simq_lock);
first = TAILQ_EMPTY(&cam_simq);
TAILQ_INSERT_TAIL(&cam_simq, sim, links);
@@ -4344,6 +4345,25 @@ xpt_done(union ccb *done_ccb)
}
 }
 
+void
+xpt_batch_start(struct cam_sim *sim)
+{
+
+   KASSERT((sim->flags & CAM_SIM_BATCH) == 0, ("Batch flag already set"));
+   sim->flags |= CAM_SIM_BATCH;
+}
+
+void
+xpt_batch_done(struct cam_sim *sim)
+{
+
+   KASSERT((sim->flags & CAM_SIM_BATCH) != 0, ("Batch flag was not set"));
+   sim->flags &= ~CAM_SIM_BATCH;
+   if (!TAILQ_EMPTY(&sim->sim_doneq) &&
+   (sim->flags & CAM_SIM_ON_DONEQ) == 0)
+   camisr_runqueue(&sim->sim_doneq);
+}
+
 union ccb *
 xpt_alloc_ccb()
 {

Modified: stable/9/sys/cam/cam_xpt_sim.h
==
--- stable/9/sys/cam/cam_xpt_sim.h  Mon Jun  4 06:45:49 2012
(r236540)
+++ stable/9/sys/cam/cam_xpt_sim.h  Mon Jun  4 07:03:56 2012
(r236541)
@@ -51,6 +51,8 @@ void  xpt_release_devq_rl(struct cam_pat
u_int count, int run_queue);
 intxpt_sim_opened(struct cam_sim *sim);
 void   xpt_done(union ccb *done_ccb);
+void   xpt_batch_start(struct cam_sim *sim);
+void   xpt_batch_done(struct cam_sim *sim);
 #endif
 
 #endif /* _CAM_CAM_XPT_SIM_H */

Modified: stable/9/sys/dev/ahci/ahci.c
==
--- stable/9/sys/dev/ahci/ahci.cMon Jun  4 06:45:49 2012
(r236540)
+++ stable/9/sys/dev/ahci/ahci.cMon Jun  4 07:03:56 2012
(r236541)
@@ -1458,7 +1458,9 @@ ahci_ch_intr_locked(void *data)
struct ahci_channel *ch = device_get_softc(dev);
 
mtx_lock(&ch->mtx);
+   xpt_batch_start(ch->sim);
ahci_ch_intr(data);
+   xpt_batch_done(ch->sim);
mtx_unlock(&ch->mtx);
 }
 

Modified: stable/9/sys/dev/ata/ata-all.c
==
--- stable/9/sys/dev/ata/ata-all.c  Mon Jun  4 06:45:49 2012
(r236540)
+++ stable/9/sys/dev/ata/ata-all.c  Mon Jun  4 07:03:56 2012
(r236541)
@@ -544,9 +544,11 @@ ata_interrupt(void *data)
 struct ata_channel *ch = (struct ata_channel *)data;
 
 mtx_lock(&ch->state_mtx);
+xpt_batch_start(ch->sim);
 #endif
 ata_interrupt_locked(data);
 #ifdef ATA_CAM
+xpt_batch_done(ch->sim);
 mtx_unlock(&ch->state_mtx);
 #endif
 }

Modified: stable/9/sys/dev/mvs/mvs.c
==
--- stable/9/sys/dev/mvs/mvs.c  Mon Jun  4 06:45:49 2012(r236540)
+++ stable/9/sys/dev/mvs/mvs.c  Mon Jun  4 07:03:56 2012(r236541)
@@ -654,7 +654,9 @@ mvs_ch_intr_locked(void *data)
struct mvs_channel *ch = d

svn commit: r236542 - in stable/8/sys: cam dev/ahci dev/ata dev/mvs dev/siis

2012-06-04 Thread Alexander Motin
Author: mav
Date: Mon Jun  4 07:05:13 2012
New Revision: 236542
URL: http://svn.freebsd.org/changeset/base/236542

Log:
  MFC r235333:
  Add two functions xpt_batch_start() and xpt_batch_done() to the CAM SIM KPI
  to allow drivers to handle request completion directly without passing
  them to the CAM SWI thread removing extra context switch.
  Modify all ATA/SATA drivers to use them.

Modified:
  stable/8/sys/cam/cam_sim.h
  stable/8/sys/cam/cam_xpt.c
  stable/8/sys/cam/cam_xpt_sim.h
  stable/8/sys/dev/ahci/ahci.c
  stable/8/sys/dev/ata/ata-all.c
  stable/8/sys/dev/mvs/mvs.c
  stable/8/sys/dev/siis/siis.c
Directory Properties:
  stable/8/sys/   (props changed)

Modified: stable/8/sys/cam/cam_sim.h
==
--- stable/8/sys/cam/cam_sim.h  Mon Jun  4 07:03:56 2012(r236541)
+++ stable/8/sys/cam/cam_sim.h  Mon Jun  4 07:05:13 2012(r236542)
@@ -106,6 +106,7 @@ struct cam_sim {
 #defineCAM_SIM_MPSAFE  0x02
 #defineCAM_SIM_ON_DONEQ0x04
 #defineCAM_SIM_POLLED  0x08
+#defineCAM_SIM_BATCH   0x10
struct callout  callout;
struct cam_devq *devq;  /* Device Queue to use for this SIM */
int refcount; /* References to the SIM. */

Modified: stable/8/sys/cam/cam_xpt.c
==
--- stable/8/sys/cam/cam_xpt.c  Mon Jun  4 07:03:56 2012(r236541)
+++ stable/8/sys/cam/cam_xpt.c  Mon Jun  4 07:05:13 2012(r236542)
@@ -4250,7 +4250,8 @@ xpt_done(union ccb *done_ccb)
TAILQ_INSERT_TAIL(&sim->sim_doneq, &done_ccb->ccb_h,
sim_links.tqe);
done_ccb->ccb_h.pinfo.index = CAM_DONEQ_INDEX;
-   if ((sim->flags & (CAM_SIM_ON_DONEQ | CAM_SIM_POLLED)) == 0) {
+   if ((sim->flags & (CAM_SIM_ON_DONEQ | CAM_SIM_POLLED |
+   CAM_SIM_BATCH)) == 0) {
mtx_lock(&cam_simq_lock);
first = TAILQ_EMPTY(&cam_simq);
TAILQ_INSERT_TAIL(&cam_simq, sim, links);
@@ -4262,6 +4263,25 @@ xpt_done(union ccb *done_ccb)
}
 }
 
+void
+xpt_batch_start(struct cam_sim *sim)
+{
+
+   KASSERT((sim->flags & CAM_SIM_BATCH) == 0, ("Batch flag already set"));
+   sim->flags |= CAM_SIM_BATCH;
+}
+
+void
+xpt_batch_done(struct cam_sim *sim)
+{
+
+   KASSERT((sim->flags & CAM_SIM_BATCH) != 0, ("Batch flag was not set"));
+   sim->flags &= ~CAM_SIM_BATCH;
+   if (!TAILQ_EMPTY(&sim->sim_doneq) &&
+   (sim->flags & CAM_SIM_ON_DONEQ) == 0)
+   camisr_runqueue(&sim->sim_doneq);
+}
+
 union ccb *
 xpt_alloc_ccb()
 {

Modified: stable/8/sys/cam/cam_xpt_sim.h
==
--- stable/8/sys/cam/cam_xpt_sim.h  Mon Jun  4 07:03:56 2012
(r236541)
+++ stable/8/sys/cam/cam_xpt_sim.h  Mon Jun  4 07:05:13 2012
(r236542)
@@ -51,6 +51,8 @@ void  xpt_release_devq_rl(struct cam_pat
u_int count, int run_queue);
 intxpt_sim_opened(struct cam_sim *sim);
 void   xpt_done(union ccb *done_ccb);
+void   xpt_batch_start(struct cam_sim *sim);
+void   xpt_batch_done(struct cam_sim *sim);
 #endif
 
 #endif /* _CAM_CAM_XPT_SIM_H */

Modified: stable/8/sys/dev/ahci/ahci.c
==
--- stable/8/sys/dev/ahci/ahci.cMon Jun  4 07:03:56 2012
(r236541)
+++ stable/8/sys/dev/ahci/ahci.cMon Jun  4 07:05:13 2012
(r236542)
@@ -1455,7 +1455,9 @@ ahci_ch_intr_locked(void *data)
struct ahci_channel *ch = device_get_softc(dev);
 
mtx_lock(&ch->mtx);
+   xpt_batch_start(ch->sim);
ahci_ch_intr(data);
+   xpt_batch_done(ch->sim);
mtx_unlock(&ch->mtx);
 }
 

Modified: stable/8/sys/dev/ata/ata-all.c
==
--- stable/8/sys/dev/ata/ata-all.c  Mon Jun  4 07:03:56 2012
(r236541)
+++ stable/8/sys/dev/ata/ata-all.c  Mon Jun  4 07:05:13 2012
(r236542)
@@ -543,9 +543,11 @@ ata_interrupt(void *data)
 struct ata_channel *ch = (struct ata_channel *)data;
 
 mtx_lock(&ch->state_mtx);
+xpt_batch_start(ch->sim);
 #endif
 ata_interrupt_locked(data);
 #ifdef ATA_CAM
+xpt_batch_done(ch->sim);
 mtx_unlock(&ch->state_mtx);
 #endif
 }

Modified: stable/8/sys/dev/mvs/mvs.c
==
--- stable/8/sys/dev/mvs/mvs.c  Mon Jun  4 07:03:56 2012(r236541)
+++ stable/8/sys/dev/mvs/mvs.c  Mon Jun  4 07:05:13 2012(r236542)
@@ -653,7 +653,9 @@ mvs_ch_intr_locked(void *data)
struct mvs_channel *ch = device_get_softc(dev);
 
mtx_lo

svn commit: r236543 - stable/9/sys/dev/ata

2012-06-04 Thread Alexander Motin
Author: mav
Date: Mon Jun  4 07:07:46 2012
New Revision: 236543
URL: http://svn.freebsd.org/changeset/base/236543

Log:
  MFC r236184:
  Make legacy ATA to not call device_add_child() with unit number but
  without driver name.

Modified:
  stable/9/sys/dev/ata/ata-all.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/sys/dev/ata/ata-all.c
==
--- stable/9/sys/dev/ata/ata-all.c  Mon Jun  4 07:05:13 2012
(r236542)
+++ stable/9/sys/dev/ata/ata-all.c  Mon Jun  4 07:07:46 2012
(r236543)
@@ -887,7 +887,7 @@ ata_add_child(device_t parent, struct at
 {
 device_t child;
 
-if ((child = device_add_child(parent, NULL, unit))) {
+if ((child = device_add_child(parent, (unit < 0) ? NULL : "ad", unit))) {
device_set_softc(child, atadev);
device_quiet(child);
atadev->dev = child;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r236544 - stable/8/sys/dev/ata

2012-06-04 Thread Alexander Motin
Author: mav
Date: Mon Jun  4 07:08:58 2012
New Revision: 236544
URL: http://svn.freebsd.org/changeset/base/236544

Log:
  MFC r236184:
  Make legacy ATA to not call device_add_child() with unit number but
  without driver name.

Modified:
  stable/8/sys/dev/ata/ata-all.c
Directory Properties:
  stable/8/sys/   (props changed)

Modified: stable/8/sys/dev/ata/ata-all.c
==
--- stable/8/sys/dev/ata/ata-all.c  Mon Jun  4 07:07:46 2012
(r236543)
+++ stable/8/sys/dev/ata/ata-all.c  Mon Jun  4 07:08:58 2012
(r236544)
@@ -886,7 +886,7 @@ ata_add_child(device_t parent, struct at
 {
 device_t child;
 
-if ((child = device_add_child(parent, NULL, unit))) {
+if ((child = device_add_child(parent, (unit < 0) ? NULL : "ad", unit))) {
device_set_softc(child, atadev);
device_quiet(child);
atadev->dev = child;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r236546 - stable/9/sys/kern

2012-06-04 Thread Alexander Motin
Author: mav
Date: Mon Jun  4 07:12:36 2012
New Revision: 236546
URL: http://svn.freebsd.org/changeset/base/236546

Log:
  MFC r232740:
  Make kern.sched.idlespinthresh default value adaptive depending of HZ.
  Otherwise with HZ above 8000 CPU may never skip timer ticks on idle.

Modified:
  stable/9/sys/kern/sched_ule.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/kern/sched_ule.c
==
--- stable/9/sys/kern/sched_ule.c   Mon Jun  4 07:12:11 2012
(r236545)
+++ stable/9/sys/kern/sched_ule.c   Mon Jun  4 07:12:36 2012
(r236546)
@@ -212,7 +212,7 @@ static int preempt_thresh = 0;
 #endif
 static int static_boost = PRI_MIN_BATCH;
 static int sched_idlespins = 1;
-static int sched_idlespinthresh = 16;
+static int sched_idlespinthresh = -1;
 
 /*
  * tdq - per processor runqs and statistics.  All fields are protected by the
@@ -1410,6 +1410,8 @@ sched_initticks(void *dummy)
steal_thresh = min(fls(mp_ncpus) - 1, 3);
affinity = SCHED_AFFINITY_DEFAULT;
 #endif
+   if (sched_idlespinthresh < 0)
+   sched_idlespinthresh = max(16, 2 * hz / realstathz);
 }
 
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r236547 - stable/9/sys/kern

2012-06-04 Thread Alexander Motin
Author: mav
Date: Mon Jun  4 07:16:12 2012
New Revision: 236547
URL: http://svn.freebsd.org/changeset/base/236547

Log:
  MFC r234066:
  Microoptimize cpu_search().
  
  According to profiling, it makes one take 6% of CPU time on hackbench
  with its million of context switches per second, instead of 8% before.

Modified:
  stable/9/sys/kern/sched_ule.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/kern/sched_ule.c
==
--- stable/9/sys/kern/sched_ule.c   Mon Jun  4 07:12:36 2012
(r236546)
+++ stable/9/sys/kern/sched_ule.c   Mon Jun  4 07:16:12 2012
(r236547)
@@ -615,32 +615,34 @@ cpu_search(const struct cpu_group *cg, s
cpuset_t cpumask;
struct cpu_group *child;
struct tdq *tdq;
-   int cpu, i, hload, lload, load, total, rnd;
+   int cpu, i, hload, lload, load, total, rnd, *rndptr;
 
total = 0;
cpumask = cg->cg_mask;
if (match & CPU_SEARCH_LOWEST) {
lload = INT_MAX;
-   low->cs_load = INT_MAX;
lgroup = *low;
}
if (match & CPU_SEARCH_HIGHEST) {
-   hload = -1;
-   high->cs_load = -1;
+   hload = INT_MIN;
hgroup = *high;
}
 
/* Iterate through the child CPU groups and then remaining CPUs. */
-   for (i = 0, cpu = 0; i <= cg->cg_children; ) {
-   if (i >= cg->cg_children) {
-   while (cpu <= mp_maxid && !CPU_ISSET(cpu, &cpumask))
-   cpu++;
-   if (cpu > mp_maxid)
+   for (i = cg->cg_children, cpu = mp_maxid; i >= 0; ) {
+   if (i == 0) {
+   while (cpu >= 0 && !CPU_ISSET(cpu, &cpumask))
+   cpu--;
+   if (cpu < 0)
break;
child = NULL;
} else
-   child = &cg->cg_child[i];
+   child = &cg->cg_child[i - 1];
 
+   if (match & CPU_SEARCH_LOWEST)
+   lgroup.cs_cpu = -1;
+   if (match & CPU_SEARCH_HIGHEST)
+   hgroup.cs_cpu = -1;
if (child) {/* Handle child CPU group. */
CPU_NAND(&cpumask, &child->cg_mask);
switch (match) {
@@ -657,23 +659,23 @@ cpu_search(const struct cpu_group *cg, s
} else {/* Handle child CPU. */
tdq = TDQ_CPU(cpu);
load = tdq->tdq_load * 256;
-   rnd = DPCPU_SET(randomval,
-   DPCPU_GET(randomval) * 69069 + 5) >> 26;
+   rndptr = DPCPU_PTR(randomval);
+   rnd = (*rndptr = *rndptr * 69069 + 5) >> 26;
if (match & CPU_SEARCH_LOWEST) {
if (cpu == low->cs_prefer)
load -= 64;
/* If that CPU is allowed and get data. */
-   if (CPU_ISSET(cpu, &lgroup.cs_mask) &&
-   tdq->tdq_lowpri > lgroup.cs_pri &&
-   tdq->tdq_load <= lgroup.cs_limit) {
+   if (tdq->tdq_lowpri > lgroup.cs_pri &&
+   tdq->tdq_load <= lgroup.cs_limit &&
+   CPU_ISSET(cpu, &lgroup.cs_mask)) {
lgroup.cs_cpu = cpu;
lgroup.cs_load = load - rnd;
}
}
if (match & CPU_SEARCH_HIGHEST)
-   if (CPU_ISSET(cpu, &hgroup.cs_mask) &&
-   tdq->tdq_load >= hgroup.cs_limit &&
-   tdq->tdq_transferable) {
+   if (tdq->tdq_load >= hgroup.cs_limit &&
+   tdq->tdq_transferable &&
+   CPU_ISSET(cpu, &hgroup.cs_mask)) {
hgroup.cs_cpu = cpu;
hgroup.cs_load = load - rnd;
}
@@ -682,7 +684,7 @@ cpu_search(const struct cpu_group *cg, s
 
/* We have info about child item. Compare it. */
if (match & CPU_SEARCH_LOWEST) {
-   if (lgroup.cs_load != INT_MAX &&
+   if (lgroup.cs_cpu >= 0 &&
(load < lload ||
 (load == lload && lgroup.cs_load < low->cs_load))) 
{
lload = load;
@@ -691,17 +693,19 @@ cpu_search(const struct cpu_group *cg, s

svn commit: r236549 - head/sys/modules

2012-06-04 Thread Grzegorz Bernacki
Author: gber
Date: Mon Jun  4 08:40:14 2012
New Revision: 236549
URL: http://svn.freebsd.org/changeset/base/236549

Log:
  Restore changes accidentally removed in r235537.
  
  Noticed by:   avg

Modified:
  head/sys/modules/Makefile

Modified: head/sys/modules/Makefile
==
--- head/sys/modules/Makefile   Mon Jun  4 07:54:53 2012(r236548)
+++ head/sys/modules/Makefile   Mon Jun  4 08:40:14 2012(r236549)
@@ -338,6 +338,7 @@ SUBDIR= ${_3dfx} \
vx \
${_vxge} \
wb \
+   ${_wbwd} \
${_wi} \
wlan \
wlan_acl \
@@ -521,6 +522,7 @@ _stg=   stg
 _streams=  streams
 _svr4= svr4
 _vxge= vxge
+_wbwd= wbwd
 _wi=   wi
 _xe=   xe
 .if ${MK_ZFS} != "no" || defined(ALL_MODULES)
@@ -716,6 +718,7 @@ _viawd= viawd
 _virtio=   virtio
 _vxge= vxge
 _x86bios=  x86bios
+_wbwd= wbwd
 _wi=   wi
 _wpi=  wpi
 .if ${MK_SOURCELESS_UCODE} != "no"
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r235537 - in head: etc/mtree include lib lib/libnandfs lib/libstand sbin sbin/nandfs sbin/newfs_nandfs share/man/man4 share/man/man5 share/mk sys/boot/arm/uboot sys/boot/i386/loader sy

2012-06-04 Thread Grzegorz Bernacki

On 06/02/12 20:43, Andriy Gapon wrote:

on 17/05/2012 13:11 Grzegorz Bernacki said the following:

Author: gber
Date: Thu May 17 10:11:18 2012
New Revision: 235537
URL: http://svn.freebsd.org/changeset/base/235537

Log:
   Import work done under project/nand (@235533) into head.

   The NAND Flash environment consists of several distinct components:
 - NAND framework (drivers harness for NAND controllers and NAND chips)
 - NAND simulator (NANDsim)
 - NAND file system (NAND FS)
 - Companion tools and utilities
 - Documentation (manual pages)

   This work is still experimental. Please use with caution.

   Obtained from: Semihalf
   Supported by:  FreeBSD Foundation, Juniper Networks

[snip]

   head/sys/modules/Makefile


Looks like this commit has unintentionally [?] removed wbwd-related lines from
sys/modules/Makefile.  Please fix.


Hi Andriy,

Sorry about that. Fixed in r236549.

regards,
grzesiek
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r236550 - head/usr.sbin/daemon

2012-06-04 Thread Mikolaj Golub
Author: trociny
Date: Mon Jun  4 09:22:22 2012
New Revision: 236550
URL: http://svn.freebsd.org/changeset/base/236550

Log:
  On a child exit, call waitpid(2) to clean up the process table.
  
  Submitted by: Andrey Zonov 
  MFC after:1 week

Modified:
  head/usr.sbin/daemon/daemon.c

Modified: head/usr.sbin/daemon/daemon.c
==
--- head/usr.sbin/daemon/daemon.c   Mon Jun  4 08:40:14 2012
(r236549)
+++ head/usr.sbin/daemon/daemon.c   Mon Jun  4 09:22:22 2012
(r236550)
@@ -217,6 +217,10 @@ wait_child(pid_t pid, sigset_t *mask)
}
switch (signo) {
case SIGCHLD:
+   if (waitpid(pid, NULL, WNOHANG) == -1) {
+   warn("waitpid");
+   return (-1);
+   }
return (terminate);
case SIGTERM:
terminate = 1;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r236551 - head/usr.sbin/daemon

2012-06-04 Thread Mikolaj Golub
Author: trociny
Date: Mon Jun  4 09:25:01 2012
New Revision: 236551
URL: http://svn.freebsd.org/changeset/base/236551

Log:
  Document -r option in SYNOPSIS and usage statement.
  
  Submitted by: Andrey Zonov 
  MFC after:3 days

Modified:
  head/usr.sbin/daemon/daemon.8
  head/usr.sbin/daemon/daemon.c

Modified: head/usr.sbin/daemon/daemon.8
==
--- head/usr.sbin/daemon/daemon.8   Mon Jun  4 09:22:22 2012
(r236550)
+++ head/usr.sbin/daemon/daemon.8   Mon Jun  4 09:25:01 2012
(r236551)
@@ -26,7 +26,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd February 19, 2012
+.Dd June 4, 2012
 .Dt DAEMON 8
 .Os
 .Sh NAME
@@ -34,7 +34,7 @@
 .Nd run detached from the controlling terminal
 .Sh SYNOPSIS
 .Nm
-.Op Fl cf
+.Op Fl cfr
 .Op Fl p Ar pidfile
 .Op Fl u Ar user
 .Ar command arguments ...

Modified: head/usr.sbin/daemon/daemon.c
==
--- head/usr.sbin/daemon/daemon.c   Mon Jun  4 09:22:22 2012
(r236550)
+++ head/usr.sbin/daemon/daemon.c   Mon Jun  4 09:25:01 2012
(r236551)
@@ -240,7 +240,7 @@ static void
 usage(void)
 {
(void)fprintf(stderr,
-   "usage: daemon [-cf] [-p pidfile] [-u user] command "
+   "usage: daemon [-cfr] [-p pidfile] [-u user] command "
"arguments ...\n");
exit(1);
 }
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r236552 - head/sys/cam/ata

2012-06-04 Thread Alexander Motin
Author: mav
Date: Mon Jun  4 09:47:19 2012
New Revision: 236552
URL: http://svn.freebsd.org/changeset/base/236552

Log:
  Remove some dead code that I doubt will ever be implemented.

Modified:
  head/sys/cam/ata/ata_xpt.c

Modified: head/sys/cam/ata/ata_xpt.c
==
--- head/sys/cam/ata/ata_xpt.c  Mon Jun  4 09:25:01 2012(r236551)
+++ head/sys/cam/ata/ata_xpt.c  Mon Jun  4 09:47:19 2012(r236552)
@@ -166,8 +166,6 @@ static cam_status   proberegister(struct c
 static void probeschedule(struct cam_periph *probe_periph);
 static void probestart(struct cam_periph *periph, union ccb *start_ccb);
 static void proberequestdefaultnegotiation(struct cam_periph *periph);
-//static int   proberequestbackoff(struct cam_periph *periph,
-//  struct cam_ed *device);
 static void probedone(struct cam_periph *periph, union ccb *done_ccb);
 static void probecleanup(struct cam_periph *periph);
 static void ata_find_quirk(struct cam_ed *device);
@@ -681,112 +679,6 @@ proberequestdefaultnegotiation(struct ca
xpt_action((union ccb *)&cts);
 }
 
-#if 0
-/*
- * Backoff Negotiation Code- only pertinent for SPI devices.
- */
-static int
-proberequestbackoff(struct cam_periph *periph, struct cam_ed *device)
-{
-   struct ccb_trans_settings cts;
-   struct ccb_trans_settings_spi *spi;
-
-   memset(&cts, 0, sizeof (cts));
-   xpt_setup_ccb(&cts.ccb_h, periph->path, CAM_PRIORITY_NONE);
-   cts.ccb_h.func_code = XPT_GET_TRAN_SETTINGS;
-   cts.type = CTS_TYPE_CURRENT_SETTINGS;
-   xpt_action((union ccb *)&cts);
-   if ((cts.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) {
-   if (bootverbose) {
-   xpt_print(periph->path,
-   "failed to get current device settings\n");
-   }
-   return (0);
-   }
-   if (cts.transport != XPORT_SPI) {
-   if (bootverbose) {
-   xpt_print(periph->path, "not SPI transport\n");
-   }
-   return (0);
-   }
-   spi = &cts.xport_specific.spi;
-
-   /*
-* We cannot renegotiate sync rate if we don't have one.
-*/
-   if ((spi->valid & CTS_SPI_VALID_SYNC_RATE) == 0) {
-   if (bootverbose) {
-   xpt_print(periph->path, "no sync rate known\n");
-   }
-   return (0);
-   }
-
-   /*
-* We'll assert that we don't have to touch PPR options- the
-* SIM will see what we do with period and offset and adjust
-* the PPR options as appropriate.
-*/
-
-   /*
-* A sync rate with unknown or zero offset is nonsensical.
-* A sync period of zero means Async.
-*/
-   if ((spi->valid & CTS_SPI_VALID_SYNC_OFFSET) == 0
-|| spi->sync_offset == 0 || spi->sync_period == 0) {
-   if (bootverbose) {
-   xpt_print(periph->path, "no sync rate available\n");
-   }
-   return (0);
-   }
-
-   if (device->flags & CAM_DEV_DV_HIT_BOTTOM) {
-   CAM_DEBUG(periph->path, CAM_DEBUG_INFO,
-   ("hit async: giving up on DV\n"));
-   return (0);
-   }
-
-
-   /*
-* Jump sync_period up by one, but stop at 5MHz and fall back to Async.
-* We don't try to remember 'last' settings to see if the SIM actually
-* gets into the speed we want to set. We check on the SIM telling
-* us that a requested speed is bad, but otherwise don't try and
-* check the speed due to the asynchronous and handshake nature
-* of speed setting.
-*/
-   spi->valid = CTS_SPI_VALID_SYNC_RATE | CTS_SPI_VALID_SYNC_OFFSET;
-   for (;;) {
-   spi->sync_period++;
-   if (spi->sync_period >= 0xf) {
-   spi->sync_period = 0;
-   spi->sync_offset = 0;
-   CAM_DEBUG(periph->path, CAM_DEBUG_INFO,
-   ("setting to async for DV\n"));
-   /*
-* Once we hit async, we don't want to try
-* any more settings.
-*/
-   device->flags |= CAM_DEV_DV_HIT_BOTTOM;
-   } else if (bootverbose) {
-   CAM_DEBUG(periph->path, CAM_DEBUG_INFO,
-   ("DV: period 0x%x\n", spi->sync_period));
-   printf("setting period to 0x%x\n", spi->sync_period);
-   }
-   cts.ccb_h.func_code = XPT_SET_TRAN_SETTINGS;
-   cts.type = CTS_TYPE_CURRENT_SETTINGS;
-   xpt_action((union ccb *)&cts);
-   if ((cts.ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) {
-   break;
-   }
-   CAM_DE

Re: svn commit: r236456 - in head/sys: amd64/include i386/include

2012-06-04 Thread Tijl Coosemans
On 02-06-2012 20:10, Konstantin Belousov wrote:
> Author: kib
> Date: Sat Jun  2 18:10:16 2012
> New Revision: 236456
> URL: http://svn.freebsd.org/changeset/base/236456
> 
> Log:
>   Use plain store for atomic_store_rel on x86, instead of implicitly
>   locked xchg instruction.  IA32 memory model guarantees that store has
>   release semantic, since stores cannot pass loads or stores.

They can pass non-temporal stores can't they?
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r236555 - head/sbin/camcontrol

2012-06-04 Thread Alexander Motin
Author: mav
Date: Mon Jun  4 10:42:09 2012
New Revision: 236555
URL: http://svn.freebsd.org/changeset/base/236555

Log:
  Add -p argument for `camcontrol debug` to allow enabling CAM_DEBUG_PROBE
  added at r208911.

Modified:
  head/sbin/camcontrol/camcontrol.8
  head/sbin/camcontrol/camcontrol.c

Modified: head/sbin/camcontrol/camcontrol.8
==
--- head/sbin/camcontrol/camcontrol.8   Mon Jun  4 10:09:57 2012
(r236554)
+++ head/sbin/camcontrol/camcontrol.8   Mon Jun  4 10:42:09 2012
(r236555)
@@ -27,7 +27,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd November 24, 2011
+.Dd June 4, 2012
 .Dt CAMCONTROL 8
 .Os
 .Sh NAME
@@ -175,6 +175,7 @@
 .Op Fl S
 .Op Fl X
 .Op Fl c
+.Op Fl p
 .Aq all|off|bus Ns Op :target Ns Op :lun
 .Nm
 .Ic tags
@@ -796,6 +797,8 @@ Enable CAM_DEBUG_XPT printfs.
 Enable CAM_DEBUG_CDB printfs.
 This will cause the kernel to print out the
 SCSI CDBs sent to the specified device(s).
+.It Fl p
+Enable CAM_DEBUG_PROBE printfs.
 .It all
 Enable debugging for all devices.
 .It off

Modified: head/sbin/camcontrol/camcontrol.c
==
--- head/sbin/camcontrol/camcontrol.c   Mon Jun  4 10:09:57 2012
(r236554)
+++ head/sbin/camcontrol/camcontrol.c   Mon Jun  4 10:42:09 2012
(r236555)
@@ -123,6 +123,7 @@ typedef enum {
CAM_ARG_DEBUG_CDB   = 0x0800,
CAM_ARG_DEBUG_XPT   = 0x1000,
CAM_ARG_DEBUG_PERIPH= 0x2000,
+   CAM_ARG_DEBUG_PROBE = 0x4000,
 } cam_argmask;
 
 struct camcontrol_opts {
@@ -176,7 +177,7 @@ static struct camcontrol_opts option_tab
{"tags", CAM_CMD_TAG, CAM_ARG_NONE, "N:q"},
{"negotiate", CAM_CMD_RATE, CAM_ARG_NONE, negotiate_opts},
{"rate", CAM_CMD_RATE, CAM_ARG_NONE, negotiate_opts},
-   {"debug", CAM_CMD_DEBUG, CAM_ARG_NONE, "IPTSXc"},
+   {"debug", CAM_CMD_DEBUG, CAM_ARG_NONE, "IPTSXcp"},
{"format", CAM_CMD_FORMAT, CAM_ARG_NONE, "qrwy"},
{"idle", CAM_CMD_IDLE, CAM_ARG_NONE, "t:"},
{"standby", CAM_CMD_STANDBY, CAM_ARG_NONE, "t:"},
@@ -2640,6 +2641,10 @@ camdebug(int argc, char **argv, char *co
arglist |= CAM_ARG_DEBUG_CDB;
ccb.cdbg.flags |= CAM_DEBUG_CDB;
break;
+   case 'p':
+   arglist |= CAM_ARG_DEBUG_PROBE;
+   ccb.cdbg.flags |= CAM_DEBUG_PROBE;
+   break;
default:
break;
}
@@ -2669,7 +2674,7 @@ camdebug(int argc, char **argv, char *co
ccb.cdbg.flags = CAM_DEBUG_NONE;
arglist &= ~(CAM_ARG_DEBUG_INFO|CAM_ARG_DEBUG_PERIPH|
 CAM_ARG_DEBUG_TRACE|CAM_ARG_DEBUG_SUBTRACE|
-CAM_ARG_DEBUG_XPT);
+CAM_ARG_DEBUG_XPT|CAM_ARG_DEBUG_PROBE);
} else if (strncmp(tstr, "all", 3) != 0) {
tmpstr = (char *)strtok(tstr, ":");
if ((tmpstr != NULL) && (*tmpstr != '\0')){
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r236456 - in head/sys: amd64/include i386/include

2012-06-04 Thread David Chisnall
On 4 Jun 2012, at 11:00, Tijl Coosemans wrote:

> On 02-06-2012 20:10, Konstantin Belousov wrote:
>> Author: kib
>> Date: Sat Jun  2 18:10:16 2012
>> New Revision: 236456
>> URL: http://svn.freebsd.org/changeset/base/236456
>> 
>> Log:
>>  Use plain store for atomic_store_rel on x86, instead of implicitly
>>  locked xchg instruction.  IA32 memory model guarantees that store has
>>  release semantic, since stores cannot pass loads or stores.
> 
> They can pass non-temporal stores can't they?

Now that we have support for C11 atomics via stdatomic.h (in current and 
stable), it would be nice to compare their performance with the assembly 
versions.  There is the potential for greater optimisation, because the 
compiler treats any asm block as a full barrier, so only the CPU, not the 
compiler, can reorder loads and stores across it.  With the C11 stuff, on a new 
compiler (clang or gcc 4.7), the compiler can perform any reordering of loads 
and stores that does not violate the semantics specified by the atomic 
operation.

David___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r236559 - head/sys/net

2012-06-04 Thread Alexander V. Chernikov
Author: melifaro
Date: Mon Jun  4 12:36:58 2012
New Revision: 236559
URL: http://svn.freebsd.org/changeset/base/236559

Log:
  Fix panic introduced by r235745. Panic occurs after first packet traverse 
renamed interface.
  Add several comments on locking
  
  Found by: avg
  Approved by:  ae(mentor)
  Tested by:avg
  MFC after:1 week

Modified:
  head/sys/net/bpf.c

Modified: head/sys/net/bpf.c
==
--- head/sys/net/bpf.c  Mon Jun  4 12:28:56 2012(r236558)
+++ head/sys/net/bpf.c  Mon Jun  4 12:36:58 2012(r236559)
@@ -1704,6 +1704,14 @@ bpfioctl(struct cdev *dev, u_long cmd, c
 /*
  * Set d's packet filter program to fp.  If this file already has a filter,
  * free it and replace it.  Returns EINVAL for bogus requests.
+ *
+ * Note we need global lock here to serialize bpf_setf() and bpf_setif() calls
+ * since reading d->bd_bif can't be protected by d or interface lock due to
+ * lock order.
+ *
+ * Additionally, we have to acquire interface write lock due to bpf_mtap() uses
+ * interface read lock to read all filers.
+ *
  */
 static int
 bpf_setf(struct bpf_d *d, struct bpf_program *fp, u_long cmd)
@@ -2535,20 +2543,32 @@ bpfdetach(struct ifnet *ifp)
 }
 
 /*
- * Interface departure handler
+ * Interface departure handler.
+ * Note departure event does not guagantee interface is going down.
  */
 static void
 bpf_ifdetach(void *arg __unused, struct ifnet *ifp)
 {
struct bpf_if *bp;
 
-   if ((bp = ifp->if_bpf) == NULL)
+   BPF_LOCK();
+   if ((bp = ifp->if_bpf) == NULL) {
+   BPF_UNLOCK();
+   return;
+   }
+
+   /* Check if bpfdetach() was called previously */
+   if ((bp->flags & BPFIF_FLAG_DYING) == 0) {
+   BPF_UNLOCK();
return;
+   }
 
CTR3(KTR_NET, "%s: freing BPF instance %p for interface %p",
__func__, bp, ifp);
 
ifp->if_bpf = NULL;
+   BPF_UNLOCK();
+
rw_destroy(&bp->bif_lock);
free(bp, M_BPF);
 }
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r236560 - head/sys/kern

2012-06-04 Thread Gleb Smirnoff
Author: glebius
Date: Mon Jun  4 12:49:21 2012
New Revision: 236560
URL: http://svn.freebsd.org/changeset/base/236560

Log:
  Optimise kern_sendfile(): skip cycling through the entire mbuf chain in
  m_cat(), storing pointer to last mbuf in chain in local variable and
  attaching new mbuf to the end of chain.
  
  Submitter reports that CPU load dropped for > 10% on a web server
  serving large files with this optimisation.
  
  Submitted by: Sergey Budnevitch 

Modified:
  head/sys/kern/uipc_syscalls.c

Modified: head/sys/kern/uipc_syscalls.c
==
--- head/sys/kern/uipc_syscalls.c   Mon Jun  4 12:36:58 2012
(r236559)
+++ head/sys/kern/uipc_syscalls.c   Mon Jun  4 12:49:21 2012
(r236560)
@@ -1962,6 +1962,7 @@ kern_sendfile(struct thread *td, struct 
 * and takes care of the overall progress.
 */
for (off = uap->offset, rem = uap->nbytes; ; ) {
+   struct mbuf *mtail = NULL;
int loopbytes = 0;
int space = 0;
int done = 0;
@@ -2181,10 +2182,15 @@ retry_space:
m0->m_len = xfsize;
 
/* Append to mbuf chain. */
-   if (m != NULL)
-   m_cat(m, m0);
-   else
-   m = m0;
+   if (mtail != NULL) {
+   mtail->m_next = m0;
+   } else {
+   if (m != NULL)
+   m_cat(m, m0);
+   else
+   m = m0;
+   }
+   mtail = m0;
 
/* Keep track of bits processed. */
loopbytes += xfsize;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r236456 - in head/sys: amd64/include i386/include

2012-06-04 Thread Konstantin Belousov
On Mon, Jun 04, 2012 at 12:00:27PM +0200, Tijl Coosemans wrote:
> On 02-06-2012 20:10, Konstantin Belousov wrote:
> > Author: kib
> > Date: Sat Jun  2 18:10:16 2012
> > New Revision: 236456
> > URL: http://svn.freebsd.org/changeset/base/236456
> > 
> > Log:
> >   Use plain store for atomic_store_rel on x86, instead of implicitly
> >   locked xchg instruction.  IA32 memory model guarantees that store has
> >   release semantic, since stores cannot pass loads or stores.
> 
> They can pass non-temporal stores can't they?
Sure. But (our) barriers only work for WB memory accesses, in respect to other
WB memory accesses.

The atomic(9) contains not quite explicit mention of the requirement,
for ia32 and more direct notion for ia64. It could probably be reworded to
mention memory access type explicitely for ia32 too.

At least the code which I saw and maintain which uses the mixed accesses
to the same physical page, sometime including non-CPU caches coherency
protocols, use explicit {s,m}fence barriers as needed.


pgpLdICJDfzO6.pgp
Description: PGP signature


Re: svn commit: r236456 - in head/sys: amd64/include i386/include

2012-06-04 Thread Attilio Rao
2012/6/4 Konstantin Belousov :
> On Mon, Jun 04, 2012 at 12:00:27PM +0200, Tijl Coosemans wrote:
>> On 02-06-2012 20:10, Konstantin Belousov wrote:
>> > Author: kib
>> > Date: Sat Jun  2 18:10:16 2012
>> > New Revision: 236456
>> > URL: http://svn.freebsd.org/changeset/base/236456
>> >
>> > Log:
>> >   Use plain store for atomic_store_rel on x86, instead of implicitly
>> >   locked xchg instruction.  IA32 memory model guarantees that store has
>> >   release semantic, since stores cannot pass loads or stores.
>>
>> They can pass non-temporal stores can't they?
> Sure. But (our) barriers only work for WB memory accesses, in respect to other
> WB memory accesses.
>
> The atomic(9) contains not quite explicit mention of the requirement,
> for ia32 and more direct notion for ia64. It could probably be reworded to
> mention memory access type explicitely for ia32 too.

I don't think this is right.
What if I want to use NTI in a block of code locked? What if I want to
use CLFLUSH? I simply cannot do that now because of the reordering
requirement.
Also, there is the more worrisome case of the string operations. If
gcc/clang optimize the code in order to do string operations between
locked path, this is not valid anymore as they can be reordered
against the _rel() barrier.

However, we should consider atomic(9) as a script for MI requirement
of our locking primitives among the architectures. Right now too many
things live on assumptions of people doing patches (like this case)
rather than actually working on a common policy of what we can easilly
support and what we can't.

I also wondered often if we should use *fence on architectures
supporting them, by default, because of the possibility to use FPU now
(which wasn't present back in the day) and thus we cannot really
guarantee memory ordering over stores of memory areas bigger than a
quad-word. If we don't want to add the burden, we should explicitely
mention that in atomic(9) or any other place.

Definitively: I think this patch violates some edge cases. Please back it out.

Attilio


-- 
Peace can only be achieved by understanding - A. Einstein
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r236562 - stable/9/lib/libc/stdio

2012-06-04 Thread Isabell Long
Author: issyl0 (doc committer)
Date: Mon Jun  4 14:11:49 2012
New Revision: 236562
URL: http://svn.freebsd.org/changeset/base/236562

Log:
  Merge r235848 from head to stable/9:
Add two new locale-specific man pages:
- libc/stdio/scanf_l.3
- libc/stdio/printf_l.3
  
  Approved by:  gabor (mentor)

Added:
  stable/9/lib/libc/stdio/printf_l.3
 - copied unchanged from r235848, head/lib/libc/stdio/printf_l.3
  stable/9/lib/libc/stdio/scanf_l.3
 - copied unchanged from r235848, head/lib/libc/stdio/scanf_l.3
Modified:
  stable/9/lib/libc/stdio/Makefile.inc
Directory Properties:
  stable/9/lib/libc/   (props changed)

Modified: stable/9/lib/libc/stdio/Makefile.inc
==
--- stable/9/lib/libc/stdio/Makefile.incMon Jun  4 13:41:22 2012
(r236561)
+++ stable/9/lib/libc/stdio/Makefile.incMon Jun  4 14:11:49 2012
(r236562)
@@ -36,7 +36,8 @@ MAN+= fclose.3 ferror.3 fflush.3 fgetln.
fopen.3 fputs.3 \
fputws.3 fread.3 fseek.3 funopen.3 fwide.3 getc.3 \
getline.3 getwc.3 mktemp.3 \
-   printf.3 putc.3 putwc.3 remove.3 scanf.3 setbuf.3 stdio.3 tmpnam.3 \
+   printf.3 printf_l.3 putc.3 putwc.3 remove.3 scanf.3 scanf_l.3 setbuf.3 \
+   stdio.3 tmpnam.3 \
ungetc.3 ungetwc.3 wprintf.3 wscanf.3
 
 MLINKS+=fclose.3 fcloseall.3
@@ -63,11 +64,16 @@ MLINKS+=printf.3 asprintf.3 printf.3 dpr
printf.3 vasprintf.3 printf.3 vdprintf.3 \
printf.3 vfprintf.3 printf.3 vprintf.3 printf.3 vsnprintf.3 \
printf.3 vsprintf.3
+MLINKS+=printf_l.3 asprintf_l.3 printf_l.3 fprintf_l.3 printf_l.3 snprintf_l.3 
\
+   printf_l.3 sprintf_l.3 printf_l.3 vasprintf_l.3 printf_l.3 vfprintf_l.3 
\
+   printf_l.3 vprintf_l.3 printf_l.3 vsnprintf_l.3 printf_l.3 vsprintf_l.3
 MLINKS+=putc.3 fputc.3 putc.3 putc_unlocked.3 putc.3 putchar.3 \
putc.3 putchar_unlocked.3 putc.3 putw.3
 MLINKS+=putwc.3 fputwc.3 putwc.3 putwchar.3
 MLINKS+=scanf.3 fscanf.3 scanf.3 sscanf.3 scanf.3 vfscanf.3 scanf.3 vscanf.3 \
scanf.3 vsscanf.3
+MLINKS+=scanf_l.3 fscanf_l.3 scanf_l.3 sscanf_l.3 scanf_l.3 vfscanf_l.3 \
+   scanf_l.3 vscanf_l.3 scanf_l.3 vsscanf_l.3
 MLINKS+=setbuf.3 setbuffer.3 setbuf.3 setlinebuf.3 setbuf.3 setvbuf.3
 MLINKS+=tmpnam.3 tempnam.3 tmpnam.3 tmpfile.3
 MLINKS+=wprintf.3 fwprintf.3 wprintf.3 swprintf.3 \

Copied: stable/9/lib/libc/stdio/printf_l.3 (from r235848, 
head/lib/libc/stdio/printf_l.3)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ stable/9/lib/libc/stdio/printf_l.3  Mon Jun  4 14:11:49 2012
(r236562, copy of r235848, head/lib/libc/stdio/printf_l.3)
@@ -0,0 +1,80 @@
+.\" Copyright (c) 2012 Isabell Long 
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"notice, this list of conditions and the following disclaimer in the
+.\"documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd April 7, 2012
+.Dt PRINTF_L 3
+.Os
+.Sh NAME
+.Nm printf_l ,
+.Nm asprintf_l ,
+.Nm fprintf_l ,
+.Nm snprintf_l ,
+.Nm sprintf_l ,
+.Nm vasprintf_l ,
+.Nm vfprintf_l ,
+.Nm vprintf_l ,
+.Nm vsnprintf_l ,
+.Nm vsprintf_l
+.Nd formatted output conversion
+.Sh LIBRARY
+.Lb libc
+.Sh SYNOPSIS
+.In stdio.h
+.Ft int
+.Fn printf_l "locale_t loc" "const char * restrict format" "..."
+.Ft int
+.Fn asprintf_l "char **ret" "locale_t loc" "const char * format" "..."
+.Ft int
+.Fn fprintf_l "FILE * restrict stream" "locale_t loc" "const char * restrict 
format" "..."
+.Ft int
+.Fn snprintf_l "char * restrict str" "size_t size" "locale_t loc" "const char 
* restrict format" "..."
+.Ft int
+.Fn sprintf_l "char * restrict str" "locale_t loc" "const char * restrict 
format" "..."
+.F

svn commit: r236563 - head/sys/kern

2012-06-04 Thread Gleb Smirnoff
Author: glebius
Date: Mon Jun  4 14:18:13 2012
New Revision: 236563
URL: http://svn.freebsd.org/changeset/base/236563

Log:
  Microoptimisation of code from r236560, also coming from Nginx Inc.
  
  Submitted by: ru

Modified:
  head/sys/kern/uipc_syscalls.c

Modified: head/sys/kern/uipc_syscalls.c
==
--- head/sys/kern/uipc_syscalls.c   Mon Jun  4 14:11:49 2012
(r236562)
+++ head/sys/kern/uipc_syscalls.c   Mon Jun  4 14:18:13 2012
(r236563)
@@ -2184,12 +2184,10 @@ retry_space:
/* Append to mbuf chain. */
if (mtail != NULL) {
mtail->m_next = m0;
-   } else {
-   if (m != NULL)
-   m_cat(m, m0);
-   else
-   m = m0;
-   }
+   } else if (m != NULL)
+   m_last(m)->m_next = m0;
+   else
+   m = m0;
mtail = m0;
 
/* Keep track of bits processed. */
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r236564 - svnadmin/conf

2012-06-04 Thread Edward Tomasz Napierala
Author: trasz
Date: Mon Jun  4 14:26:05 2012
New Revision: 236564
URL: http://svn.freebsd.org/changeset/base/236564

Log:
  Please welcome Mateusz Guzik (mjg) as a new src committer.  I'll be
  mentoring him.  Mateusz will work on general bugfixing in various areas
  of the kernel.
  
  Approved by:  core

Modified:
  svnadmin/conf/access
  svnadmin/conf/mentors

Modified: svnadmin/conf/access
==
--- svnadmin/conf/accessMon Jun  4 14:18:13 2012(r236563)
+++ svnadmin/conf/accessMon Jun  4 14:26:05 2012(r236564)
@@ -168,6 +168,7 @@ mdodd
 melifaro
 miwi
 mjacob
+mjg
 mlaier
 mm
 mohans

Modified: svnadmin/conf/mentors
==
--- svnadmin/conf/mentors   Mon Jun  4 14:18:13 2012(r236563)
+++ svnadmin/conf/mentors   Mon Jun  4 14:26:05 2012(r236564)
@@ -27,6 +27,7 @@ jwd   rmacklem
 kargl  das
 melifaro   ae  Co-mentor: kib
 miwi   rwatson
+mjgtrasz
 monthadar  adrian
 nork   imp
 pfgjhb
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r236456 - in head/sys: amd64/include i386/include

2012-06-04 Thread Konstantin Belousov
On Mon, Jun 04, 2012 at 02:58:57PM +0100, Attilio Rao wrote:
> 2012/6/4 Konstantin Belousov :
> > On Mon, Jun 04, 2012 at 12:00:27PM +0200, Tijl Coosemans wrote:
> >> On 02-06-2012 20:10, Konstantin Belousov wrote:
> >> > Author: kib
> >> > Date: Sat Jun  2 18:10:16 2012
> >> > New Revision: 236456
> >> > URL: http://svn.freebsd.org/changeset/base/236456
> >> >
> >> > Log:
> >> >   Use plain store for atomic_store_rel on x86, instead of implicitly
> >> >   locked xchg instruction.  IA32 memory model guarantees that store has
> >> >   release semantic, since stores cannot pass loads or stores.
> >>
> >> They can pass non-temporal stores can't they?
> > Sure. But (our) barriers only work for WB memory accesses, in respect to 
> > other
> > WB memory accesses.
> >
> > The atomic(9) contains not quite explicit mention of the requirement,
> > for ia32 and more direct notion for ia64. It could probably be reworded to
> > mention memory access type explicitely for ia32 too.
> 
> I don't think this is right.
> What if I want to use NTI in a block of code locked? What if I want to
> use CLFLUSH? I simply cannot do that now because of the reordering
> requirement.
Assuming that NTI means "Non Temporal Instruction", Intel explicit
requirement is to use fence barrier if order shall be ensured. This,
as well as CLFLUSH use, is somewhat commonly documented. More, CLFLUSH
is documented by Intel to _not_ serialize with any other fencing or
serialization instruction, except MFENCE. So xchg-based _store_rel is
not different from mov-based _store_rel for CLFLUSH and non-temporal
ops.

I do not see how you note is relevant.

> Also, there is the more worrisome case of the string operations. If
> gcc/clang optimize the code in order to do string operations between
> locked path, this is not valid anymore as they can be reordered
> against the _rel() barrier.
They cannot. Fast string operation volatile store order only among
string operation itself, the operation cannot pass sequential store.
The store used in _store_rel thus cannot be passed by fast string
optimizations.

I do not see how you note is relevant there, again.

> 
> However, we should consider atomic(9) as a script for MI requirement
> of our locking primitives among the architectures. Right now too many
> things live on assumptions of people doing patches (like this case)
> rather than actually working on a common policy of what we can easilly
> support and what we can't.
> 
> I also wondered often if we should use *fence on architectures
> supporting them, by default, because of the possibility to use FPU now
> (which wasn't present back in the day) and thus we cannot really
> guarantee memory ordering over stores of memory areas bigger than a
> quad-word. If we don't want to add the burden, we should explicitely
> mention that in atomic(9) or any other place.
The proposal to use fence explicitely contradicts recommendations from
the AMD Optimization Guide, which, JFYI, I cited in the updated comment
in the patch.

How is FPU relevant to the memory model discussion, I left out of the
answer.

> 
> Definitively: I think this patch violates some edge cases. Please back it out.
No. I explicitely inform you that I consider the backout request
as frivolous, technically unfounded, and that I will not back it out.




pgpjMs1K0EqY2.pgp
Description: PGP signature


svn commit: r236565 - head/share/misc

2012-06-04 Thread Mateusz Guzik
Author: mjg
Date: Mon Jun  4 15:21:13 2012
New Revision: 236565
URL: http://svn.freebsd.org/changeset/base/236565

Log:
  Add myself as a new committer.
  
  Approved by:  trasz (mentor)

Modified:
  head/share/misc/committers-src.dot

Modified: head/share/misc/committers-src.dot
==
--- head/share/misc/committers-src.dot  Mon Jun  4 14:26:05 2012
(r236564)
+++ head/share/misc/committers-src.dot  Mon Jun  4 15:21:13 2012
(r236565)
@@ -200,6 +200,7 @@ mdf [label="Matthew Fleming\nmdf@FreeBSD
 mdodd [label="Matthew N. Dodd\nmd...@freebsd.org\n1999/07/27"]
 melifaro [label="Alexander V. Chernikov\nmelif...@freebsd.org\n2011/10/04"]
 mjacob [label="Matt Jacob\nmja...@freebsd.org\n1997/08/13"]
+mjg [label="Mateusz Guzik\n...@freebsd.org\n2012/06/04"]
 mlaier [label="Max Laier\nmla...@freebsd.org\n2004/02/10"]
 monthadar [label="Monthadar Al Jaberi\nmontha...@freebsd.org\n2012/04/02"]
 mr [label="Michael Reifenberger\n...@freebsd.org\n2001/09/30"]
@@ -602,6 +603,7 @@ thompsa -> weongyo
 thompsa -> eri
 
 trasz -> jh
+trasz -> mjg
 
 ume -> jinmei
 ume -> suz
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r236456 - in head/sys: amd64/include i386/include

2012-06-04 Thread Attilio Rao
2012/6/4 Konstantin Belousov :
> On Mon, Jun 04, 2012 at 02:58:57PM +0100, Attilio Rao wrote:
>> 2012/6/4 Konstantin Belousov :
>> > On Mon, Jun 04, 2012 at 12:00:27PM +0200, Tijl Coosemans wrote:
>> >> On 02-06-2012 20:10, Konstantin Belousov wrote:
>> >> > Author: kib
>> >> > Date: Sat Jun  2 18:10:16 2012
>> >> > New Revision: 236456
>> >> > URL: http://svn.freebsd.org/changeset/base/236456
>> >> >
>> >> > Log:
>> >> >   Use plain store for atomic_store_rel on x86, instead of implicitly
>> >> >   locked xchg instruction.  IA32 memory model guarantees that store has
>> >> >   release semantic, since stores cannot pass loads or stores.
>> >>
>> >> They can pass non-temporal stores can't they?
>> > Sure. But (our) barriers only work for WB memory accesses, in respect to 
>> > other
>> > WB memory accesses.
>> >
>> > The atomic(9) contains not quite explicit mention of the requirement,
>> > for ia32 and more direct notion for ia64. It could probably be reworded to
>> > mention memory access type explicitely for ia32 too.
>>
>> I don't think this is right.
>> What if I want to use NTI in a block of code locked? What if I want to
>> use CLFLUSH? I simply cannot do that now because of the reordering
>> requirement.
> Assuming that NTI means "Non Temporal Instruction", Intel explicit
> requirement is to use fence barrier if order shall be ensured. This,
> as well as CLFLUSH use, is somewhat commonly documented. More, CLFLUSH
> is documented by Intel to _not_ serialize with any other fencing or
> serialization instruction, except MFENCE. So xchg-based _store_rel is
> not different from mov-based _store_rel for CLFLUSH and non-temporal
> ops.
>
> I do not see how you note is relevant.
>
>> Also, there is the more worrisome case of the string operations. If
>> gcc/clang optimize the code in order to do string operations between
>> locked path, this is not valid anymore as they can be reordered
>> against the _rel() barrier.
> They cannot. Fast string operation volatile store order only among
> string operation itself, the operation cannot pass sequential store.
> The store used in _store_rel thus cannot be passed by fast string
> optimizations.
>
> I do not see how you note is relevant there, again.

I'm not sure why but I thought that the string writes could be
re-ordered against "external" writes too, but  I re-read the manual
and this is not the case.

>
>>
>> However, we should consider atomic(9) as a script for MI requirement
>> of our locking primitives among the architectures. Right now too many
>> things live on assumptions of people doing patches (like this case)
>> rather than actually working on a common policy of what we can easilly
>> support and what we can't.
>>
>> I also wondered often if we should use *fence on architectures
>> supporting them, by default, because of the possibility to use FPU now
>> (which wasn't present back in the day) and thus we cannot really
>> guarantee memory ordering over stores of memory areas bigger than a
>> quad-word. If we don't want to add the burden, we should explicitely
>> mention that in atomic(9) or any other place.
> The proposal to use fence explicitely contradicts recommendations from
> the AMD Optimization Guide, which, JFYI, I cited in the updated comment
> in the patch.
>
> How is FPU relevant to the memory model discussion, I left out of the
> answer.

I'm not saying to use *fence, I'm saying that we should document MD
cases where this is required (we can use agnostic terms like "simple
barrier") in atomic(9).
Also, about FPU, I'm saying that before we had no need to consider
FPU/XMM into consideration from a model perspective but now we should
do that because we can use FPU within the kernel.

>> Definitively: I think this patch violates some edge cases. Please back it 
>> out.
> No. I explicitely inform you that I consider the backout request
> as frivolous, technically unfounded, and that I will not back it out.

My main motivation for asking the backout was for the ordering issue
with the string operations, but it doesn't seem to be the case, than I
withdraw my request, sorry.
I'm fine with using explicit memory barriers in MD code that use NTI
(I just assume gcc/clang won't over-optimize things on their own as
thinking they want to reduce cache traffic by using NTI).

Attilio


-- 
Peace can only be achieved by understanding - A. Einstein
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r236566 - in head/sys/cddl/dev/dtrace: amd64 i386

2012-06-04 Thread Zachary Loafman
Author: zml
Date: Mon Jun  4 16:04:01 2012
New Revision: 236566
URL: http://svn.freebsd.org/changeset/base/236566

Log:
  Fix DTrace TSC skew calculation:
  
  The skew calculation here is exactly backwards. We were able to repro
  it on a multi-package ESX server running a FreeBSD VM, where the TSCs
  can be pretty evil.
  
  MFC after: 1 week
  
  Submitted by: Jeff Ford 
  Reviewed by: avg, gnn

Modified:
  head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c
  head/sys/cddl/dev/dtrace/i386/dtrace_subr.c

Modified: head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c
==
--- head/sys/cddl/dev/dtrace/amd64/dtrace_subr.cMon Jun  4 15:21:13 
2012(r236565)
+++ head/sys/cddl/dev/dtrace/amd64/dtrace_subr.cMon Jun  4 16:04:01 
2012(r236566)
@@ -446,7 +446,7 @@ dtrace_gethrtime()
 * (see nsec_scale calculations) taking into account 32-bit shift of
 * the higher half and finally add.
 */
-   tsc = rdtsc() + tsc_skew[curcpu];
+   tsc = rdtsc() - tsc_skew[curcpu];
lo = tsc;
hi = tsc >> 32;
return (((lo * nsec_scale) >> SCALE_SHIFT) +

Modified: head/sys/cddl/dev/dtrace/i386/dtrace_subr.c
==
--- head/sys/cddl/dev/dtrace/i386/dtrace_subr.c Mon Jun  4 15:21:13 2012
(r236565)
+++ head/sys/cddl/dev/dtrace/i386/dtrace_subr.c Mon Jun  4 16:04:01 2012
(r236566)
@@ -447,7 +447,7 @@ dtrace_gethrtime()
 * (see nsec_scale calculations) taking into account 32-bit shift of
 * the higher half and finally add.
 */
-   tsc = rdtsc() + tsc_skew[curcpu];
+   tsc = rdtsc() - tsc_skew[curcpu];
lo = tsc;
hi = tsc >> 32;
return (((lo * nsec_scale) >> SCALE_SHIFT) +
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r236567 - in head/sys/cddl/dev/dtrace: amd64 i386

2012-06-04 Thread George V. Neville-Neil
Author: gnn
Date: Mon Jun  4 16:15:40 2012
New Revision: 236567
URL: http://svn.freebsd.org/changeset/base/236567

Log:
  Integrate a fix for a very odd signal delivery problem found
  by Bryan Cantril and others in the Solaris/Illumos version of DTrace.
  
  Obtained from: https://www.illumos.org/issues/789
  MFC after:2 weeks

Modified:
  head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c
  head/sys/cddl/dev/dtrace/i386/dtrace_subr.c

Modified: head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c
==
--- head/sys/cddl/dev/dtrace/amd64/dtrace_subr.cMon Jun  4 16:04:01 
2012(r236566)
+++ head/sys/cddl/dev/dtrace/amd64/dtrace_subr.cMon Jun  4 16:15:40 
2012(r236567)
@@ -27,6 +27,10 @@
  * Use is subject to license terms.
  */
 
+/*
+ * Copyright (c) 2011, Joyent, Inc. All rights reserved.
+ */
+
 #include 
 #include 
 #include 
@@ -297,14 +301,15 @@ dtrace_safe_defer_signal(void)
}
 
/*
-* If we've executed the original instruction, but haven't performed
-* the jmp back to t->t_dtrace_npc or the clean up of any registers
-* used to emulate %rip-relative instructions in 64-bit mode, do that
-* here and take the signal right away. We detect this condition by
-* seeing if the program counter is the range [scrpc + isz, astpc).
+* If we have executed the original instruction, but we have performed
+* neither the jmp back to t->t_dtrace_npc nor the clean up of any
+* registers used to emulate %rip-relative instructions in 64-bit mode,
+* we'll save ourselves some effort by doing that here and taking the
+* signal right away.  We detect this condition by seeing if the program
+* counter is the range [scrpc + isz, astpc).
 */
-   if (t->t_dtrace_astpc - rp->r_pc <
-   t->t_dtrace_astpc - t->t_dtrace_scrpc - isz) {
+   if (rp->r_pc >= t->t_dtrace_scrpc + isz &&
+   rp->r_pc < t->t_dtrace_astpc) {
 #ifdef __amd64
/*
 * If there is a scratch register and we're on the

Modified: head/sys/cddl/dev/dtrace/i386/dtrace_subr.c
==
--- head/sys/cddl/dev/dtrace/i386/dtrace_subr.c Mon Jun  4 16:04:01 2012
(r236566)
+++ head/sys/cddl/dev/dtrace/i386/dtrace_subr.c Mon Jun  4 16:15:40 2012
(r236567)
@@ -27,6 +27,10 @@
  * Use is subject to license terms.
  */
 
+/*
+ * Copyright (c) 2011, Joyent, Inc. All rights reserved.
+ */
+
 #include 
 #include 
 #include 
@@ -298,14 +302,15 @@ dtrace_safe_defer_signal(void)
}
 
/*
-* If we've executed the original instruction, but haven't performed
-* the jmp back to t->t_dtrace_npc or the clean up of any registers
-* used to emulate %rip-relative instructions in 64-bit mode, do that
-* here and take the signal right away. We detect this condition by
-* seeing if the program counter is the range [scrpc + isz, astpc).
+* If we have executed the original instruction, but we have performed
+* neither the jmp back to t->t_dtrace_npc nor the clean up of any
+* registers used to emulate %rip-relative instructions in 64-bit mode,
+* we'll save ourselves some effort by doing that here and taking the
+* signal right away.  We detect this condition by seeing if the program
+* counter is the range [scrpc + isz, astpc).
 */
-   if (t->t_dtrace_astpc - rp->r_pc <
-   t->t_dtrace_astpc - t->t_dtrace_scrpc - isz) {
+   if (rp->r_pc >= t->t_dtrace_scrpc + isz &&
+   rp->r_pc < t->t_dtrace_astpc) {
 #ifdef __amd64
/*
 * If there is a scratch register and we're on the
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r236567 - in head/sys/cddl/dev/dtrace: amd64 i386

2012-06-04 Thread Pedro Giffuni

On 06/04/12 11:15, George V. Neville-Neil wrote:

Author: gnn
Date: Mon Jun  4 16:15:40 2012
New Revision: 236567
URL: http://svn.freebsd.org/changeset/base/236567

Log:
   Integrate a fix for a very odd signal delivery problem found
   by Bryan Cantril and others in the Solaris/Illumos version of DTrace.

   Obtained from: https://www.illumos.org/issues/789
   MFC after:   2 weeks


And it looks like kern/164724 :)

cheers,

Pedro.


Modified:
   head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c
   head/sys/cddl/dev/dtrace/i386/dtrace_subr.c

Modified: head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c
==
--- head/sys/cddl/dev/dtrace/amd64/dtrace_subr.cMon Jun  4 16:04:01 
2012(r236566)
+++ head/sys/cddl/dev/dtrace/amd64/dtrace_subr.cMon Jun  4 16:15:40 
2012(r236567)
@@ -27,6 +27,10 @@
   * Use is subject to license terms.
   */

+/*
+ * Copyright (c) 2011, Joyent, Inc. All rights reserved.
+ */
+
  #include
  #include
  #include
@@ -297,14 +301,15 @@ dtrace_safe_defer_signal(void)
}

/*
-* If we've executed the original instruction, but haven't performed
-* the jmp back to t->t_dtrace_npc or the clean up of any registers
-* used to emulate %rip-relative instructions in 64-bit mode, do that
-* here and take the signal right away. We detect this condition by
-* seeing if the program counter is the range [scrpc + isz, astpc).
+* If we have executed the original instruction, but we have performed
+* neither the jmp back to t->t_dtrace_npc nor the clean up of any
+* registers used to emulate %rip-relative instructions in 64-bit mode,
+* we'll save ourselves some effort by doing that here and taking the
+* signal right away.  We detect this condition by seeing if the program
+* counter is the range [scrpc + isz, astpc).
 */
-   if (t->t_dtrace_astpc - rp->r_pc<
-   t->t_dtrace_astpc - t->t_dtrace_scrpc - isz) {
+   if (rp->r_pc>= t->t_dtrace_scrpc + isz&&
+   rp->r_pc<  t->t_dtrace_astpc) {
  #ifdef __amd64
/*
 * If there is a scratch register and we're on the

Modified: head/sys/cddl/dev/dtrace/i386/dtrace_subr.c
==
--- head/sys/cddl/dev/dtrace/i386/dtrace_subr.c Mon Jun  4 16:04:01 2012
(r236566)
+++ head/sys/cddl/dev/dtrace/i386/dtrace_subr.c Mon Jun  4 16:15:40 2012
(r236567)
@@ -27,6 +27,10 @@
   * Use is subject to license terms.
   */

+/*
+ * Copyright (c) 2011, Joyent, Inc. All rights reserved.
+ */
+
  #include
  #include
  #include
@@ -298,14 +302,15 @@ dtrace_safe_defer_signal(void)
}

/*
-* If we've executed the original instruction, but haven't performed
-* the jmp back to t->t_dtrace_npc or the clean up of any registers
-* used to emulate %rip-relative instructions in 64-bit mode, do that
-* here and take the signal right away. We detect this condition by
-* seeing if the program counter is the range [scrpc + isz, astpc).
+* If we have executed the original instruction, but we have performed
+* neither the jmp back to t->t_dtrace_npc nor the clean up of any
+* registers used to emulate %rip-relative instructions in 64-bit mode,
+* we'll save ourselves some effort by doing that here and taking the
+* signal right away.  We detect this condition by seeing if the program
+* counter is the range [scrpc + isz, astpc).
 */
-   if (t->t_dtrace_astpc - rp->r_pc<
-   t->t_dtrace_astpc - t->t_dtrace_scrpc - isz) {
+   if (rp->r_pc>= t->t_dtrace_scrpc + isz&&
+   rp->r_pc<  t->t_dtrace_astpc) {
  #ifdef __amd64
/*
 * If there is a scratch register and we're on the


___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r236571 - head/sys/dev/aic7xxx/aicasm

2012-06-04 Thread Dimitry Andric
Author: dim
Date: Mon Jun  4 17:22:43 2012
New Revision: 236571
URL: http://svn.freebsd.org/changeset/base/236571

Log:
  Make aicasm compile without warnings if -Wpointer-sign is enabled.
  
  MFC after:3 days

Modified:
  head/sys/dev/aic7xxx/aicasm/aicasm.c

Modified: head/sys/dev/aic7xxx/aicasm/aicasm.c
==
--- head/sys/dev/aic7xxx/aicasm/aicasm.cMon Jun  4 17:13:32 2012
(r236570)
+++ head/sys/dev/aic7xxx/aicasm/aicasm.cMon Jun  4 17:22:43 2012
(r236571)
@@ -530,7 +530,7 @@ output_listing(char *ifilename)
int instrptr;
unsigned int line;
int func_count;
-   int skip_addr;
+   unsigned int skip_addr;
 
instrcount = 0;
instrptr = 0;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r236456 - in head/sys: amd64/include i386/include

2012-06-04 Thread John Baldwin
On Monday, June 04, 2012 10:27:49 am Konstantin Belousov wrote:
> On Mon, Jun 04, 2012 at 02:58:57PM +0100, Attilio Rao wrote:
> > 2012/6/4 Konstantin Belousov :
> > > On Mon, Jun 04, 2012 at 12:00:27PM +0200, Tijl Coosemans wrote:
> > >> On 02-06-2012 20:10, Konstantin Belousov wrote:
> > >> > Author: kib
> > >> > Date: Sat Jun  2 18:10:16 2012
> > >> > New Revision: 236456
> > >> > URL: http://svn.freebsd.org/changeset/base/236456
> > >> >
> > >> > Log:
> > >> >   Use plain store for atomic_store_rel on x86, instead of implicitly
> > >> >   locked xchg instruction.  IA32 memory model guarantees that store has
> > >> >   release semantic, since stores cannot pass loads or stores.
> > >>
> > >> They can pass non-temporal stores can't they?
> > > Sure. But (our) barriers only work for WB memory accesses, in respect to 
> > > other
> > > WB memory accesses.
> > >
> > > The atomic(9) contains not quite explicit mention of the requirement,
> > > for ia32 and more direct notion for ia64. It could probably be reworded to
> > > mention memory access type explicitely for ia32 too.
> > 
> > I don't think this is right.
> > What if I want to use NTI in a block of code locked? What if I want to
> > use CLFLUSH? I simply cannot do that now because of the reordering
> > requirement.
> Assuming that NTI means "Non Temporal Instruction", Intel explicit
> requirement is to use fence barrier if order shall be ensured. This,
> as well as CLFLUSH use, is somewhat commonly documented. More, CLFLUSH
> is documented by Intel to _not_ serialize with any other fencing or
> serialization instruction, except MFENCE. So xchg-based _store_rel is
> not different from mov-based _store_rel for CLFLUSH and non-temporal
> ops.

I agree, having recently worked with movnt at work, if you are going to
use these instructions, you will need to use your own explicit fences.

No code should depend on implict barriers in locking primitives for working
with movnt.

-- 
John Baldwin
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r236572 - head/usr.sbin/inetd

2012-06-04 Thread Xin LI
Author: delphij
Date: Mon Jun  4 18:02:09 2012
New Revision: 236572
URL: http://svn.freebsd.org/changeset/base/236572

Log:
  Replace the use of wall clock time with monotonically increasing
  clock.  In general, gettimeofday() is not appropriate interface
  when accounting for elasped time because it can go backward, in
  which case the policy code could errornously consider the limit
  as exceeded.
  
  MFC after:1 week
  Reported by:  Mahesh Arumugam
  Submitted by: Dorr H. Clark via gnn
  Sponsored by: Citrix / NetScaler

Modified:
  head/usr.sbin/inetd/inetd.c
  head/usr.sbin/inetd/inetd.h

Modified: head/usr.sbin/inetd/inetd.c
==
--- head/usr.sbin/inetd/inetd.c Mon Jun  4 17:22:43 2012(r236571)
+++ head/usr.sbin/inetd/inetd.c Mon Jun  4 18:02:09 2012(r236572)
@@ -688,11 +688,11 @@ main(int argc, char **argv)
 */
if (dofork) {
if (sep->se_count++ == 0)
-   (void)gettimeofday(&sep->se_time, (struct 
timezone *)NULL);
+   (void)clock_gettime(CLOCK_MONOTONIC_FAST, 
&sep->se_time);
else if (toomany > 0 && sep->se_count >= toomany) {
-   struct timeval now;
+   struct timespec now;
 
-   (void)gettimeofday(&now, (struct timezone 
*)NULL);
+   (void)clock_gettime(CLOCK_MONOTONIC_FAST, &now);
if (now.tv_sec - sep->se_time.tv_sec >
CNT_INTVL) {
sep->se_time = now;

Modified: head/usr.sbin/inetd/inetd.h
==
--- head/usr.sbin/inetd/inetd.h Mon Jun  4 17:22:43 2012(r236571)
+++ head/usr.sbin/inetd/inetd.h Mon Jun  4 18:02:09 2012(r236572)
@@ -109,7 +109,7 @@ struct  servtab {
u_int   se_rpc_lowvers; /* RPC low version */
u_int   se_rpc_highvers;/* RPC high version */
int se_count;   /* number started since se_time */
-   struct  timeval se_time;/* start of se_count */
+   struct  timespec se_time;   /* start of se_count */
struct  servtab *se_next;
struct se_flags {
u_int se_nomapped : 1;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r236575 - head/sys/netinet

2012-06-04 Thread Maksim Yevmenkin
Author: emax
Date: Mon Jun  4 18:43:51 2012
New Revision: 236575
URL: http://svn.freebsd.org/changeset/base/236575

Log:
  Plug more refcount leaks and possible NULL deref for interface
  address list.
  
  Submitted by: scottl@
  MFC after:3 days

Modified:
  head/sys/netinet/tcp_input.c

Modified: head/sys/netinet/tcp_input.c
==
--- head/sys/netinet/tcp_input.cMon Jun  4 18:17:09 2012
(r236574)
+++ head/sys/netinet/tcp_input.cMon Jun  4 18:43:51 2012
(r236575)
@@ -512,6 +512,8 @@ tcp6_input(struct mbuf **mp, int *offp, 
(caddr_t)&ip6->ip6_dst - (caddr_t)ip6);
return IPPROTO_DONE;
}
+   if (ia6)
+   ifa_free(&ia6->ia_ifa);
 
tcp_input(m, *offp);
return IPPROTO_DONE;
@@ -1240,7 +1242,8 @@ relocked:
rstreason = BANDLIM_RST_OPENPORT;
goto dropwithreset;
}
-   ifa_free(&ia6->ia_ifa);
+   if (ia6)
+   ifa_free(&ia6->ia_ifa);
}
 #endif /* INET6 */
/*
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r236456 - in head/sys: amd64/include i386/include

2012-06-04 Thread Konstantin Belousov
On Mon, Jun 04, 2012 at 04:59:22PM +0100, Attilio Rao wrote:
> 2012/6/4 Konstantin Belousov :
> > On Mon, Jun 04, 2012 at 02:58:57PM +0100, Attilio Rao wrote:
> >> 2012/6/4 Konstantin Belousov :
> >> > On Mon, Jun 04, 2012 at 12:00:27PM +0200, Tijl Coosemans wrote:
> >> >> On 02-06-2012 20:10, Konstantin Belousov wrote:
> >> >> > Author: kib
> >> >> > Date: Sat Jun  2 18:10:16 2012
> >> >> > New Revision: 236456
> >> >> > URL: http://svn.freebsd.org/changeset/base/236456
> >> >> >
> >> >> > Log:
> >> >> >   Use plain store for atomic_store_rel on x86, instead of implicitly
> >> >> >   locked xchg instruction.  IA32 memory model guarantees that store 
> >> >> > has
> >> >> >   release semantic, since stores cannot pass loads or stores.
> >> >>
> >> >> They can pass non-temporal stores can't they?
> >> > Sure. But (our) barriers only work for WB memory accesses, in respect to 
> >> > other
> >> > WB memory accesses.
> >> >
> >> > The atomic(9) contains not quite explicit mention of the requirement,
> >> > for ia32 and more direct notion for ia64. It could probably be reworded 
> >> > to
> >> > mention memory access type explicitely for ia32 too.
> >>
> >> I don't think this is right.
> >> What if I want to use NTI in a block of code locked? What if I want to
> >> use CLFLUSH? I simply cannot do that now because of the reordering
> >> requirement.
> > Assuming that NTI means "Non Temporal Instruction", Intel explicit
> > requirement is to use fence barrier if order shall be ensured. This,
> > as well as CLFLUSH use, is somewhat commonly documented. More, CLFLUSH
> > is documented by Intel to _not_ serialize with any other fencing or
> > serialization instruction, except MFENCE. So xchg-based _store_rel is
> > not different from mov-based _store_rel for CLFLUSH and non-temporal
> > ops.
> >
> > I do not see how you note is relevant.
> >
> >> Also, there is the more worrisome case of the string operations. If
> >> gcc/clang optimize the code in order to do string operations between
> >> locked path, this is not valid anymore as they can be reordered
> >> against the _rel() barrier.
> > They cannot. Fast string operation volatile store order only among
> > string operation itself, the operation cannot pass sequential store.
> > The store used in _store_rel thus cannot be passed by fast string
> > optimizations.
> >
> > I do not see how you note is relevant there, again.
> 
> I'm not sure why but I thought that the string writes could be
> re-ordered against "external" writes too, but  I re-read the manual
> and this is not the case.
> 
> >
> >>
> >> However, we should consider atomic(9) as a script for MI requirement
> >> of our locking primitives among the architectures. Right now too many
> >> things live on assumptions of people doing patches (like this case)
> >> rather than actually working on a common policy of what we can easilly
> >> support and what we can't.
> >>
> >> I also wondered often if we should use *fence on architectures
> >> supporting them, by default, because of the possibility to use FPU now
> >> (which wasn't present back in the day) and thus we cannot really
> >> guarantee memory ordering over stores of memory areas bigger than a
> >> quad-word. If we don't want to add the burden, we should explicitely
> >> mention that in atomic(9) or any other place.
> > The proposal to use fence explicitely contradicts recommendations from
> > the AMD Optimization Guide, which, JFYI, I cited in the updated comment
> > in the patch.
> >
> > How is FPU relevant to the memory model discussion, I left out of the
> > answer.
> 
> I'm not saying to use *fence, I'm saying that we should document MD
> cases where this is required (we can use agnostic terms like "simple
> barrier") in atomic(9).
> Also, about FPU, I'm saying that before we had no need to consider
> FPU/XMM into consideration from a model perspective but now we should
> do that because we can use FPU within the kernel.
FPU and XMM, unless explicitely doing something weird, as in movnti case,
are following normal mem model rules.

The fact that we can use FPU in kernel does not makes it reasonable to use
FPU in kernel, except taking advantage of some non-regular CPU features
like AESNI. And in fact you still cannot (easily) use floating-point
due to exceptions.

> 
> >> Definitively: I think this patch violates some edge cases. Please back it 
> >> out.
> > No. I explicitely inform you that I consider the backout request
> > as frivolous, technically unfounded, and that I will not back it out.
> 
> My main motivation for asking the backout was for the ordering issue
> with the string operations, but it doesn't seem to be the case, than I
> withdraw my request, sorry.
> I'm fine with using explicit memory barriers in MD code that use NTI
> (I just assume gcc/clang won't over-optimize things on their own as
> thinking they want to reduce cache traffic by using NTI).

Intel simply cannot go that far while their own recommendation is to
use normal s

svn commit: r236577 - head/usr.bin/kdump

2012-06-04 Thread John Baldwin
Author: jhb
Date: Mon Jun  4 19:09:14 2012
New Revision: 236577
URL: http://svn.freebsd.org/changeset/base/236577

Log:
  Allow the -p argument to kdump to accept either a PID or a thread ID.
  
  Submitted by: Dmitry Banschikov  d.banschikov hostcomm ru
  MFC after:1 week

Modified:
  head/usr.bin/kdump/kdump.1
  head/usr.bin/kdump/kdump.c

Modified: head/usr.bin/kdump/kdump.1
==
--- head/usr.bin/kdump/kdump.1  Mon Jun  4 18:45:18 2012(r236576)
+++ head/usr.bin/kdump/kdump.1  Mon Jun  4 19:09:14 2012(r236577)
@@ -28,7 +28,7 @@
 .\"@(#)kdump.1 8.1 (Berkeley) 6/6/93
 .\" $FreeBSD$
 .\"
-.Dd April 20, 2012
+.Dd June 4, 2012
 .Dt KDUMP 1
 .Os
 .Sh NAME
@@ -86,9 +86,9 @@ string.
 Suppressing this feature yields a more consistent output format and is
 easily amenable to further processing.
 .It Fl p Ar pid
-Display only trace events that correspond to the process
+Display only trace events that correspond to the process or thread
 .Ar pid .
-This may be useful when there are multiple processes recorded in the
+This may be useful when there are multiple processes or threads recorded in the
 same trace file.
 .It Fl R
 Display relative timestamps (time since previous entry).

Modified: head/usr.bin/kdump/kdump.c
==
--- head/usr.bin/kdump/kdump.c  Mon Jun  4 18:45:18 2012(r236576)
+++ head/usr.bin/kdump/kdump.c  Mon Jun  4 19:09:14 2012(r236577)
@@ -251,7 +251,8 @@ main(int argc, char *argv[])
}
}
if (trpoints & (1

Re: svn commit: r235537 - in head: etc/mtree include lib lib/libnandfs lib/libstand sbin sbin/nandfs sbin/newfs_nandfs share/man/man4 share/man/man5 share/mk sys/boot/arm/uboot sys/boot/i386/loader sy

2012-06-04 Thread Andriy Gapon
on 04/06/2012 13:40 Grzegorz Bernacki said the following:
> Hi Andriy,
> 
> Sorry about that. Fixed in r236549.

Thank you!

-- 
Andriy Gapon
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r236503 - in head/sys: amd64/amd64 i386/i386 kern x86/x86

2012-06-04 Thread Andriy Gapon
on 03/06/2012 11:01 Andriy Gapon said the following:
> Author: avg
> Date: Sun Jun  3 08:01:12 2012
> New Revision: 236503
> URL: http://svn.freebsd.org/changeset/base/236503
> 
> Log:
>   free wdog_kern_pat calls in post-panic paths from under SW_WATCHDOG
>   
>   Those calls are useful with hardware watchdog drivers too.

Failed to mention:
  Reviewed by:  attilio

>   MFC after:  3 weeks
> 
> Modified:
>   head/sys/amd64/amd64/minidump_machdep.c
>   head/sys/i386/i386/minidump_machdep.c
>   head/sys/kern/kern_shutdown.c
>   head/sys/kern/vfs_subr.c
>   head/sys/x86/x86/dump_machdep.c
> 
> Modified: head/sys/amd64/amd64/minidump_machdep.c
> ==
> --- head/sys/amd64/amd64/minidump_machdep.c   Sun Jun  3 07:45:42 2012
> (r236502)
> +++ head/sys/amd64/amd64/minidump_machdep.c   Sun Jun  3 08:01:12 2012
> (r236503)
> @@ -37,9 +37,7 @@ __FBSDID("$FreeBSD$");
>  #include 
>  #include 
>  #include 
> -#ifdef SW_WATCHDOG
>  #include 
> -#endif
>  #include 
>  #include 
>  #include 
> @@ -177,9 +175,9 @@ blk_write(struct dumperinfo *di, char *p
>   report_progress(progress, dumpsize);
>   counter &= (1<<24) - 1;
>   }
> -#ifdef SW_WATCHDOG
> +
>   wdog_kern_pat(WD_LASTVAL);
> -#endif
> +
>   if (ptr) {
>   error = dump_write(di, ptr, 0, dumplo, len);
>   if (error)
> 
> Modified: head/sys/i386/i386/minidump_machdep.c
> ==
> --- head/sys/i386/i386/minidump_machdep.c Sun Jun  3 07:45:42 2012
> (r236502)
> +++ head/sys/i386/i386/minidump_machdep.c Sun Jun  3 08:01:12 2012
> (r236503)
> @@ -36,9 +36,7 @@ __FBSDID("$FreeBSD$");
>  #include 
>  #include 
>  #include 
> -#ifdef SW_WATCHDOG
>  #include 
> -#endif
>  #include 
>  #include 
>  #include 
> @@ -143,9 +141,9 @@ blk_write(struct dumperinfo *di, char *p
>   printf(" %lld", PG2MB(progress >> PAGE_SHIFT));
>   counter &= (1<<24) - 1;
>   }
> -#ifdef SW_WATCHDOG
> +
>   wdog_kern_pat(WD_LASTVAL);
> -#endif
> +
>   if (ptr) {
>   error = dump_write(di, ptr, 0, dumplo, len);
>   if (error)
> 
> Modified: head/sys/kern/kern_shutdown.c
> ==
> --- head/sys/kern/kern_shutdown.c Sun Jun  3 07:45:42 2012
> (r236502)
> +++ head/sys/kern/kern_shutdown.c Sun Jun  3 08:01:12 2012
> (r236503)
> @@ -66,9 +66,7 @@ __FBSDID("$FreeBSD$");
>  #include 
>  #include 
>  #include 
> -#ifdef SW_WATCHDOG
>  #include 
> -#endif
>  
>  #include 
>  
> @@ -334,9 +332,7 @@ kern_reboot(int howto)
>  
>   waittime = 0;
>  
> -#ifdef SW_WATCHDOG
>   wdog_kern_pat(WD_LASTVAL);
> -#endif
>   sys_sync(curthread, NULL);
>  
>   /*
> @@ -362,9 +358,8 @@ kern_reboot(int howto)
>   if (nbusy < pbusy)
>   iter = 0;
>   pbusy = nbusy;
> -#ifdef SW_WATCHDOG
> +
>   wdog_kern_pat(WD_LASTVAL);
> -#endif
>   sys_sync(curthread, NULL);
>  
>  #ifdef PREEMPTION
> 
> Modified: head/sys/kern/vfs_subr.c
> ==
> --- head/sys/kern/vfs_subr.c  Sun Jun  3 07:45:42 2012(r236502)
> +++ head/sys/kern/vfs_subr.c  Sun Jun  3 08:01:12 2012(r236503)
> @@ -73,9 +73,7 @@ __FBSDID("$FreeBSD$");
>  #include 
>  #include 
>  #include 
> -#ifdef SW_WATCHDOG
>  #include 
> -#endif
>  
>  #include 
>  
> @@ -1869,10 +1867,10 @@ sched_sync(void)
>   LIST_INSERT_HEAD(next, bo, bo_synclist);
>   continue;
>   }
> -#ifdef SW_WATCHDOG
> +
>   if (first_printf == 0)
>   wdog_kern_pat(WD_LASTVAL);
> -#endif
> +
>   }
>   if (!LIST_EMPTY(gslp)) {
>   mtx_unlock(&sync_mtx);
> 
> Modified: head/sys/x86/x86/dump_machdep.c
> ==
> --- head/sys/x86/x86/dump_machdep.c   Sun Jun  3 07:45:42 2012
> (r236502)
> +++ head/sys/x86/x86/dump_machdep.c   Sun Jun  3 08:01:12 2012
> (r236503)
> @@ -36,9 +36,7 @@ __FBSDID("$FreeBSD$");
>  #include 
>  #include 
>  #include 
> -#ifdef SW_WATCHDOG
>  #include 
> -#endif
>  #include 
>  #include 
>  #include 
> @@ -198,9 +196,9 @@ cb_dumpdata(struct md_pa *mdp, int seqnr
>   a = pa + i * PAGE_SIZE;
>   va = pmap_kenter_temporary(trunc_page(a), i);
>   }
> -#ifdef SW_WATCHDOG
> +
>   wdog_kern_pat(WD_LASTVAL);
> -#endif
> +
>

svn commit: r236578 - head/sys/dev/aic7xxx/aicasm

2012-06-04 Thread Dimitry Andric
Author: dim
Date: Mon Jun  4 20:36:11 2012
New Revision: 236578
URL: http://svn.freebsd.org/changeset/base/236578

Log:
  Fix build of aicasm when CC=clang.  This was due to a side-effect of the
  EARLY_BUILD macro: the -Qunused-arguments flag isn't passed anymore when
  building this particular program.  However, with clang 3.1 and -Werror,
  such unused argument warnings are flagged as errors, causing buildkernel
  to fail at this stage, due to the -nostdinc flag passed during linking.
  Since the -nostdinc flag isn't actually needed, just remove it.
  
  X-MFC-With:   r236528

Modified:
  head/sys/dev/aic7xxx/aicasm/Makefile

Modified: head/sys/dev/aic7xxx/aicasm/Makefile
==
--- head/sys/dev/aic7xxx/aicasm/MakefileMon Jun  4 19:09:14 2012
(r236577)
+++ head/sys/dev/aic7xxx/aicasm/MakefileMon Jun  4 20:36:11 2012
(r236578)
@@ -24,8 +24,7 @@ WARNS?=   5
 DEPENDFILE=.depend_aicasm
 .endif
 
-NOSTDINC=  -nostdinc
-CFLAGS+= ${NOSTDINC} -I/usr/include -I.
+CFLAGS+= -I.
 .ifdef MAKESRCPATH
 CFLAGS+= -I${MAKESRCPATH}
 .endif
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r236579 - head/sys/boot/ofw/libofw

2012-06-04 Thread Marius Strobl
Author: marius
Date: Mon Jun  4 20:45:33 2012
New Revision: 236579
URL: http://svn.freebsd.org/changeset/base/236579

Log:
  The workaround added in r151650 for handling firmwares that don't allow
  a single device to be opened multiple times concurrently unfortunately
  isn't sufficient with ZFS. This is due to the fact, that ZFS may open
  different partitions of a single device simultaneously. So the best we
  can do in this case is to cache the lastly used device path and close
  and open devices in ofwd_strategy() as needed.
  
  PR:   165025
  Submitted by: Gavin Mu
  MFC after:1 week

Modified:
  head/sys/boot/ofw/libofw/ofw_disk.c

Modified: head/sys/boot/ofw/libofw/ofw_disk.c
==
--- head/sys/boot/ofw/libofw/ofw_disk.c Mon Jun  4 20:36:11 2012
(r236578)
+++ head/sys/boot/ofw/libofw/ofw_disk.c Mon Jun  4 20:45:33 2012
(r236579)
@@ -31,7 +31,6 @@ __FBSDID("$FreeBSD$");
  */
 
 #include 
-#include 
 
 #include 
 
@@ -43,8 +42,8 @@ __FBSDID("$FreeBSD$");
 #include "libofw.h"
 
 static int ofwd_init(void);
-static int ofwd_strategy(void *devdata, int flag, daddr_t dblk, 
-   size_t size, char *buf, size_t *rsize);
+static int ofwd_strategy(void *devdata, int flag, daddr_t dblk,
+   size_t size, char *buf, size_t *rsize);
 static int ofwd_open(struct open_file *f, ...);
 static int ofwd_close(struct open_file *f);
 static int ofwd_ioctl(struct open_file *f, u_long cmd, void *data);
@@ -61,120 +60,109 @@ struct devsw ofwdisk = {
ofwd_print
 };
 
-struct opened_dev {
-   ihandle_t   handle;
-   u_int   count;
-   SLIST_ENTRY(opened_dev) link;
-};
-
-SLIST_HEAD(, opened_dev) opened_devs = SLIST_HEAD_INITIALIZER(opened_devs);
+/*
+ * We're not guaranteed to be able to open a device more than once and there
+ * is no OFW standard method to determine whether a device is already opened.
+ * Opening a device multiple times simultaneously happens to work with most
+ * OFW block device drivers but triggers a trap with at least the driver for
+ * the on-board controllers of Sun Fire V100 and Ultra 1.  Upper layers and MI
+ * code expect to be able to open a device more than once however.  Given that
+ * different partitions of the same device might be opened at the same time as
+ * done by ZFS, we can't generally just keep track of the opened devices and
+ * reuse the instance handle when asked to open an already opened device.  So
+ * the best we can do is to cache the lastly used device path and close and
+ * open devices in ofwd_strategy() as needed.
+ */
+static struct ofw_devdesc *kdp;
 
 static int
 ofwd_init(void)
 {
 
-   return 0;
+   return (0);
 }
 
 static int
-ofwd_strategy(void *devdata, int flag, daddr_t dblk, size_t size, char *buf,
-size_t *rsize)
+ofwd_strategy(void *devdata, int flag __unused, daddr_t dblk, size_t size,
+char *buf, size_t *rsize)
 {
struct ofw_devdesc *dp = (struct ofw_devdesc *)devdata;
daddr_t pos;
int n;
 
+   if (dp != kdp) {
+   if (kdp != NULL) {
+#if !defined(__powerpc__)
+   OF_close(kdp->d_handle);
+#endif
+   kdp = NULL;
+   }
+   if ((dp->d_handle = OF_open(dp->d_path)) == -1)
+   return (ENOENT);
+   kdp = dp;
+   }
+
pos = dblk * 512;
do {
if (OF_seek(dp->d_handle, pos) < 0)
-   return EIO;
+   return (EIO);
n = OF_read(dp->d_handle, buf, size);
if (n < 0 && n != -2)
-   return EIO;
+   return (EIO);
} while (n == -2);
*rsize = size;
-   return 0;
+   return (0);
 }
 
 static int
 ofwd_open(struct open_file *f, ...)
 {
-   char path[256];
struct ofw_devdesc *dp;
-   struct opened_dev *odp;
va_list vl;
 
va_start(vl, f);
dp = va_arg(vl, struct ofw_devdesc *);
va_end(vl);
-   /*
-* We're not guaranteed to be able to open a device more than once
-* simultaneously and there is no OFW standard method to determine
-* whether a device is already opened. Opening a device more than
-* once happens to work with most OFW block device drivers but
-* triggers a trap with at least the driver for the on-board SCSI
-* controller in Sun Ultra 1. Upper layers and MI code expect to
-* be able to open a device more than once however. As a workaround
-* keep track of the opened devices and reuse the instance handle
-* when asked to open an already opened device.
-*/
-   SLIST_FOREACH(odp, &opened_devs, link) {
-   if (OF_instance_to_path(odp->handle, path, sizeof(path)) == -1)
-   continue

svn commit: r236581 - head/sys/boot/sparc64/loader

2012-06-04 Thread Marius Strobl
Author: marius
Date: Mon Jun  4 20:56:40 2012
New Revision: 236581
URL: http://svn.freebsd.org/changeset/base/236581

Log:
  The loaddev environment variable is not modifiable once set, so it is not
  update for ZFS. It seems that this does not really affect anything except
  the help command. Nevertheless, rearrange things so loaddev is set only
  once in all cases in order to get it right.
  Pointed out by: avg
  
  MFC after:r235364

Modified:
  head/sys/boot/sparc64/loader/main.c

Modified: head/sys/boot/sparc64/loader/main.c
==
--- head/sys/boot/sparc64/loader/main.c Mon Jun  4 20:50:41 2012
(r236580)
+++ head/sys/boot/sparc64/loader/main.c Mon Jun  4 20:56:40 2012
(r236581)
@@ -141,6 +141,7 @@ static u_int tlb_locked;
 static vm_offset_t curkva = 0;
 static vm_offset_t heapva;
 
+static char bootpath[64];
 static phandle_t root;
 
 /*
@@ -740,7 +741,7 @@ sparc64_zfs_probe(void)
 
/* Get the GUID of the ZFS pool on the boot device. */
guid = 0;
-   zfs_probe_dev(getenv("currdev"), &guid);
+   zfs_probe_dev(bootpath, &guid);
 
for (unit = 0; unit < MAXDEV; unit++) {
/* Find freebsd-zfs slices in the VTOC. */
@@ -757,7 +758,7 @@ sparc64_zfs_probe(void)
 
for (part = 0; part < 8; part++) {
if (part == 2 || vtoc.part[part].tag !=
-VTOC_TAG_FREEBSD_ZFS)
+   VTOC_TAG_FREEBSD_ZFS)
continue;
sprintf(devname, "disk%d:%c", unit, part + 'a');
if (zfs_probe_dev(devname, NULL) == ENXIO)
@@ -770,11 +771,9 @@ sparc64_zfs_probe(void)
zfs_currdev.root_guid = 0;
zfs_currdev.d_dev = &zfs_dev;
zfs_currdev.d_type = zfs_currdev.d_dev->dv_type;
-   /* Update the environment for ZFS. */
-   env_setenv("currdev", EV_VOLATILE, zfs_fmtdev(&zfs_currdev),
-   ofw_setcurrdev, env_nounset);
-   env_setenv("loaddev", EV_VOLATILE, zfs_fmtdev(&zfs_currdev),
-   env_noset, env_nounset);
+   (void)strncpy(bootpath, zfs_fmtdev(&zfs_currdev),
+   sizeof(bootpath) - 1);
+   bootpath[sizeof(bootpath) - 1] = '\0';
}
 }
 #endif /* LOADER_ZFS_SUPPORT */
@@ -782,7 +781,6 @@ sparc64_zfs_probe(void)
 int
 main(int (*openfirm)(void *))
 {
-   char bootpath[64];
char compatible[32];
struct devsw **dp;
 
@@ -834,16 +832,11 @@ main(int (*openfirm)(void *))
 */
if (bootpath[strlen(bootpath) - 2] == ':' &&
bootpath[strlen(bootpath) - 1] == 'f' &&
-   strstr(bootpath, "cdrom")) {
+   strstr(bootpath, "cdrom") != NULL) {
bootpath[strlen(bootpath) - 1] = 'a';
printf("Boot path set to %s\n", bootpath);
}
 
-   env_setenv("currdev", EV_VOLATILE, bootpath,
-   ofw_setcurrdev, env_nounset);
-   env_setenv("loaddev", EV_VOLATILE, bootpath,
-   env_noset, env_nounset);
-
/*
 * Initialize devices.
 */
@@ -851,6 +844,15 @@ main(int (*openfirm)(void *))
if ((*dp)->dv_init != 0)
(*dp)->dv_init();
 
+   /*
+* Now that sparc64_zfs_probe() might have altered bootpath,
+* export it.
+*/
+   env_setenv("currdev", EV_VOLATILE, bootpath,
+   ofw_setcurrdev, env_nounset);
+   env_setenv("loaddev", EV_VOLATILE, bootpath,
+   env_noset, env_nounset);
+
printf("\n");
printf("%s, Revision %s\n", bootprog_name, bootprog_rev);
printf("(%s, %s)\n", bootprog_maker, bootprog_date);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r236582 - head/lib/libc/stdlib

2012-06-04 Thread Andrey A. Chernov
Author: ache
Date: Mon Jun  4 21:34:49 2012
New Revision: 236582
URL: http://svn.freebsd.org/changeset/base/236582

Log:
  1) IEEE Std 1003.1-2008, "errno" section, is explicit that
  
  "The setting of errno after a successful call to a function is
  unspecified unless the description of that function specifies that
  errno shall not be modified."
  
  However, free() in IEEE Std 1003.1-2008 does not mention its interaction
  with errno, so MAY modify it after successful call
  (it depends on particular free() implementation, OS-specific, etc.).
  
  So, save errno across free() calls to make code portable and
  POSIX-conformant.
  
  2) Remove unused serrno assignment.
  
  MFC after:  1 week

Modified:
  head/lib/libc/stdlib/realpath.c

Modified: head/lib/libc/stdlib/realpath.c
==
--- head/lib/libc/stdlib/realpath.c Mon Jun  4 20:56:40 2012
(r236581)
+++ head/lib/libc/stdlib/realpath.c Mon Jun  4 21:34:49 2012
(r236582)
@@ -65,7 +65,6 @@ realpath(const char * __restrict path, c
errno = ENOENT;
return (NULL);
}
-   serrno = errno;
if (resolved == NULL) {
resolved = malloc(PATH_MAX);
if (resolved == NULL)
@@ -83,9 +82,11 @@ realpath(const char * __restrict path, c
left_len = strlcpy(left, path + 1, sizeof(left));
} else {
if (getcwd(resolved, PATH_MAX) == NULL) {
-   if (m)
+   if (m) {
+   serrno = errno;
free(resolved);
-   else {
+   errno = serrno;
+   } else {
resolved[0] = '.';
resolved[1] = '\0';
}
@@ -143,8 +144,11 @@ realpath(const char * __restrict path, c
 * occurence to not implement lookahead.
 */
if (lstat(resolved, &sb) != 0) {
-   if (m)
+   if (m) {
+   serrno = errno;
free(resolved);
+   errno = serrno;
+   }
return (NULL);
}
if (!S_ISDIR(sb.st_mode)) {
@@ -184,8 +188,11 @@ realpath(const char * __restrict path, c
if (lstat(resolved, &sb) != 0) {
if (errno != ENOENT || p != NULL)
errno = ENOTDIR;
-   if (m)
+   if (m) {
+   serrno = errno;
free(resolved);
+   errno = serrno;
+   }
return (NULL);
}
if (S_ISLNK(sb.st_mode)) {
@@ -197,8 +204,11 @@ realpath(const char * __restrict path, c
}
slen = readlink(resolved, symlink, sizeof(symlink) - 1);
if (slen < 0) {
-   if (m)
+   if (m) {
+   serrno = errno;
free(resolved);
+   errno = serrno;
+   }
return (NULL);
}
symlink[slen] = '\0';
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r236583 - head/sys/dev/ath

2012-06-04 Thread Adrian Chadd
Author: adrian
Date: Mon Jun  4 22:01:12 2012
New Revision: 236583
URL: http://svn.freebsd.org/changeset/base/236583

Log:
  Migrate the TX path to a taskqueue for now, until a better way of
  implementing parallel TX and TX/RX completion can be done without
  simply abusing long-held locks.
  
  Right now, multiple concurrent ath_start() entries can result in
  frames being dequeued out of order.  Well, they're dequeued in order
  fine, but if there's any preemption or race between CPUs between:
  
  * removing the frame from the ifnet, and
  * calling and runningath_tx_start(), until the frame is placed on a
software or hardware TXQ
  
  Then although dequeueing the frame is in-order, queueing it to the hardware
  may be out of order.
  
  This is solved in a lot of other drivers by just holding a TX lock over
  a rather long period of time.  This lets them continue to direct dispatch
  without races between dequeue and hardware queue.
  
  Note to observers: if_transmit() doesn't necessarily solve this.
  It removes the ifnet from the main path, but the same issue exists if
  there's some intermediary queue (eg a bufring, which as an aside also
  may pull in ifnet when you're using ALTQ.)
  
  So, until I can sit down and code up a much better way of doing parallel
  TX, I'm going to leave the TX path using a deferred taskqueue task.
  What I will likely head towards is doing a direct dispatch to hardware
  or software via if_transmit(), but it'll require some driver changes to
  allow queues to be made without using the really large ath_buf / ath_desc
  entries.
  
  TODO:
  
  * Look at how feasible it'll be to just do direct dispatch to
ath_tx_start() from if_transmit(), avoiding doing _any_ intermediary
serialisation into a global queue.  This may break ALTQ for example,
so I have to be delicate.
  
  * It's quite likely that I should break up ath_tx_start() so it
deposits frames onto the software queues first, and then only fill
in the 802.11 fields when it's being queued to the hardware.
That will make the if_transmit() -> software queue path very
quick and lightweight.
  
  * This has some very bad behaviour when using ACPI and Cx states.
I'll do some subsequent analysis using KTR and schedgraph and file
a follow-up PR or two.
  
  PR:   kern/168649

Modified:
  head/sys/dev/ath/if_ath.c
  head/sys/dev/ath/if_ath_misc.h
  head/sys/dev/ath/if_ath_rx.c
  head/sys/dev/ath/if_athvar.h

Modified: head/sys/dev/ath/if_ath.c
==
--- head/sys/dev/ath/if_ath.c   Mon Jun  4 21:34:49 2012(r236582)
+++ head/sys/dev/ath/if_ath.c   Mon Jun  4 22:01:12 2012(r236583)
@@ -373,6 +373,7 @@ ath_attach(u_int16_t devid, struct ath_s
"%s taskq", ifp->if_xname);
 
TASK_INIT(&sc->sc_rxtask, 0, ath_rx_tasklet, sc);
+   TASK_INIT(&sc->sc_txstarttask, 0, ath_tx_tasklet, sc);
TASK_INIT(&sc->sc_bmisstask, 0, ath_bmiss_proc, sc);
TASK_INIT(&sc->sc_bstucktask,0, ath_bstuck_proc, sc);
TASK_INIT(&sc->sc_resettask,0, ath_reset_proc, sc);
@@ -2325,6 +2326,15 @@ void
 ath_start(struct ifnet *ifp)
 {
struct ath_softc *sc = ifp->if_softc;
+
+   taskqueue_enqueue(sc->sc_tq, &sc->sc_txstarttask);
+}
+
+void
+ath_tx_tasklet(void *arg, int npending)
+{
+   struct ath_softc *sc = (struct ath_softc *) arg;
+   struct ifnet *ifp = sc->sc_ifp;
struct ieee80211_node *ni;
struct ath_buf *bf;
struct mbuf *m, *next;
@@ -3499,7 +3509,8 @@ ath_tx_proc_q0(void *arg, int npending)
sc->sc_txproc_cnt--;
ATH_PCU_UNLOCK(sc);
 
-   ath_start(ifp);
+   // ath_start(ifp);
+   ath_tx_tasklet(sc, 1);
 }
 
 /*
@@ -3549,7 +3560,8 @@ ath_tx_proc_q0123(void *arg, int npendin
sc->sc_txproc_cnt--;
ATH_PCU_UNLOCK(sc);
 
-   ath_start(ifp);
+   //ath_start(ifp);
+   ath_tx_tasklet(sc, 1);
 }
 
 /*
@@ -3592,7 +3604,8 @@ ath_tx_proc(void *arg, int npending)
sc->sc_txproc_cnt--;
ATH_PCU_UNLOCK(sc);
 
-   ath_start(ifp);
+   //ath_start(ifp);
+   ath_tx_tasklet(sc, 1);
 }
 #undef TXQACTIVE
 

Modified: head/sys/dev/ath/if_ath_misc.h
==
--- head/sys/dev/ath/if_ath_misc.h  Mon Jun  4 21:34:49 2012
(r236582)
+++ head/sys/dev/ath/if_ath_misc.h  Mon Jun  4 22:01:12 2012
(r236583)
@@ -83,6 +83,7 @@ extern void ath_setslottime(struct ath_s
  * we can kill this.
  */
 extern void ath_start(struct ifnet *ifp);
+extern void ath_tx_tasklet(void *arg, int npending);
 
 
 #endif

Modified: head/sys/dev/ath/if_ath_rx.c
==
--- head/sys/dev/ath/if_ath_rx.cMon Jun  4 21:34:49 2012
(r236582)
+++ head/sys/dev/ath/if_ath_rx.cMon Jun  4 22:01:12 2012
(r236583)
@@ -899,7 +899,

svn commit: r236584 - in vendor/bind9/dist: . lib/dns

2012-06-04 Thread Doug Barton
Author: dougb
Date: Mon Jun  4 22:06:29 2012
New Revision: 236584
URL: http://svn.freebsd.org/changeset/base/236584

Log:
  Vendor import of BIND 9.8.3-P1

Modified:
  vendor/bind9/dist/CHANGES
  vendor/bind9/dist/lib/dns/rdata.c
  vendor/bind9/dist/lib/dns/rdataslab.c
  vendor/bind9/dist/version

Modified: vendor/bind9/dist/CHANGES
==
--- vendor/bind9/dist/CHANGES   Mon Jun  4 22:01:12 2012(r236583)
+++ vendor/bind9/dist/CHANGES   Mon Jun  4 22:06:29 2012(r236584)
@@ -1,3 +1,8 @@
+   --- 9.8.3-P1 released ---
+
+3331.  [security]  dns_rdataslab_fromrdataset could produce bad
+   rdataslabs. [RT #29644]
+   
--- 9.8.3 released ---
 
 3318.  [tuning]Reduce the amount of work performed while holding a

Modified: vendor/bind9/dist/lib/dns/rdata.c
==
--- vendor/bind9/dist/lib/dns/rdata.c   Mon Jun  4 22:01:12 2012
(r236583)
+++ vendor/bind9/dist/lib/dns/rdata.c   Mon Jun  4 22:06:29 2012
(r236584)
@@ -329,8 +329,8 @@ dns_rdata_compare(const dns_rdata_t *rda
 
REQUIRE(rdata1 != NULL);
REQUIRE(rdata2 != NULL);
-   REQUIRE(rdata1->data != NULL);
-   REQUIRE(rdata2->data != NULL);
+   REQUIRE(rdata1->length == 0 || rdata1->data != NULL);
+   REQUIRE(rdata2->length == 0 || rdata2->data != NULL);
REQUIRE(DNS_RDATA_VALIDFLAGS(rdata1));
REQUIRE(DNS_RDATA_VALIDFLAGS(rdata2));
 
@@ -360,8 +360,8 @@ dns_rdata_casecompare(const dns_rdata_t 
 
REQUIRE(rdata1 != NULL);
REQUIRE(rdata2 != NULL);
-   REQUIRE(rdata1->data != NULL);
-   REQUIRE(rdata2->data != NULL);
+   REQUIRE(rdata1->length == 0 || rdata1->data != NULL);
+   REQUIRE(rdata2->length == 0 || rdata2->data != NULL);
REQUIRE(DNS_RDATA_VALIDFLAGS(rdata1));
REQUIRE(DNS_RDATA_VALIDFLAGS(rdata2));
 

Modified: vendor/bind9/dist/lib/dns/rdataslab.c
==
--- vendor/bind9/dist/lib/dns/rdataslab.c   Mon Jun  4 22:01:12 2012
(r236583)
+++ vendor/bind9/dist/lib/dns/rdataslab.c   Mon Jun  4 22:06:29 2012
(r236584)
@@ -126,6 +126,11 @@ isc_result_t
 dns_rdataslab_fromrdataset(dns_rdataset_t *rdataset, isc_mem_t *mctx,
   isc_region_t *region, unsigned int reservelen)
 {
+   /*
+* Use &removed as a sentinal pointer for duplicate
+* rdata as rdata.data == NULL is valid.
+*/
+   static unsigned char removed;
struct xrdata  *x;
unsigned char  *rawbuf;
 #if DNS_RDATASET_FIXED
@@ -169,6 +174,7 @@ dns_rdataslab_fromrdataset(dns_rdataset_
INSIST(result == ISC_R_SUCCESS);
dns_rdata_init(&x[i].rdata);
dns_rdataset_current(rdataset, &x[i].rdata);
+   INSIST(x[i].rdata.data != &removed);
 #if DNS_RDATASET_FIXED
x[i].order = i;
 #endif
@@ -201,8 +207,7 @@ dns_rdataslab_fromrdataset(dns_rdataset_
 */
for (i = 1; i < nalloc; i++) {
if (compare_rdata(&x[i-1].rdata, &x[i].rdata) == 0) {
-   x[i-1].rdata.data = NULL;
-   x[i-1].rdata.length = 0;
+   x[i-1].rdata.data = &removed;
 #if DNS_RDATASET_FIXED
/*
 * Preserve the least order so A, B, A -> A, B
@@ -292,7 +297,7 @@ dns_rdataslab_fromrdataset(dns_rdataset_
 #endif
 
for (i = 0; i < nalloc; i++) {
-   if (x[i].rdata.data == NULL)
+   if (x[i].rdata.data == &removed)
continue;
 #if DNS_RDATASET_FIXED
offsettable[x[i].order] = rawbuf - offsetbase;

Modified: vendor/bind9/dist/version
==
--- vendor/bind9/dist/version   Mon Jun  4 22:01:12 2012(r236583)
+++ vendor/bind9/dist/version   Mon Jun  4 22:06:29 2012(r236584)
@@ -6,5 +6,5 @@
 MAJORVER=9
 MINORVER=8
 PATCHVER=3
-RELEASETYPE=
-RELEASEVER=
+RELEASETYPE=-P
+RELEASEVER=1
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r236585 - vendor/bind9/9.8.3-P1

2012-06-04 Thread Doug Barton
Author: dougb
Date: Mon Jun  4 22:07:05 2012
New Revision: 236585
URL: http://svn.freebsd.org/changeset/base/236585

Log:
  Tag the 9.8.3-P1 release

Added:
  vendor/bind9/9.8.3-P1/
 - copied from r236584, vendor/bind9/dist/
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r236586 - in head/contrib/bind9: . lib/dns

2012-06-04 Thread Doug Barton
Author: dougb
Date: Mon Jun  4 22:11:20 2012
New Revision: 236586
URL: http://svn.freebsd.org/changeset/base/236586

Log:
  Upgrade to 9.8.3-P1, the latest from ISC. This version contains
  a critical bugfix:
  
Processing of DNS resource records where the rdata field is zero length
may cause various issues for the servers handling them.
  
Processing of these records may lead to unexpected outcomes. Recursive
servers may crash or disclose some portion of memory to the client.
Secondary servers may crash on restart after transferring a zone
containing these records. Master servers may corrupt zone data if the
zone option "auto-dnssec" is set to "maintain". Other unexpected
problems that are not listed here may also be encountered.
  
  All BIND users are strongly encouraged to upgrade.

Modified:
  head/contrib/bind9/CHANGES
  head/contrib/bind9/lib/dns/rdata.c
  head/contrib/bind9/lib/dns/rdataslab.c
  head/contrib/bind9/version
Directory Properties:
  head/contrib/bind9/   (props changed)

Modified: head/contrib/bind9/CHANGES
==
--- head/contrib/bind9/CHANGES  Mon Jun  4 22:07:05 2012(r236585)
+++ head/contrib/bind9/CHANGES  Mon Jun  4 22:11:20 2012(r236586)
@@ -1,3 +1,8 @@
+   --- 9.8.3-P1 released ---
+
+3331.  [security]  dns_rdataslab_fromrdataset could produce bad
+   rdataslabs. [RT #29644]
+   
--- 9.8.3 released ---
 
 3318.  [tuning]Reduce the amount of work performed while holding a

Modified: head/contrib/bind9/lib/dns/rdata.c
==
--- head/contrib/bind9/lib/dns/rdata.c  Mon Jun  4 22:07:05 2012
(r236585)
+++ head/contrib/bind9/lib/dns/rdata.c  Mon Jun  4 22:11:20 2012
(r236586)
@@ -329,8 +329,8 @@ dns_rdata_compare(const dns_rdata_t *rda
 
REQUIRE(rdata1 != NULL);
REQUIRE(rdata2 != NULL);
-   REQUIRE(rdata1->data != NULL);
-   REQUIRE(rdata2->data != NULL);
+   REQUIRE(rdata1->length == 0 || rdata1->data != NULL);
+   REQUIRE(rdata2->length == 0 || rdata2->data != NULL);
REQUIRE(DNS_RDATA_VALIDFLAGS(rdata1));
REQUIRE(DNS_RDATA_VALIDFLAGS(rdata2));
 
@@ -360,8 +360,8 @@ dns_rdata_casecompare(const dns_rdata_t 
 
REQUIRE(rdata1 != NULL);
REQUIRE(rdata2 != NULL);
-   REQUIRE(rdata1->data != NULL);
-   REQUIRE(rdata2->data != NULL);
+   REQUIRE(rdata1->length == 0 || rdata1->data != NULL);
+   REQUIRE(rdata2->length == 0 || rdata2->data != NULL);
REQUIRE(DNS_RDATA_VALIDFLAGS(rdata1));
REQUIRE(DNS_RDATA_VALIDFLAGS(rdata2));
 

Modified: head/contrib/bind9/lib/dns/rdataslab.c
==
--- head/contrib/bind9/lib/dns/rdataslab.c  Mon Jun  4 22:07:05 2012
(r236585)
+++ head/contrib/bind9/lib/dns/rdataslab.c  Mon Jun  4 22:11:20 2012
(r236586)
@@ -126,6 +126,11 @@ isc_result_t
 dns_rdataslab_fromrdataset(dns_rdataset_t *rdataset, isc_mem_t *mctx,
   isc_region_t *region, unsigned int reservelen)
 {
+   /*
+* Use &removed as a sentinal pointer for duplicate
+* rdata as rdata.data == NULL is valid.
+*/
+   static unsigned char removed;
struct xrdata  *x;
unsigned char  *rawbuf;
 #if DNS_RDATASET_FIXED
@@ -169,6 +174,7 @@ dns_rdataslab_fromrdataset(dns_rdataset_
INSIST(result == ISC_R_SUCCESS);
dns_rdata_init(&x[i].rdata);
dns_rdataset_current(rdataset, &x[i].rdata);
+   INSIST(x[i].rdata.data != &removed);
 #if DNS_RDATASET_FIXED
x[i].order = i;
 #endif
@@ -201,8 +207,7 @@ dns_rdataslab_fromrdataset(dns_rdataset_
 */
for (i = 1; i < nalloc; i++) {
if (compare_rdata(&x[i-1].rdata, &x[i].rdata) == 0) {
-   x[i-1].rdata.data = NULL;
-   x[i-1].rdata.length = 0;
+   x[i-1].rdata.data = &removed;
 #if DNS_RDATASET_FIXED
/*
 * Preserve the least order so A, B, A -> A, B
@@ -292,7 +297,7 @@ dns_rdataslab_fromrdataset(dns_rdataset_
 #endif
 
for (i = 0; i < nalloc; i++) {
-   if (x[i].rdata.data == NULL)
+   if (x[i].rdata.data == &removed)
continue;
 #if DNS_RDATASET_FIXED
offsettable[x[i].order] = rawbuf - offsetbase;

Modified: head/contrib/bind9/version
==
--- head/contrib/bind9/version  Mon Jun  4 22:07:05 2012(r236585)
+++ head/contrib/bind9/version  Mon Jun  4 22:11:20 2012(r236586)
@@ -6,5 +6,5 @@
 MAJORVER=9
 MINORVER=8
 PATCHVER=3
-RELEASETYPE=
-RELEASEVER=
+RELEASETYPE=-P
+RELEASEVER=1
_

svn commit: r236587 - in stable/9/contrib/bind9: . lib/dns

2012-06-04 Thread Doug Barton
Author: dougb
Date: Mon Jun  4 22:14:33 2012
New Revision: 236587
URL: http://svn.freebsd.org/changeset/base/236587

Log:
  Upgrade to 9.8.3-P1, the latest from ISC. This version contains
  a critical bugfix:
  
  Processing of DNS resource records where the rdata field is zero length
  may cause various issues for the servers handling them.
  
  Processing of these records may lead to unexpected outcomes. Recursive
  servers may crash or disclose some portion of memory to the client.
  Secondary servers may crash on restart after transferring a zone
  containing these records. Master servers may corrupt zone data if the
  zone option "auto-dnssec" is set to "maintain". Other unexpected
  problems that are not listed here may also be encountered.
  
  All BIND users are strongly encouraged to upgrade.

Modified:
  stable/9/contrib/bind9/CHANGES
  stable/9/contrib/bind9/lib/dns/rdata.c
  stable/9/contrib/bind9/lib/dns/rdataslab.c
  stable/9/contrib/bind9/version
Directory Properties:
  stable/9/contrib/bind9/   (props changed)

Modified: stable/9/contrib/bind9/CHANGES
==
--- stable/9/contrib/bind9/CHANGES  Mon Jun  4 22:11:20 2012
(r236586)
+++ stable/9/contrib/bind9/CHANGES  Mon Jun  4 22:14:33 2012
(r236587)
@@ -1,3 +1,8 @@
+   --- 9.8.3-P1 released ---
+
+3331.  [security]  dns_rdataslab_fromrdataset could produce bad
+   rdataslabs. [RT #29644]
+   
--- 9.8.3 released ---
 
 3318.  [tuning]Reduce the amount of work performed while holding a

Modified: stable/9/contrib/bind9/lib/dns/rdata.c
==
--- stable/9/contrib/bind9/lib/dns/rdata.c  Mon Jun  4 22:11:20 2012
(r236586)
+++ stable/9/contrib/bind9/lib/dns/rdata.c  Mon Jun  4 22:14:33 2012
(r236587)
@@ -329,8 +329,8 @@ dns_rdata_compare(const dns_rdata_t *rda
 
REQUIRE(rdata1 != NULL);
REQUIRE(rdata2 != NULL);
-   REQUIRE(rdata1->data != NULL);
-   REQUIRE(rdata2->data != NULL);
+   REQUIRE(rdata1->length == 0 || rdata1->data != NULL);
+   REQUIRE(rdata2->length == 0 || rdata2->data != NULL);
REQUIRE(DNS_RDATA_VALIDFLAGS(rdata1));
REQUIRE(DNS_RDATA_VALIDFLAGS(rdata2));
 
@@ -360,8 +360,8 @@ dns_rdata_casecompare(const dns_rdata_t 
 
REQUIRE(rdata1 != NULL);
REQUIRE(rdata2 != NULL);
-   REQUIRE(rdata1->data != NULL);
-   REQUIRE(rdata2->data != NULL);
+   REQUIRE(rdata1->length == 0 || rdata1->data != NULL);
+   REQUIRE(rdata2->length == 0 || rdata2->data != NULL);
REQUIRE(DNS_RDATA_VALIDFLAGS(rdata1));
REQUIRE(DNS_RDATA_VALIDFLAGS(rdata2));
 

Modified: stable/9/contrib/bind9/lib/dns/rdataslab.c
==
--- stable/9/contrib/bind9/lib/dns/rdataslab.c  Mon Jun  4 22:11:20 2012
(r236586)
+++ stable/9/contrib/bind9/lib/dns/rdataslab.c  Mon Jun  4 22:14:33 2012
(r236587)
@@ -126,6 +126,11 @@ isc_result_t
 dns_rdataslab_fromrdataset(dns_rdataset_t *rdataset, isc_mem_t *mctx,
   isc_region_t *region, unsigned int reservelen)
 {
+   /*
+* Use &removed as a sentinal pointer for duplicate
+* rdata as rdata.data == NULL is valid.
+*/
+   static unsigned char removed;
struct xrdata  *x;
unsigned char  *rawbuf;
 #if DNS_RDATASET_FIXED
@@ -169,6 +174,7 @@ dns_rdataslab_fromrdataset(dns_rdataset_
INSIST(result == ISC_R_SUCCESS);
dns_rdata_init(&x[i].rdata);
dns_rdataset_current(rdataset, &x[i].rdata);
+   INSIST(x[i].rdata.data != &removed);
 #if DNS_RDATASET_FIXED
x[i].order = i;
 #endif
@@ -201,8 +207,7 @@ dns_rdataslab_fromrdataset(dns_rdataset_
 */
for (i = 1; i < nalloc; i++) {
if (compare_rdata(&x[i-1].rdata, &x[i].rdata) == 0) {
-   x[i-1].rdata.data = NULL;
-   x[i-1].rdata.length = 0;
+   x[i-1].rdata.data = &removed;
 #if DNS_RDATASET_FIXED
/*
 * Preserve the least order so A, B, A -> A, B
@@ -292,7 +297,7 @@ dns_rdataslab_fromrdataset(dns_rdataset_
 #endif
 
for (i = 0; i < nalloc; i++) {
-   if (x[i].rdata.data == NULL)
+   if (x[i].rdata.data == &removed)
continue;
 #if DNS_RDATASET_FIXED
offsettable[x[i].order] = rawbuf - offsetbase;

Modified: stable/9/contrib/bind9/version
==
--- stable/9/contrib/bind9/version  Mon Jun  4 22:11:20 2012
(r236586)
+++ stable/9/contrib/bind9/version  Mon Jun  4 22:14:33 2012
(r236587)
@@ -6,5 +6,5 @@
 M

svn commit: r236588 - in vendor/bind9/dist-9.6: . lib/dns

2012-06-04 Thread Doug Barton
Author: dougb
Date: Mon Jun  4 22:19:09 2012
New Revision: 236588
URL: http://svn.freebsd.org/changeset/base/236588

Log:
  Vendor import of BIND 9.6-ESV-R7-P1

Modified:
  vendor/bind9/dist-9.6/CHANGES
  vendor/bind9/dist-9.6/lib/dns/rdata.c
  vendor/bind9/dist-9.6/lib/dns/rdataslab.c
  vendor/bind9/dist-9.6/version

Modified: vendor/bind9/dist-9.6/CHANGES
==
--- vendor/bind9/dist-9.6/CHANGES   Mon Jun  4 22:14:33 2012
(r236587)
+++ vendor/bind9/dist-9.6/CHANGES   Mon Jun  4 22:19:09 2012
(r236588)
@@ -1,3 +1,8 @@
+   --- 9.6-ESV-R7-P1 released ---
+
+3331.  [security]  dns_rdataslab_fromrdataset could produce bad
+   rdataslabs. [RT #29644]
+
--- 9.6-ESV-R7 released ---
 
 3318.  [tuning]Reduce the amount of work performed while holding a

Modified: vendor/bind9/dist-9.6/lib/dns/rdata.c
==
--- vendor/bind9/dist-9.6/lib/dns/rdata.c   Mon Jun  4 22:14:33 2012
(r236587)
+++ vendor/bind9/dist-9.6/lib/dns/rdata.c   Mon Jun  4 22:19:09 2012
(r236588)
@@ -345,8 +345,8 @@ dns_rdata_compare(const dns_rdata_t *rda
 
REQUIRE(rdata1 != NULL);
REQUIRE(rdata2 != NULL);
-   REQUIRE(rdata1->data != NULL);
-   REQUIRE(rdata2->data != NULL);
+   REQUIRE(rdata1->length == 0 || rdata1->data != NULL);
+   REQUIRE(rdata2->length == 0 || rdata2->data != NULL);
REQUIRE(DNS_RDATA_VALIDFLAGS(rdata1));
REQUIRE(DNS_RDATA_VALIDFLAGS(rdata2));
 

Modified: vendor/bind9/dist-9.6/lib/dns/rdataslab.c
==
--- vendor/bind9/dist-9.6/lib/dns/rdataslab.c   Mon Jun  4 22:14:33 2012
(r236587)
+++ vendor/bind9/dist-9.6/lib/dns/rdataslab.c   Mon Jun  4 22:19:09 2012
(r236588)
@@ -126,6 +126,11 @@ isc_result_t
 dns_rdataslab_fromrdataset(dns_rdataset_t *rdataset, isc_mem_t *mctx,
   isc_region_t *region, unsigned int reservelen)
 {
+   /*
+* Use &removed as a sentinal pointer for duplicate
+* rdata as rdata.data == NULL is valid.
+*/
+   static unsigned char removed;
struct xrdata  *x;
unsigned char  *rawbuf;
 #if DNS_RDATASET_FIXED
@@ -165,6 +170,7 @@ dns_rdataslab_fromrdataset(dns_rdataset_
INSIST(result == ISC_R_SUCCESS);
dns_rdata_init(&x[i].rdata);
dns_rdataset_current(rdataset, &x[i].rdata);
+   INSIST(x[i].rdata.data != &removed);
 #if DNS_RDATASET_FIXED
x[i].order = i;
 #endif
@@ -197,8 +203,7 @@ dns_rdataslab_fromrdataset(dns_rdataset_
 */
for (i = 1; i < nalloc; i++) {
if (compare_rdata(&x[i-1].rdata, &x[i].rdata) == 0) {
-   x[i-1].rdata.data = NULL;
-   x[i-1].rdata.length = 0;
+   x[i-1].rdata.data = &removed;
 #if DNS_RDATASET_FIXED
/*
 * Preserve the least order so A, B, A -> A, B
@@ -285,7 +290,7 @@ dns_rdataslab_fromrdataset(dns_rdataset_
 #endif
 
for (i = 0; i < nalloc; i++) {
-   if (x[i].rdata.data == NULL)
+   if (x[i].rdata.data == &removed)
continue;
 #if DNS_RDATASET_FIXED
offsettable[x[i].order] = rawbuf - offsetbase;

Modified: vendor/bind9/dist-9.6/version
==
--- vendor/bind9/dist-9.6/version   Mon Jun  4 22:14:33 2012
(r236587)
+++ vendor/bind9/dist-9.6/version   Mon Jun  4 22:19:09 2012
(r236588)
@@ -7,4 +7,4 @@ MAJORVER=9
 MINORVER=6
 PATCHVER=
 RELEASETYPE=-ESV
-RELEASEVER=-R7
+RELEASEVER=-R7-P1
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r236589 - vendor/bind9/9.6-ESV-R7-P1

2012-06-04 Thread Doug Barton
Author: dougb
Date: Mon Jun  4 22:19:32 2012
New Revision: 236589
URL: http://svn.freebsd.org/changeset/base/236589

Log:
  Tag the 9.6-ESV-R7-P1 release

Added:
  vendor/bind9/9.6-ESV-R7-P1/
 - copied from r236588, vendor/bind9/dist-9.6/
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r236590 - in stable/8/contrib/bind9: . lib/dns

2012-06-04 Thread Doug Barton
Author: dougb
Date: Mon Jun  4 22:21:55 2012
New Revision: 236590
URL: http://svn.freebsd.org/changeset/base/236590

Log:
  Upgrade to 9.6-ESV-R7-P1, the latest from ISC. This version contains
  a critical bugfix:
  
Processing of DNS resource records where the rdata field is zero length
may cause various issues for the servers handling them.
  
Processing of these records may lead to unexpected outcomes. Recursive
servers may crash or disclose some portion of memory to the client.
Secondary servers may crash on restart after transferring a zone
containing these records. Master servers may corrupt zone data if the
zone option "auto-dnssec" is set to "maintain". Other unexpected
problems that are not listed here may also be encountered.
  
  All BIND users are strongly encouraged to upgrade.

Modified:
  stable/8/contrib/bind9/CHANGES
  stable/8/contrib/bind9/lib/dns/rdata.c
  stable/8/contrib/bind9/lib/dns/rdataslab.c
  stable/8/contrib/bind9/version
Directory Properties:
  stable/8/contrib/bind9/   (props changed)

Modified: stable/8/contrib/bind9/CHANGES
==
--- stable/8/contrib/bind9/CHANGES  Mon Jun  4 22:19:32 2012
(r236589)
+++ stable/8/contrib/bind9/CHANGES  Mon Jun  4 22:21:55 2012
(r236590)
@@ -1,3 +1,8 @@
+   --- 9.6-ESV-R7-P1 released ---
+
+3331.  [security]  dns_rdataslab_fromrdataset could produce bad
+   rdataslabs. [RT #29644]
+
--- 9.6-ESV-R7 released ---
 
 3318.  [tuning]Reduce the amount of work performed while holding a

Modified: stable/8/contrib/bind9/lib/dns/rdata.c
==
--- stable/8/contrib/bind9/lib/dns/rdata.c  Mon Jun  4 22:19:32 2012
(r236589)
+++ stable/8/contrib/bind9/lib/dns/rdata.c  Mon Jun  4 22:21:55 2012
(r236590)
@@ -345,8 +345,8 @@ dns_rdata_compare(const dns_rdata_t *rda
 
REQUIRE(rdata1 != NULL);
REQUIRE(rdata2 != NULL);
-   REQUIRE(rdata1->data != NULL);
-   REQUIRE(rdata2->data != NULL);
+   REQUIRE(rdata1->length == 0 || rdata1->data != NULL);
+   REQUIRE(rdata2->length == 0 || rdata2->data != NULL);
REQUIRE(DNS_RDATA_VALIDFLAGS(rdata1));
REQUIRE(DNS_RDATA_VALIDFLAGS(rdata2));
 

Modified: stable/8/contrib/bind9/lib/dns/rdataslab.c
==
--- stable/8/contrib/bind9/lib/dns/rdataslab.c  Mon Jun  4 22:19:32 2012
(r236589)
+++ stable/8/contrib/bind9/lib/dns/rdataslab.c  Mon Jun  4 22:21:55 2012
(r236590)
@@ -126,6 +126,11 @@ isc_result_t
 dns_rdataslab_fromrdataset(dns_rdataset_t *rdataset, isc_mem_t *mctx,
   isc_region_t *region, unsigned int reservelen)
 {
+   /*
+* Use &removed as a sentinal pointer for duplicate
+* rdata as rdata.data == NULL is valid.
+*/
+   static unsigned char removed;
struct xrdata  *x;
unsigned char  *rawbuf;
 #if DNS_RDATASET_FIXED
@@ -165,6 +170,7 @@ dns_rdataslab_fromrdataset(dns_rdataset_
INSIST(result == ISC_R_SUCCESS);
dns_rdata_init(&x[i].rdata);
dns_rdataset_current(rdataset, &x[i].rdata);
+   INSIST(x[i].rdata.data != &removed);
 #if DNS_RDATASET_FIXED
x[i].order = i;
 #endif
@@ -197,8 +203,7 @@ dns_rdataslab_fromrdataset(dns_rdataset_
 */
for (i = 1; i < nalloc; i++) {
if (compare_rdata(&x[i-1].rdata, &x[i].rdata) == 0) {
-   x[i-1].rdata.data = NULL;
-   x[i-1].rdata.length = 0;
+   x[i-1].rdata.data = &removed;
 #if DNS_RDATASET_FIXED
/*
 * Preserve the least order so A, B, A -> A, B
@@ -285,7 +290,7 @@ dns_rdataslab_fromrdataset(dns_rdataset_
 #endif
 
for (i = 0; i < nalloc; i++) {
-   if (x[i].rdata.data == NULL)
+   if (x[i].rdata.data == &removed)
continue;
 #if DNS_RDATASET_FIXED
offsettable[x[i].order] = rawbuf - offsetbase;

Modified: stable/8/contrib/bind9/version
==
--- stable/8/contrib/bind9/version  Mon Jun  4 22:19:32 2012
(r236589)
+++ stable/8/contrib/bind9/version  Mon Jun  4 22:21:55 2012
(r236590)
@@ -7,4 +7,4 @@ MAJORVER=9
 MINORVER=6
 PATCHVER=
 RELEASETYPE=-ESV
-RELEASEVER=-R7
+RELEASEVER=-R7-P1
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r236591 - head/share/man/man4

2012-06-04 Thread Sean Bruno
Author: sbruno
Date: Mon Jun  4 22:46:04 2012
New Revision: 236591
URL: http://svn.freebsd.org/changeset/base/236591

Log:
  Lines were a bit too long.  Wrap some of them to 60 columns.
  
  Suggested by:   bjk@
  MFC after:  3 days

Modified:
  head/share/man/man4/bce.4

Modified: head/share/man/man4/bce.4
==
--- head/share/man/man4/bce.4   Mon Jun  4 22:21:55 2012(r236590)
+++ head/share/man/man4/bce.4   Mon Jun  4 22:46:04 2012(r236591)
@@ -28,7 +28,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd June 1, 2012
+.Dd June 4, 2012
 .Dt BCE 4
 .Os
 .Sh NAME
@@ -213,45 +213,58 @@ Enable/Disable strict RX frame size chec
 Enable/Disable frame header/payload splitting (default 1).
 .It Va hw.bce.rx_pages
 Set the number of memory pages assigned to recieve packets by the driver.
-Due to alignment issues, this value can only be of the set 1, 2, 4 or 8 
(default 2).
+Due to alignment issues, this value can only be of the set 
+1, 2, 4 or 8 (default 2).
 .It Va hw.bce.tx_pages
-Set the number of memory pages assigned to transmit packets by the driver.
-Due to alignment issues, this value can only be of the set 1, 2, 4 or 8 
(default 2).
+Set the number of memory pages assigned to transmit packets 
+by the driver.
+Due to alignment issues, this value can only be of the set 
+1, 2, 4 or 8 (default 2).
 .It Va hw.bce.rx_ticks
-Time in microsecond ticks to wait before generating a status block updates due 
to RX processing activity.
+Time in microsecond ticks to wait before generating a status 
+block updates due to RX processing activity.
 Values from 0-100 are valid.
 A value of 0 disables this status block update.
-Cannot be set to 0 if hw.bce.rx_quick_cons_trip is also 0 (default 18).
+Cannot be set to 0 if hw.bce.rx_quick_cons_trip is also 0 
+(default 18).
 .It Va hw.bce.rx_ticks_int
-Time in microsecond ticks to wait during RX interrupt processing before 
generating a status block update.
+Time in microsecond ticks to wait during RX interrupt 
+processing before generating a status block update.
 Values from 0-100 are valid.
 Valid values are in the range from 0-100.
 A value of 0 disables this status block update (default 18).
 .It Va hw.bce.rx_quick_cons_trip
-Number of RX Quick BD Chain entries that must be completed before a status 
block is generated.
+Number of RX Quick BD Chain entries that must be completed 
+before a status block is generated.
 Values from 0-256 are valid.
 A value of 0 disables this status block update.
 Cannot be set to 0 if hw.bce.rx_ticks is also 0 (default 6).
 .It Va hw.bce.rx_quick_cons_trip_int
-Number of RX quick BD entries that must be completed before a status block is 
generated duing interrupt processing.
+Number of RX quick BD entries that must be completed before 
+a status block is generated duing interrupt processing.
 Values from 0-256 are valid.
 A value of 0 disables this status block update (default 6).
 .It Va hw.bce.tx_ticks
-Time in microsecond ticks to wait before a status block update is generated 
due to TX activitiy.
+Time in microsecond ticks to wait before a status block 
+update is generated due to TX activitiy.
 Values from 0-100 are valid.
 A value of 0 disables this status block update.
-Cannot be set to 0 if hw.bce.tx_quick_cons_trip is also 0 (default 80).
+Cannot be set to 0 if hw.bce.tx_quick_cons_trip is also 0 
+(default 80).
 .It Va hw.bce.tx_ticks_int
-Time in microsecond ticks to wait in interrupt processing before a status 
block update is generated due to TX activity
+Time in microsecond ticks to wait in interrupt processing 
+before a status block update is generated due to TX activity
 Values from 0-100 are valid.
 A value of 0 disables this status block update (default 80).
 .It Va hw.bce.tx_cons_trip
-How many TX Quick BD Chain entries that must be completed before a status 
block is generated.
+How many TX Quick BD Chain entries that must be completed 
+before a status block is generated.
 Values from 0-100 are valid.
 A value of 0 disables this status block update.
 Cannot be set to 0 if hw.bce.tx_ticks is also 0 (default 20).
 .It Va hw.bce.tx_cons_trip_int
-How many TX Quick BD Chain entries that must be completed before a status 
block is generated during an interrupt.
+How many TX Quick BD Chain entries that must be completed 
+before a status block is generated during an interrupt.
 Values from 0-100 are valid.
 A value of 0 disables this status block update (default 20).
 .El
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r236592 - in head/sys: dev/filemon modules modules/filemon

2012-06-04 Thread David E. O'Brien
Author: obrien
Date: Mon Jun  4 22:54:19 2012
New Revision: 236592
URL: http://svn.freebsd.org/changeset/base/236592

Log:
  Add the 'filemon' device.  'filemon' is a kernel module that provides a device
  interface for processes to record system calls of its children.
  
  Submitted by: Juniper Networks.

Added:
  head/sys/dev/filemon/
  head/sys/dev/filemon/filemon.c   (contents, props changed)
  head/sys/dev/filemon/filemon.h   (contents, props changed)
  head/sys/dev/filemon/filemon_lock.c   (contents, props changed)
  head/sys/dev/filemon/filemon_wrapper.c   (contents, props changed)
  head/sys/modules/filemon/
  head/sys/modules/filemon/Makefile   (contents, props changed)
Modified:
  head/sys/modules/Makefile

Added: head/sys/dev/filemon/filemon.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/dev/filemon/filemon.c  Mon Jun  4 22:54:19 2012
(r236592)
@@ -0,0 +1,377 @@
+/*-
+ * Copyright (c) 2011, David E. O'Brien.
+ * Copyright (c) 2009-2011, Juniper Networks, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JUNIPER NETWORKS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL JUNIPER NETWORKS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#if __FreeBSD_version >= 900041
+#include 
+#endif
+
+#include "filemon.h"
+
+#if defined(COMPAT_IA32) || defined(COMPAT_FREEBSD32) || defined(COMPAT_ARCH32)
+#include 
+#include 
+
+extern struct sysentvec ia32_freebsd_sysvec;
+#endif
+
+extern struct sysentvec elf32_freebsd_sysvec;
+extern struct sysentvec elf64_freebsd_sysvec;
+
+static d_close_t   filemon_close;
+static d_ioctl_t   filemon_ioctl;
+static d_open_tfilemon_open;
+static int filemon_unload(void);
+static voidfilemon_load(void *);
+
+static struct cdevsw filemon_cdevsw = {
+   .d_version  = D_VERSION,
+   .d_close= filemon_close,
+   .d_ioctl= filemon_ioctl,
+   .d_open = filemon_open,
+   .d_name = "filemon",
+};
+
+MALLOC_DECLARE(M_FILEMON);
+MALLOC_DEFINE(M_FILEMON, "filemon", "File access monitor");
+
+struct filemon {
+   TAILQ_ENTRY(filemon) link;  /* Link into the in-use list. */
+   struct mtx  mtx;/* Lock mutex for this filemon. */
+   struct cv   cv; /* Lock condition variable for this
+  filemon. */
+   struct file *fp;/* Output file pointer. */
+   struct thread   *locker;/* Ptr to the thread locking this
+  filemon. */
+   pid_t   pid;/* The process ID being monitored. */
+   charfname1[MAXPATHLEN]; /* Temporary filename buffer. */
+   charfname2[MAXPATHLEN]; /* Temporary filename buffer. */
+   charmsgbufr[1024];  /* Output message buffer. */
+};
+
+static TAILQ_HEAD(, filemon) filemons_inuse = 
TAILQ_HEAD_INITIALIZER(filemons_inuse);
+static TAILQ_HEAD(, filemon) filemons_free = 
TAILQ_HEAD_INITIALIZER(filemons_free);
+static int n_readers = 0;
+static struct mtx access_mtx;
+static struct cv access_cv;
+static struct thread *access_owner = NULL;
+static struct thread *access_requester = NULL;
+
+#if __FreeBSD_version < 701000
+static struct clonedevs *filemon_clones;
+static eventhandler_tageh_tag;
+#else
+static struct cdev *filemon_dev;
+#endif
+
+#include "filemon_lock.c"
+#include "filemon_wrapper.c"
+
+#if __FreeBSD_versio

svn commit: r236593 - head/share/man/man4

2012-06-04 Thread David E. O'Brien
Author: obrien
Date: Mon Jun  4 22:59:06 2012
New Revision: 236593
URL: http://svn.freebsd.org/changeset/base/236593

Log:
  Add a man page for filemon(4) [r236592].

Added:
  head/share/man/man4/filemon.4   (contents, props changed)
Modified:
  head/share/man/man4/Makefile

Modified: head/share/man/man4/Makefile
==
--- head/share/man/man4/MakefileMon Jun  4 22:54:19 2012
(r236592)
+++ head/share/man/man4/MakefileMon Jun  4 22:59:06 2012
(r236593)
@@ -126,6 +126,7 @@ MAN=aac.4 \
fdt.4 \
fdtbus.4 \
ffclock.4 \
+   filemon.4 \
firewire.4 \
fpa.4 \
fwe.4 \

Added: head/share/man/man4/filemon.4
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/share/man/man4/filemon.4   Mon Jun  4 22:59:06 2012
(r236593)
@@ -0,0 +1,166 @@
+.\" Copyright (c) 2012
+.\"David E. O'Brien .  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. All advertising materials mentioning features or use of this software
+.\"must display the following acknowledgement:
+.\"This product includes software developed by David E. O'Brien and
+.\"contributors.
+.\" 4. Neither the name of the author 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 THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd May 30, 2012
+.Dt FILEMON 4
+.Os
+.Sh NAME
+.Nm filemon
+.Nd the filemon device
+.Sh SYNOPSIS
+.In dev/filemon/filemon.h
+.Sh DESCRIPTION
+The
+.Nm
+device allows a process to collect file operations data of its children.
+The device
+.Pa /dev/filemon
+responds to two
+.Xr ioctl 2
+calls.
+.Pp
+System calls are denoted using the following single letters:
+.Bl -tag -width indent -compact
+.It Dq Li C
+.Xr chdir 2
+.It Dq Li D
+.Xr unlink 2
+.It Dq Li E
+.Xr exec 2
+.It Dq Li F
+.Xr fork 2 ,
+.Xr vfork 2
+.It Dq Li L
+.Xr link 2 ,
+.Xr linkat 2 ,
+.Xr symlink 2 ,
+.Xr symlinkat 2
+.It Dq Li M
+.Xr rename 2
+.It Dq Li R
+.Xr open 2
+for read
+.It Dq Li S
+.Xr stat 2
+.It Dq Li W
+.Xr open 2
+for write
+.It Dq Li X
+.Xr _exit 2
+.El
+.Pp
+Note that
+.Dq R
+following
+.Dq W
+records can represent a single
+.Xr open 2
+for R/W,
+or two seperate
+.Xr open 2
+calls, one for
+R
+and one for
+W.
+.Sh IOCTLS
+User mode programs communicate with the filemon driver through a
+number of ioctls which are described below.
+Each takes a single argument.
+.Bl -tag -width FILEMON_SET_PID
+.It Dv FILEMON_SET_FD
+Write the internal tracing buffer to the supplied open file descriptor.
+.It Dv FILEMON_SET_PID .
+Child process ID to trace.
+.El
+.Pp
+.Sh RETURN VALUES
+The ioctl returns zero on success and non-zero on failure.
+.Sh EXAMPLES
+.Bd -literal -offset indent
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+static void
+open_filemon(void)
+{
+   pid_t child;
+   int fm_fd, fm_log;
+
+   if ((fm_fd = open("/dev/filemon", O_RDWR)) == -1)
+   err(1, "open(\"/dev/filemon\", O_RDWR)");
+   if ((fm_log = open("filemon.out",
+   O_CREAT | O_WRONLY | O_TRUNC, DEFFILEMODE)) == -1)
+   err(1, "open(filemon.out)");
+
+   if (ioctl(fm_fd, FILEMON_SET_FD, &fm_log) < 0)
+   err(1, "Cannot set filemon log file descriptor");
+   /* Set up these two fd's to close on exec. */
+   (void)fcntl(fm_fd, F_SETFD, FD_CLOEXEC);
+   (void)fcntl(fm_log, F_SETFD, FD_CLOEXEC);
+
+   if ((child = fork()) == 0) {
+  

svn commit: r236594 - head/tools/regression/filemon

2012-06-04 Thread David E. O'Brien
Author: obrien
Date: Mon Jun  4 22:59:33 2012
New Revision: 236594
URL: http://svn.freebsd.org/changeset/base/236594

Log:
  Add a regression test for filemon(4) [r236592].

Added:
  head/tools/regression/filemon/
  head/tools/regression/filemon/Makefile   (contents, props changed)
  head/tools/regression/filemon/filemontest.c   (contents, props changed)
  head/tools/regression/filemon/test_script.sh   (contents, props changed)

Added: head/tools/regression/filemon/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tools/regression/filemon/Makefile  Mon Jun  4 22:59:33 2012
(r236594)
@@ -0,0 +1,26 @@
+# $FreeBSD$
+
+PROG=  filemontest
+
+NO_MAN=
+
+WARNS?=6
+CFLAGS+= -I${.CURDIR}/../../../sys
+
+# Cannot use .OBJDIR -- 'filemontest' expects 'test_script.sh' in .
+test: ${PROG} clean-test
+   cd ${.CURDIR} ; \
+   for A in 1 2 3 4 5 6 7 8 9 0; do \
+   for B in 1 2 3 4 5 6 7 8 9 0; do \
+   for C in 1 2 3 4 5 6 7 8 9 0; do \
+   ${.OBJDIR}/${PROG} ;\
+   done ;\
+   done ;\
+   done
+   @cd ${.CURDIR} ; set +e ; egrep '(Start|Stop) .*\.' filemon_log.* | \
+   grep -q -v '\.[0-9][0-9][0-9][0-9][0-9][0-9]$$' || echo "Time stamp 
format OK"
+
+clean-test:
+   cd ${.CURDIR} ; rm -f filemon_log.*
+
+.include 

Added: head/tools/regression/filemon/filemontest.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tools/regression/filemon/filemontest.c Mon Jun  4 22:59:33 2012
(r236594)
@@ -0,0 +1,75 @@
+/*-
+ * Copyright (c) 2009-2011, Juniper Networks, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JUNIPER NETWORKS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL JUNIPER NETWORKS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+/*
+ * This simple test of filemon expects a test script called
+ * "test_script.sh" in the cwd.
+ */
+
+int
+main(void) {
+   char log_name[] = "filemon_log.XX";
+   pid_t child;
+   int fm_fd, fm_log;
+
+   if ((fm_fd = open("/dev/filemon", O_RDWR)) == -1)
+   err(1, "open(\"/dev/filemon\", O_RDWR)");
+   if ((fm_log = mkstemp(log_name)) == -1)
+   err(1, "mkstemp(%s)", log_name);
+
+   if (ioctl(fm_fd, FILEMON_SET_FD, &fm_log) < 0)
+   err(1, "Cannot set filemon log file descriptor");
+
+   /* Set up these two fd's to close on exec. */
+   (void)fcntl(fm_fd, F_SETFD, FD_CLOEXEC);
+   (void)fcntl(fm_log, F_SETFD, FD_CLOEXEC);
+
+   if ((child = fork()) == 0) {
+   system("./test_script.sh");
+   return 0;
+   } else {
+   if (ioctl(fm_fd, FILEMON_SET_PID, &child) < 0)
+   err(1, "Cannot set filemon PID");
+   wait(&child);
+   close(fm_fd);
+// printf("Results in %s\n", log_name);
+   }
+   return 0;
+}

Added: head/tools/regression/filemon/test_script.sh
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tools/regression/filemon/test_script.shMon Jun  4 22:59:33 
2012(r236594)
@@ -0,0 +1,43 @@
+#! /bin/sh
+#
+# Copyright (c) 2011, Juniper Networks, Inc.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions

Re: svn commit: r236593 - head/share/man/man4

2012-06-04 Thread Andrew Thompson
On 5 June 2012 10:59, David E. O'Brien  wrote:
> Author: obrien
> Date: Mon Jun  4 22:59:06 2012
> New Revision: 236593
> URL: http://svn.freebsd.org/changeset/base/236593
>
> Log:
>  Add a man page for filemon(4) [r236592].

> +static void
> +open_filemon(void)
> +{
> +
> +       if ((child = fork()) == 0) {
> +               /* Do something here. */
> +               return 0;
> +       } else {
> +               if (ioctl(fm_fd, FILEMON_SET_PID, &child) < 0)
> +                       err(1, "Cannot set filemon PID");
> +               wait(&child);
> +               close(fm_fd);
> +       }
> +       return 0;

Does the race have to be managed between the parent SET_PID ioctl and
the child doing something?


Andrew
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r236595 - head/share/man/man4

2012-06-04 Thread Warren Block
Author: wblock (doc committer)
Date: Tue Jun  5 02:18:54 2012
New Revision: 236595
URL: http://svn.freebsd.org/changeset/base/236595

Log:
  More wording corrections and simplifications.
  
  Approved by:  gjb (mentor)

Modified:
  head/share/man/man4/vlan.4

Modified: head/share/man/man4/vlan.4
==
--- head/share/man/man4/vlan.4  Mon Jun  4 22:59:33 2012(r236594)
+++ head/share/man/man4/vlan.4  Tue Jun  5 02:18:54 2012(r236595)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd October 25, 2011
+.Dd June 4, 2012
 .Dt VLAN 4
 .Os
 .Sh NAME
@@ -33,7 +33,7 @@
 .Nd "IEEE 802.1Q VLAN network interface"
 .Sh SYNOPSIS
 To compile this driver into the kernel,
-place the following lines in your
+place the following line in your
 kernel configuration file:
 .Bd -ragged -offset indent
 .Cd "device vlan"
@@ -119,8 +119,8 @@ It may have either capability enabled pe
 a way to turn it off.
 The whole issue is very specific to a particular device and its driver.
 .Pp
-At present, physical interfaces capable of full VLAN processing
-in the hardware is limited to these devices:
+At present, these devices are capable of full VLAN processing
+in hardware:
 .Xr ae 4 ,
 .Xr age 4 ,
 .Xr alc 4 ,
@@ -196,7 +196,7 @@ for
 use and calculates the appropriate frame MTU based on the
 capabilities of the parent interface.
 Some other interfaces not listed above may handle long frames,
-but they do not advertise this ability of theirs.
+but they do not advertise this ability.
 The MTU setting on
 .Nm
 can be corrected manually if used in conjunction with such a parent interface.
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r236563 - head/sys/kern

2012-06-04 Thread Adrian Chadd
Hi,

This commit undid part of what you committed in a previous commit?



Adrian
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r236596 - in head: share/man/man4 share/man/man5 share/man/man7 sys/netinet/libalias usr.bin/find usr.bin/gzip usr.bin/usbhidctl

2012-06-04 Thread Eitan Adler
Author: eadler
Date: Tue Jun  5 03:14:39 2012
New Revision: 236596
URL: http://svn.freebsd.org/changeset/base/236596

Log:
  Fix style nit: don't use leading zero for dates in .Dd
  
  Prompted by:  brueffer
  Approved by:  brueffer
  MFC after:3 days

Modified:
  head/share/man/man4/io.4
  head/share/man/man4/ng_ksocket.4
  head/share/man/man5/make.conf.5
  head/share/man/man5/rc.conf.5
  head/share/man/man7/development.7
  head/sys/netinet/libalias/libalias.3
  head/usr.bin/find/find.1
  head/usr.bin/gzip/zmore.1
  head/usr.bin/usbhidctl/usbhidctl.1

Modified: head/share/man/man4/io.4
==
--- head/share/man/man4/io.4Tue Jun  5 02:18:54 2012(r236595)
+++ head/share/man/man4/io.4Tue Jun  5 03:14:39 2012(r236596)
@@ -27,7 +27,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd June 01, 2010
+.Dd June 1, 2010
 .Dt IO 4
 .Os
 .Sh NAME

Modified: head/share/man/man4/ng_ksocket.4
==
--- head/share/man/man4/ng_ksocket.4Tue Jun  5 02:18:54 2012
(r236595)
+++ head/share/man/man4/ng_ksocket.4Tue Jun  5 03:14:39 2012
(r236596)
@@ -34,7 +34,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd January 09, 2012
+.Dd January 9, 2012
 .Dt NG_KSOCKET 4
 .Os
 .Sh NAME

Modified: head/share/man/man5/make.conf.5
==
--- head/share/man/man5/make.conf.5 Tue Jun  5 02:18:54 2012
(r236595)
+++ head/share/man/man5/make.conf.5 Tue Jun  5 03:14:39 2012
(r236596)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd May 02, 2012
+.Dd May 2, 2012
 .Dt MAKE.CONF 5
 .Os
 .Sh NAME

Modified: head/share/man/man5/rc.conf.5
==
--- head/share/man/man5/rc.conf.5   Tue Jun  5 02:18:54 2012
(r236595)
+++ head/share/man/man5/rc.conf.5   Tue Jun  5 03:14:39 2012
(r236596)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd May 06, 2012
+.Dd May 6, 2012
 .Dt RC.CONF 5
 .Os
 .Sh NAME

Modified: head/share/man/man7/development.7
==
--- head/share/man/man7/development.7   Tue Jun  5 02:18:54 2012
(r236595)
+++ head/share/man/man7/development.7   Tue Jun  5 03:14:39 2012
(r236596)
@@ -23,7 +23,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd May 02, 2012
+.Dd May 2, 2012
 .Dt DEVELOPMENT 7
 .Os
 .Sh NAME

Modified: head/sys/netinet/libalias/libalias.3
==
--- head/sys/netinet/libalias/libalias.3Tue Jun  5 02:18:54 2012
(r236595)
+++ head/sys/netinet/libalias/libalias.3Tue Jun  5 03:14:39 2012
(r236596)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd July 04, 2011
+.Dd July 4, 2011
 .Dt LIBALIAS 3
 .Os
 .Sh NAME

Modified: head/usr.bin/find/find.1
==
--- head/usr.bin/find/find.1Tue Jun  5 02:18:54 2012(r236595)
+++ head/usr.bin/find/find.1Tue Jun  5 03:14:39 2012(r236596)
@@ -31,7 +31,7 @@
 .\"@(#)find.1  8.7 (Berkeley) 5/9/95
 .\" $FreeBSD$
 .\"
-.Dd May 06, 2012
+.Dd May 6, 2012
 .Dt FIND 1
 .Os
 .Sh NAME

Modified: head/usr.bin/gzip/zmore.1
==
--- head/usr.bin/gzip/zmore.1   Tue Jun  5 02:18:54 2012(r236595)
+++ head/usr.bin/gzip/zmore.1   Tue Jun  5 03:14:39 2012(r236596)
@@ -20,7 +20,7 @@
 .\" Materiel Command, USAF, under agreement number F39502-99-1-0512.
 .\"
 .\" $FreeBSD$
-.Dd February 06, 2011
+.Dd February 6, 2011
 .Dt ZMORE 1
 .Os
 .Sh NAME

Modified: head/usr.bin/usbhidctl/usbhidctl.1
==
--- head/usr.bin/usbhidctl/usbhidctl.1  Tue Jun  5 02:18:54 2012
(r236595)
+++ head/usr.bin/usbhidctl/usbhidctl.1  Tue Jun  5 03:14:39 2012
(r236596)
@@ -28,7 +28,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd August 01, 2011
+.Dd August 1, 2011
 .Dt USBHIDCTL 1
 .Os
 .Sh NAME
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r236597 - head/sys/dev/ath

2012-06-04 Thread Adrian Chadd
Author: adrian
Date: Tue Jun  5 03:14:49 2012
New Revision: 236597
URL: http://svn.freebsd.org/changeset/base/236597

Log:
  Create a function - ath_tx_kick() - which is called where ath_start() is
  called to "kick" along TX.
  
  For now, schedule a taskqueue call.
  
  Later on I may go back to the direct call of ath_rx_tasklet() - but for
  now, this will do.
  
  I've tested UDP and TCP TX. UDP TX still achieves 240MBit, but TCP
  TX gets stuck at around 100MBit or so, instead of the 150MBit it should
  be at.  I'll re-test with no ACPI/power/sleep states enabled at startup
  and see what effect it has.
  
  This is in preparation for supporting an if_transmit() path, which will
  turn ath_tx_kick() into a NUL operation (as there won't be an ifnet
  queue to service.)
  
  Tested:
* AR9280 STA
  
  TODO:
* test on AR5416, AR9160, AR928x STA/AP modes
  
  PR:   kern/168649

Modified:
  head/sys/dev/ath/if_ath.c
  head/sys/dev/ath/if_ath_misc.h
  head/sys/dev/ath/if_ath_rx.c

Modified: head/sys/dev/ath/if_ath.c
==
--- head/sys/dev/ath/if_ath.c   Tue Jun  5 03:14:39 2012(r236596)
+++ head/sys/dev/ath/if_ath.c   Tue Jun  5 03:14:49 2012(r236597)
@@ -142,6 +142,7 @@ static void ath_vap_delete(struct ieee80
 static voidath_init(void *);
 static voidath_stop_locked(struct ifnet *);
 static voidath_stop(struct ifnet *);
+static voidath_tx_tasklet(void *arg, int npending);
 static int ath_reset_vap(struct ieee80211vap *, u_long);
 static int ath_media_change(struct ifnet *);
 static voidath_watchdog(void *);
@@ -2330,7 +2331,7 @@ ath_start(struct ifnet *ifp)
taskqueue_enqueue(sc->sc_tq, &sc->sc_txstarttask);
 }
 
-void
+static void
 ath_tx_tasklet(void *arg, int npending)
 {
struct ath_softc *sc = (struct ath_softc *) arg;
@@ -3509,8 +3510,7 @@ ath_tx_proc_q0(void *arg, int npending)
sc->sc_txproc_cnt--;
ATH_PCU_UNLOCK(sc);
 
-   // ath_start(ifp);
-   ath_tx_tasklet(sc, 1);
+   ath_tx_kick(sc);
 }
 
 /*
@@ -3560,8 +3560,7 @@ ath_tx_proc_q0123(void *arg, int npendin
sc->sc_txproc_cnt--;
ATH_PCU_UNLOCK(sc);
 
-   //ath_start(ifp);
-   ath_tx_tasklet(sc, 1);
+   ath_tx_kick(sc);
 }
 
 /*
@@ -3604,8 +3603,7 @@ ath_tx_proc(void *arg, int npending)
sc->sc_txproc_cnt--;
ATH_PCU_UNLOCK(sc);
 
-   //ath_start(ifp);
-   ath_tx_tasklet(sc, 1);
+   ath_tx_kick(sc);
 }
 #undef TXQACTIVE
 

Modified: head/sys/dev/ath/if_ath_misc.h
==
--- head/sys/dev/ath/if_ath_misc.h  Tue Jun  5 03:14:39 2012
(r236596)
+++ head/sys/dev/ath/if_ath_misc.h  Tue Jun  5 03:14:49 2012
(r236597)
@@ -83,7 +83,17 @@ extern void ath_setslottime(struct ath_s
  * we can kill this.
  */
 extern void ath_start(struct ifnet *ifp);
-extern void ath_tx_tasklet(void *arg, int npending);
 
+static inline void
+ath_tx_kick(struct ath_softc *sc)
+{
+
+   /*
+* Use a taskqueue to schedule a TX completion task,
+* even if we're in taskqueue context.  That way this can
+* be called from any context.
+*/
+   taskqueue_enqueue(sc->sc_tq, &sc->sc_txstarttask);
+}
 
 #endif

Modified: head/sys/dev/ath/if_ath_rx.c
==
--- head/sys/dev/ath/if_ath_rx.cTue Jun  5 03:14:39 2012
(r236596)
+++ head/sys/dev/ath/if_ath_rx.cTue Jun  5 03:14:49 2012
(r236597)
@@ -899,8 +899,7 @@ rx_proc_next:
ieee80211_ff_age_all(ic, 100);
 #endif
if (!IFQ_IS_EMPTY(&ifp->if_snd))
-   ath_tx_tasklet(sc, 1);
-   //ath_start(ifp);
+   ath_tx_kick(sc);
}
 #undef PA2DESC
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r236563 - head/sys/kern

2012-06-04 Thread Gleb Smirnoff
On Mon, Jun 04, 2012 at 07:48:58PM -0700, Adrian Chadd wrote:
A> This commit undid part of what you committed in a previous commit?

It didn't. Since we are sure that second arugment of m_cat() isn't
a chain, but a single M_EXT mbuf, we can skip using m_cat and reduce
code to m_last.

-- 
Totus tuus, Glebius.
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r236598 - head/sys/kern

2012-06-04 Thread Gleb Smirnoff
Author: glebius
Date: Tue Jun  5 05:16:04 2012
New Revision: 236598
URL: http://svn.freebsd.org/changeset/base/236598

Log:
  style(9) for r236563.

Modified:
  head/sys/kern/uipc_syscalls.c

Modified: head/sys/kern/uipc_syscalls.c
==
--- head/sys/kern/uipc_syscalls.c   Tue Jun  5 03:14:49 2012
(r236597)
+++ head/sys/kern/uipc_syscalls.c   Tue Jun  5 05:16:04 2012
(r236598)
@@ -2182,9 +2182,9 @@ retry_space:
m0->m_len = xfsize;
 
/* Append to mbuf chain. */
-   if (mtail != NULL) {
+   if (mtail != NULL)
mtail->m_next = m0;
-   } else if (m != NULL)
+   else if (m != NULL)
m_last(m)->m_next = m0;
else
m = m0;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r236599 - head/sys/dev/ath

2012-06-04 Thread Adrian Chadd
Author: adrian
Date: Tue Jun  5 06:03:55 2012
New Revision: 236599
URL: http://svn.freebsd.org/changeset/base/236599

Log:
  Mostly revert previous commit(s).  After doing a bunch of local testing,
  it turns out that it negatively affects performance.  I'm stil investigating
  exactly why deferring the IO causes such negative TCP performance but
  doesn't affect UDP preformance.
  
  Leave the ath_tx_kick() change in there however; it's going to be useful
  to have that there for if_transmit() work.
  
  PR:   kern/168649

Modified:
  head/sys/dev/ath/if_ath.c
  head/sys/dev/ath/if_ath_misc.h
  head/sys/dev/ath/if_athvar.h

Modified: head/sys/dev/ath/if_ath.c
==
--- head/sys/dev/ath/if_ath.c   Tue Jun  5 05:16:04 2012(r236598)
+++ head/sys/dev/ath/if_ath.c   Tue Jun  5 06:03:55 2012(r236599)
@@ -142,7 +142,6 @@ static void ath_vap_delete(struct ieee80
 static voidath_init(void *);
 static voidath_stop_locked(struct ifnet *);
 static voidath_stop(struct ifnet *);
-static voidath_tx_tasklet(void *arg, int npending);
 static int ath_reset_vap(struct ieee80211vap *, u_long);
 static int ath_media_change(struct ifnet *);
 static voidath_watchdog(void *);
@@ -374,7 +373,6 @@ ath_attach(u_int16_t devid, struct ath_s
"%s taskq", ifp->if_xname);
 
TASK_INIT(&sc->sc_rxtask, 0, ath_rx_tasklet, sc);
-   TASK_INIT(&sc->sc_txstarttask, 0, ath_tx_tasklet, sc);
TASK_INIT(&sc->sc_bmisstask, 0, ath_bmiss_proc, sc);
TASK_INIT(&sc->sc_bstucktask,0, ath_bstuck_proc, sc);
TASK_INIT(&sc->sc_resettask,0, ath_reset_proc, sc);
@@ -2327,15 +2325,6 @@ void
 ath_start(struct ifnet *ifp)
 {
struct ath_softc *sc = ifp->if_softc;
-
-   taskqueue_enqueue(sc->sc_tq, &sc->sc_txstarttask);
-}
-
-static void
-ath_tx_tasklet(void *arg, int npending)
-{
-   struct ath_softc *sc = (struct ath_softc *) arg;
-   struct ifnet *ifp = sc->sc_ifp;
struct ieee80211_node *ni;
struct ath_buf *bf;
struct mbuf *m, *next;

Modified: head/sys/dev/ath/if_ath_misc.h
==
--- head/sys/dev/ath/if_ath_misc.h  Tue Jun  5 05:16:04 2012
(r236598)
+++ head/sys/dev/ath/if_ath_misc.h  Tue Jun  5 06:03:55 2012
(r236599)
@@ -88,12 +88,7 @@ static inline void
 ath_tx_kick(struct ath_softc *sc)
 {
 
-   /*
-* Use a taskqueue to schedule a TX completion task,
-* even if we're in taskqueue context.  That way this can
-* be called from any context.
-*/
-   taskqueue_enqueue(sc->sc_tq, &sc->sc_txstarttask);
+   ath_start(sc->sc_ifp);
 }
 
 #endif

Modified: head/sys/dev/ath/if_athvar.h
==
--- head/sys/dev/ath/if_athvar.hTue Jun  5 05:16:04 2012
(r236598)
+++ head/sys/dev/ath/if_athvar.hTue Jun  5 06:03:55 2012
(r236599)
@@ -476,7 +476,6 @@ struct ath_softc {
struct mbuf *sc_rxpending;  /* pending receive data */
u_int32_t   *sc_rxlink; /* link ptr in last RX desc */
struct task sc_rxtask;  /* rx int processing */
-   struct task sc_txstarttask; /* ath_start() processing */
u_int8_tsc_defant;  /* current default antenna */
u_int8_tsc_rxotherant;  /* rx's on non-default antenna*/
u_int64_t   sc_lastrx;  /* tsf at last rx'd frame */
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r236600 - in stable/9/lib: libc++ libcxxrt

2012-06-04 Thread Dimitry Andric
Author: dim
Date: Tue Jun  5 06:41:47 2012
New Revision: 236600
URL: http://svn.freebsd.org/changeset/base/236600

Log:
  MFC r236442:
  
  Tabify libcxxrt and libc++'s Makefiles.

Modified:
  stable/9/lib/libc++/Makefile
  stable/9/lib/libcxxrt/Makefile
Directory Properties:
  stable/9/lib/libc++/   (props changed)
  stable/9/lib/libcxxrt/   (props changed)

Modified: stable/9/lib/libc++/Makefile
==
--- stable/9/lib/libc++/MakefileTue Jun  5 06:03:55 2012
(r236599)
+++ stable/9/lib/libc++/MakefileTue Jun  5 06:41:47 2012
(r236600)
@@ -1,156 +1,156 @@
 # $FreeBSD$
 
-LIBCXXRTDIR=${.CURDIR}/../../contrib/libcxxrt
-HDRDIR= ${.CURDIR}/../../contrib/libc++/include
-SRCDIR= ${.CURDIR}/../../contrib/libc++/src
-CXXINCLUDEDIR=  ${INCLUDEDIR}/c++/v${SHLIB_MAJOR}
+LIBCXXRTDIR=   ${.CURDIR}/../../contrib/libcxxrt
+HDRDIR=${.CURDIR}/../../contrib/libc++/include
+SRCDIR=${.CURDIR}/../../contrib/libc++/src
+CXXINCLUDEDIR= ${INCLUDEDIR}/c++/v${SHLIB_MAJOR}
 
 .PATH: ${SRCDIR}
 
-LIB=c++
-SHLIB_MAJOR=1
+LIB=   c++
+SHLIB_MAJOR=   1
 
-SRCS+=  algorithm.cpp\
-bind.cpp\
-chrono.cpp\
-condition_variable.cpp\
-debug.cpp\
-exception.cpp\
-future.cpp\
-hash.cpp\
-ios.cpp\
-iostream.cpp\
-locale.cpp\
-memory.cpp\
-mutex.cpp\
-new.cpp\
-random.cpp\
-regex.cpp\
-stdexcept.cpp\
-string.cpp\
-strstream.cpp\
-system_error.cpp\
-thread.cpp\
-typeinfo.cpp\
-utility.cpp\
-valarray.cpp
-
-WARNS=  0
-CXXFLAGS+=  -I${HDRDIR} -I${LIBCXXRTDIR} -std=c++0x -nostdlib -DLIBCXXRT
-
-DPADD=  ${LIBCXXRT}
-LDADD=  -lcxxrt
-LDFLAGS+=   --verbose
-INCSGROUPS= STD EXT
-
-STD_HEADERS=__bit_reference\
-__config\
-__debug\
-__functional_03\
-__functional_base\
-__functional_base_03\
-__hash_table\
-__locale\
-__mutex_base\
-__split_buffer\
-__sso_allocator\
-__std_stream\
-__tree\
-__tuple\
-__tuple_03\
-__undef_min_max\
-algorithm\
-array\
-atomic\
-bitset\
-cassert\
-ccomplex\
-cctype\
-cerrno\
-cfenv\
-cfloat\
-chrono\
-cinttypes\
-ciso646\
-climits\
-clocale\
-cmath\
-codecvt\
-complex\
-complex.h\
-condition_variable\
-csetjmp\
-csignal\
-cstdarg\
-cstdbool\
-cstddef\
-cstdint\
-cstdio\
-cstdlib\
-cstring\
-ctgmath\
-ctime\
-cwchar\
-cwctype\
-deque\
-exception\
-forward_list\
-fstream\
-functional\
-future\
-initializer_list\
-iomanip\
-ios\
-iosfwd\
-iostream\
-istream\
-iterator\
-limits\
-list\
-locale\
-map\
-memory\
-mutex\
-new\
-numeric\
-ostream\
-queue\
-random\
-ratio\
-regex\
-scoped_allocator\
-set\
-sstream\
-stack\
-stdexcept\
-streambuf\
-string\
-strstream\
-system_error\
-tgmath.h\
-thread\
-tuple\
-type_traits\
-typeindex\
-typeinfo\
-unordered_map\
-unordered_set\
-utility\
-valarray\
-vector
+SRCS+= algorithm.cpp\
+   bind.cpp\
+   chrono.cpp\
+   condition_variable.cpp\
+   debug.cpp\
+   exception.cpp\
+   future.cpp\
+   hash.cpp\
+   ios.cpp\
+   i

svn commit: r236601 - stable/9/lib/libc++

2012-06-04 Thread Dimitry Andric
Author: dim
Date: Tue Jun  5 06:43:45 2012
New Revision: 236601
URL: http://svn.freebsd.org/changeset/base/236601

Log:
  MFC r236444:
  
  Install libcxxrt's C++ ABI and unwind headers.  This is done in libc++'s
  Makefile, so these headers go into the same destination directory as
  libc++'s own headers, currently /usr/include/c++/v1.

Modified:
  stable/9/lib/libc++/Makefile
Directory Properties:
  stable/9/lib/libc++/   (props changed)

Modified: stable/9/lib/libc++/Makefile
==
--- stable/9/lib/libc++/MakefileTue Jun  5 06:41:47 2012
(r236600)
+++ stable/9/lib/libc++/MakefileTue Jun  5 06:43:45 2012
(r236601)
@@ -138,10 +138,17 @@ STD_HEADERS=  __bit_reference\
utility\
valarray\
vector
+RT_HEADERS=cxxabi.h\
+   unwind.h\
+   unwind-arm.h\
+   unwind-itanium.h
 
 .for hdr in ${STD_HEADERS}
 STD+=  ${HDRDIR}/${hdr}
 .endfor
+.for hdr in ${RT_HEADERS}
+STD+=  ${LIBCXXRTDIR}/${hdr}
+.endfor
 STDDIR=${CXXINCLUDEDIR}
 
 EXT_HEADERS=   __hash\
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"