svn commit: r297501 - head/usr.sbin/pciconf

2016-04-01 Thread John Baldwin
Author: jhb
Date: Sat Apr  2 01:59:53 2016
New Revision: 297501
URL: https://svnweb.freebsd.org/changeset/base/297501

Log:
  Output information about PCI-e devices with slots.
  
  In particular this includes additional information on HotPlug capable
  slots.

Modified:
  head/usr.sbin/pciconf/cap.c

Modified: head/usr.sbin/pciconf/cap.c
==
--- head/usr.sbin/pciconf/cap.c Sat Apr  2 01:55:43 2016(r297500)
+++ head/usr.sbin/pciconf/cap.c Sat Apr  2 01:59:53 2016(r297501)
@@ -410,6 +410,28 @@ aspm_string(uint8_t aspm)
}
 }
 
+static int
+slot_power(uint32_t cap)
+{
+   int mwatts;
+
+   mwatts = (cap & PCIEM_SLOT_CAP_SPLV) >> 7;
+   switch (cap & PCIEM_SLOT_CAP_SPLS) {
+   case 0x0:
+   mwatts *= 1000;
+   break;
+   case 0x1:
+   mwatts *= 100;
+   break;
+   case 0x2:
+   mwatts *= 10;
+   break;
+   default:
+   break;
+   }
+   return (mwatts);
+}
+
 static void
 cap_express(int fd, struct pci_conf *p, uint8_t ptr)
 {
@@ -452,8 +474,6 @@ cap_express(int fd, struct pci_conf *p, 
printf("type %d", (flags & PCIEM_FLAGS_TYPE) >> 4);
break;
}
-   if (flags & PCIEM_FLAGS_SLOT)
-   printf(" slot");
if (flags & PCIEM_FLAGS_IRQ)
printf(" MSI %d", (flags & PCIEM_FLAGS_IRQ) >> 9);
cap = read_config(fd, >pc_sel, ptr + PCIER_DEVICE_CAP, 4);
@@ -493,6 +513,26 @@ cap_express(int fd, struct pci_conf *p, 
printf(" ASPM %s(%s)", aspm_string(ctl & PCIEM_LINK_CTL_ASPMC),
aspm_string((cap & PCIEM_LINK_CAP_ASPM) >> 10));
}
+   if (!(flags & PCIEM_FLAGS_SLOT))
+   return;
+   cap = read_config(fd, >pc_sel, ptr + PCIER_SLOT_CAP, 4);
+   sta = read_config(fd, >pc_sel, ptr + PCIER_SLOT_STA, 2);
+   ctl = read_config(fd, >pc_sel, ptr + PCIER_SLOT_CTL, 2);
+   printf("\n");
+   printf(" slot %d", (cap & PCIEM_SLOT_CAP_PSN) >> 19);
+   printf(" power limit %d mW", slot_power(cap));
+   if (cap & PCIEM_SLOT_CAP_HPC)
+   printf(" HotPlug(%s)", sta & PCIEM_SLOT_STA_PDS ? "present" :
+   "empty");
+   if (cap & PCIEM_SLOT_CAP_HPS)
+   printf(" surprise");
+   if (cap & PCIEM_SLOT_CAP_APB)
+   printf(" Attn Button");
+   if (cap & PCIEM_SLOT_CAP_PCP)
+   printf(" PC(%s)", ctl & PCIEM_SLOT_CTL_PCC ? "on" : "off");
+   if (cap & PCIEM_SLOT_CAP_MRLSP)
+   printf(" MRL(%s)", sta & PCIEM_SLOT_STA_MRLSS ? "open" :
+   "closed");
 }
 
 static void
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r297500 - head/usr.sbin/pciconf

2016-04-01 Thread John Baldwin
Author: jhb
Date: Sat Apr  2 01:55:43 2016
New Revision: 297500
URL: https://svnweb.freebsd.org/changeset/base/297500

Log:
  Various updates to the PCI-express capability output.
  
  - Group the output so that it follows the capability register set more
closely.  The first line now contains device information and the
second line contains link information.  As a result, ARI status is now
output on the first line, and the link width is moved down to the second
line of link information.
  - Only read the DEVICE_CAP2 register to check for ARI if the capability
version is >= 2.
  - Don't output any link information if the link capability and status
registers are zero.
  - Label the MSI interrupt index value as "MSI" instead of "IRQ".

Modified:
  head/usr.sbin/pciconf/cap.c

Modified: head/usr.sbin/pciconf/cap.c
==
--- head/usr.sbin/pciconf/cap.c Sat Apr  2 01:14:51 2016(r297499)
+++ head/usr.sbin/pciconf/cap.c Sat Apr  2 01:55:43 2016(r297500)
@@ -413,11 +413,13 @@ aspm_string(uint8_t aspm)
 static void
 cap_express(int fd, struct pci_conf *p, uint8_t ptr)
 {
-   uint32_t cap, cap2;
+   uint32_t cap;
uint16_t ctl, flags, sta;
+   unsigned int version;
 
flags = read_config(fd, >pc_sel, ptr + PCIER_FLAGS, 2);
-   printf("PCI-Express %d ", flags & PCIEM_FLAGS_VERSION);
+   version = flags & PCIEM_FLAGS_VERSION;
+   printf("PCI-Express %u ", version);
switch (flags & PCIEM_FLAGS_TYPE) {
case PCIEM_TYPE_ENDPOINT:
printf("endpoint");
@@ -453,9 +455,8 @@ cap_express(int fd, struct pci_conf *p, 
if (flags & PCIEM_FLAGS_SLOT)
printf(" slot");
if (flags & PCIEM_FLAGS_IRQ)
-   printf(" IRQ %d", (flags & PCIEM_FLAGS_IRQ) >> 9);
+   printf(" MSI %d", (flags & PCIEM_FLAGS_IRQ) >> 9);
cap = read_config(fd, >pc_sel, ptr + PCIER_DEVICE_CAP, 4);
-   cap2 = read_config(fd, >pc_sel, ptr + PCIER_DEVICE_CAP2, 4);
ctl = read_config(fd, >pc_sel, ptr + PCIER_DEVICE_CTL, 2);
printf(" max data %d(%d)",
MAX_PAYLOAD((ctl & PCIEM_CTL_MAX_PAYLOAD) >> 5),
@@ -466,12 +467,22 @@ cap_express(int fd, struct pci_conf *p, 
printf(" RO");
if (ctl & PCIEM_CTL_NOSNOOP_ENABLE)
printf(" NS");
+   if (version >= 2) {
+   cap = read_config(fd, >pc_sel, ptr + PCIER_DEVICE_CAP2, 4);
+   if ((cap & PCIEM_CAP2_ARI) != 0) {
+   ctl = read_config(fd, >pc_sel,
+   ptr + PCIER_DEVICE_CTL2, 4);
+   printf(" ARI %s",
+   (ctl & PCIEM_CTL2_ARI) ? "enabled" : "disabled");
+   }
+   }
cap = read_config(fd, >pc_sel, ptr + PCIER_LINK_CAP, 4);
sta = read_config(fd, >pc_sel, ptr + PCIER_LINK_STA, 2);
+   if (cap == 0 && sta == 0)
+   return;
+   printf("\n");
printf(" link x%d(x%d)", (sta & PCIEM_LINK_STA_WIDTH) >> 4,
(cap & PCIEM_LINK_CAP_MAX_WIDTH) >> 4);
-   if ((cap & (PCIEM_LINK_CAP_MAX_WIDTH | PCIEM_LINK_CAP_ASPM)) != 0)
-   printf("\n");
if ((cap & PCIEM_LINK_CAP_MAX_WIDTH) != 0) {
printf(" speed %s(%s)", (sta & PCIEM_LINK_STA_WIDTH) == 0 ?
"0.0" : link_speed_string(sta & PCIEM_LINK_STA_SPEED),
@@ -482,11 +493,6 @@ cap_express(int fd, struct pci_conf *p, 
printf(" ASPM %s(%s)", aspm_string(ctl & PCIEM_LINK_CTL_ASPMC),
aspm_string((cap & PCIEM_LINK_CAP_ASPM) >> 10));
}
-   if ((cap2 & PCIEM_CAP2_ARI) != 0) {
-   ctl = read_config(fd, >pc_sel, ptr + PCIER_DEVICE_CTL2, 4);
-   printf(" ARI %s",
-   (ctl & PCIEM_CTL2_ARI) ? "enabled" : "disabled");
-   }
 }
 
 static void
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r297499 - head/sys/cam/scsi

2016-04-01 Thread Pedro F. Giffuni
Author: pfg
Date: Sat Apr  2 01:14:51 2016
New Revision: 297499
URL: https://svnweb.freebsd.org/changeset/base/297499

Log:
  Small typo.

Modified:
  head/sys/cam/scsi/scsi_ch.c

Modified: head/sys/cam/scsi/scsi_ch.c
==
--- head/sys/cam/scsi/scsi_ch.c Fri Apr  1 23:31:57 2016(r297498)
+++ head/sys/cam/scsi/scsi_ch.c Sat Apr  2 01:14:51 2016(r297499)
@@ -659,7 +659,7 @@ chdone(struct cam_periph *periph, union 
 */
if (error == ERESTART) {
/*
-* A retry was scheuled, so
+* A retry was scheduled, so
 * just return.
 */
return;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r297498 - head/share/mk

2016-04-01 Thread Bryan Drewery
Author: bdrewery
Date: Fri Apr  1 23:31:57 2016
New Revision: 297498
URL: https://svnweb.freebsd.org/changeset/base/297498

Log:
  Follow-up r297282: Make the COPTS warning more useful.
  
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/share/mk/bsd.prog.mk

Modified: head/share/mk/bsd.prog.mk
==
--- head/share/mk/bsd.prog.mk   Fri Apr  1 20:38:15 2016(r297497)
+++ head/share/mk/bsd.prog.mk   Fri Apr  1 23:31:57 2016(r297498)
@@ -8,7 +8,7 @@
 
 # XXX The use of COPTS in modern makefiles is discouraged.
 .if defined(COPTS)
-.warning COPTS should be CFLAGS.
+.warning ${.CURDIR}: COPTS should be CFLAGS.
 CFLAGS+=${COPTS}
 .endif
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r297497 - head/sys/netinet

2016-04-01 Thread Michael Tuexen
Author: tuexen
Date: Fri Apr  1 20:38:15 2016
New Revision: 297497
URL: https://svnweb.freebsd.org/changeset/base/297497

Log:
  Set the chunk id for ERROR chunks.
  This is work with rrs@.
  MFC after:1 week

Modified:
  head/sys/netinet/sctp_output.c

Modified: head/sys/netinet/sctp_output.c
==
--- head/sys/netinet/sctp_output.c  Fri Apr  1 20:26:45 2016
(r297496)
+++ head/sys/netinet/sctp_output.c  Fri Apr  1 20:38:15 2016
(r297497)
@@ -8943,6 +8943,8 @@ sctp_queue_op_err(struct sctp_tcb *stcb,
chk->asoc = >asoc;
chk->data = op_err;
chk->whoTo = NULL;
+   chk->rec.chunk_id.id = SCTP_OPERATION_ERROR;
+   chk->rec.chunk_id.can_take_data = 0;
hdr = mtod(op_err, struct sctp_chunkhdr *);
hdr->chunk_type = SCTP_OPERATION_ERROR;
hdr->chunk_flags = 0;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r297496 - in head/sys: arm/conf arm/mv conf dev/uart

2016-04-01 Thread Jared McNeill
Author: jmcneill
Date: Fri Apr  1 20:26:45 2016
New Revision: 297496
URL: https://svnweb.freebsd.org/changeset/base/297496

Log:
  Move support for Synopsys Designware APB UART out of ns8250 and into a
  separate driver. Add support for activating clock and hwreset resources
  for these devices when the EXT_RESOURCES option is present.
  
  Reviewed by:  andrew, mmel, Emmanuel Vadot 
  Approved by:  adrian (mentor)
  Differential Revision:https://reviews.freebsd.org/D5749

Added:
  head/sys/dev/uart/uart_dev_snps.c   (contents, props changed)
Modified:
  head/sys/arm/conf/A10
  head/sys/arm/conf/A20
  head/sys/arm/conf/ARMADA38X
  head/sys/arm/conf/RK3188
  head/sys/arm/mv/files.mv
  head/sys/conf/files
  head/sys/dev/uart/uart_dev_ns8250.c

Modified: head/sys/arm/conf/A10
==
--- head/sys/arm/conf/A10   Fri Apr  1 18:45:04 2016(r297495)
+++ head/sys/arm/conf/A10   Fri Apr  1 20:26:45 2016(r297496)
@@ -61,7 +61,7 @@ deviceahci# 
AHCI-compatible SATA co
 
 # Console and misc
 device uart
-device uart_ns8250
+device uart_snps
 device pty
 device snp
 device md

Modified: head/sys/arm/conf/A20
==
--- head/sys/arm/conf/A20   Fri Apr  1 18:45:04 2016(r297495)
+++ head/sys/arm/conf/A20   Fri Apr  1 20:26:45 2016(r297496)
@@ -71,7 +71,7 @@ deviceahci# 
AHCI-compatible SATA co
 
 # Console and misc
 device uart
-device uart_ns8250
+device uart_snps
 device pty
 device snp
 device md

Modified: head/sys/arm/conf/ARMADA38X
==
--- head/sys/arm/conf/ARMADA38X Fri Apr  1 18:45:04 2016(r297495)
+++ head/sys/arm/conf/ARMADA38X Fri Apr  1 20:26:45 2016(r297496)
@@ -48,7 +48,7 @@ devicemd
 
 # Serial ports
 device uart
-device uart_ns8250
+device uart_snps
 
 # Network
 device ether

Modified: head/sys/arm/conf/RK3188
==
--- head/sys/arm/conf/RK3188Fri Apr  1 18:45:04 2016(r297495)
+++ head/sys/arm/conf/RK3188Fri Apr  1 20:26:45 2016(r297496)
@@ -59,7 +59,7 @@ devicedwmmc
 
 # Console and misc
 device uart
-device uart_ns8250
+device uart_snps
 device pty
 device snp
 device md

Modified: head/sys/arm/mv/files.mv
==
--- head/sys/arm/mv/files.mvFri Apr  1 18:45:04 2016(r297495)
+++ head/sys/arm/mv/files.mvFri Apr  1 20:26:45 2016(r297496)
@@ -26,6 +26,7 @@ dev/mge/if_mge.c  optionalmge
 dev/nand/nfc_mv.c  optionalnand
 dev/mvs/mvs_soc.c  optionalmvs
 dev/uart/uart_dev_ns8250.c optionaluart
+dev/uart/uart_dev_snps.c   optionaluart
 dev/usb/controller/ehci_mv.c   optionalehci
 dev/usb/controller/xhci_mv.c   optionalxhci
 

Modified: head/sys/conf/files
==
--- head/sys/conf/files Fri Apr  1 18:45:04 2016(r297495)
+++ head/sys/conf/files Fri Apr  1 20:26:45 2016(r297496)
@@ -2555,11 +2555,12 @@ dev/uart/uart_bus_puc.c optional uart p
 dev/uart/uart_bus_scc.coptional uart scc
 dev/uart/uart_core.c   optional uart
 dev/uart/uart_dbg.coptional uart gdb
-dev/uart/uart_dev_ns8250.c optional uart uart_ns8250
+dev/uart/uart_dev_ns8250.c optional uart uart_ns8250 | uart uart_snps
 dev/uart/uart_dev_pl011.c  optional uart pl011
 dev/uart/uart_dev_quicc.c  optional uart quicc
 dev/uart/uart_dev_sab82532.c   optional uart uart_sab82532
 dev/uart/uart_dev_sab82532.c   optional uart scc
+dev/uart/uart_dev_snps.c   optional uart uart_snps
 dev/uart/uart_dev_z8530.c  optional uart uart_z8530
 dev/uart/uart_dev_z8530.c  optional uart scc
 dev/uart/uart_if.m optional uart

Modified: head/sys/dev/uart/uart_dev_ns8250.c
==
--- head/sys/dev/uart/uart_dev_ns8250.c Fri Apr  1 18:45:04 2016
(r297495)
+++ head/sys/dev/uart/uart_dev_ns8250.c Fri Apr  1 20:26:45 2016
(r297496)
@@ -398,7 +398,6 @@ struct uart_class uart_ns8250_class = {
 static struct ofw_compat_data compat_data[] = {
{"ns16550", (uintptr_t)_ns8250_class},
{"ns16550a",(uintptr_t)_ns8250_class},
-   {"snps,dw-apb-uart",(uintptr_t)_ns8250_class},
{NULL,  

svn commit: r297495 - head/sys/kern

2016-04-01 Thread Edward Tomasz Napierala
Author: trasz
Date: Fri Apr  1 18:45:04 2016
New Revision: 297495
URL: https://svnweb.freebsd.org/changeset/base/297495

Log:
  Fix mismerge.
  
  MFC after:1 month
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/kern/kern_racct.c

Modified: head/sys/kern/kern_racct.c
==
--- head/sys/kern/kern_racct.c  Fri Apr  1 18:36:10 2016(r297494)
+++ head/sys/kern/kern_racct.c  Fri Apr  1 18:45:04 2016(r297495)
@@ -1139,7 +1139,7 @@ racct_decay_post(void)
 }
 
 static void
-racct_decay()
+racct_decay(void)
 {
 
ASSERT_RACCT_ENABLED();
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r297494 - head/sys/kern

2016-04-01 Thread Edward Tomasz Napierala
Author: trasz
Date: Fri Apr  1 18:36:10 2016
New Revision: 297494
URL: https://svnweb.freebsd.org/changeset/base/297494

Log:
  Drop the 'resource' argument to racct_decay(); it wouldn't make sense
  to iterate separately for each resource.
  
  MFC after:1 month
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/kern/kern_racct.c

Modified: head/sys/kern/kern_racct.c
==
--- head/sys/kern/kern_racct.c  Fri Apr  1 18:29:38 2016(r297493)
+++ head/sys/kern/kern_racct.c  Fri Apr  1 18:36:10 2016(r297494)
@@ -1107,23 +1107,21 @@ racct_proc_wakeup(struct proc *p)
 }
 
 static void
-racct_decay_resource(struct racct *racct, void * res, void* dummy)
+racct_decay_callback(struct racct *racct, void *dummy1, void *dummy2)
 {
-   int resource;
int64_t r_old, r_new;
 
ASSERT_RACCT_ENABLED();
mtx_assert(_lock, MA_OWNED);
 
-   resource = *(int *)res;
-   r_old = racct->r_resources[resource];
+   r_old = racct->r_resources[RACCT_PCTCPU];
 
/* If there is nothing to decay, just exit. */
if (r_old <= 0)
return;
 
r_new = r_old * RACCT_DECAY_FACTOR / FSCALE;
-   racct->r_resources[resource] = r_new;
+   racct->r_resources[RACCT_PCTCPU] = r_new;
 }
 
 static void
@@ -1141,17 +1139,17 @@ racct_decay_post(void)
 }
 
 static void
-racct_decay(int resource)
+racct_decay()
 {
 
ASSERT_RACCT_ENABLED();
 
-   ui_racct_foreach(racct_decay_resource, racct_decay_pre,
-   racct_decay_post, , NULL);
-   loginclass_racct_foreach(racct_decay_resource, racct_decay_pre,
-   racct_decay_post, , NULL);
-   prison_racct_foreach(racct_decay_resource, racct_decay_pre,
-   racct_decay_post, , NULL);
+   ui_racct_foreach(racct_decay_callback, racct_decay_pre,
+   racct_decay_post, NULL, NULL);
+   loginclass_racct_foreach(racct_decay_callback, racct_decay_pre,
+   racct_decay_post, NULL, NULL);
+   prison_racct_foreach(racct_decay_callback, racct_decay_pre,
+   racct_decay_post, NULL, NULL);
 }
 
 static void
@@ -1166,7 +1164,7 @@ racctd(void)
ASSERT_RACCT_ENABLED();
 
for (;;) {
-   racct_decay(RACCT_PCTCPU);
+   racct_decay();
 
sx_slock(_lock);
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r297493 - in head/sys: kern sys

2016-04-01 Thread John Baldwin
Author: jhb
Date: Fri Apr  1 18:29:38 2016
New Revision: 297493
URL: https://svnweb.freebsd.org/changeset/base/297493

Log:
  Cap IOSIZE_MAX to INT_MAX for 32-bit processes.
  
  Previously, freebsd32 binaries could submit read/write requests with lengths
  greater than INT_MAX that a native kernel would have rejected.
  
  Reviewed by:  kib
  Sponsored by: Chelsio Communications
  Differential Revision:https://reviews.freebsd.org/D5788

Modified:
  head/sys/kern/sys_generic.c
  head/sys/sys/systm.h

Modified: head/sys/kern/sys_generic.c
==
--- head/sys/kern/sys_generic.c Fri Apr  1 17:28:55 2016(r297492)
+++ head/sys/kern/sys_generic.c Fri Apr  1 18:29:38 2016(r297493)
@@ -89,12 +89,14 @@ __FBSDID("$FreeBSD$");
 #defineSYS_IOCTL_SMALL_SIZE128 /* bytes */
 #defineSYS_IOCTL_SMALL_ALIGN   8   /* bytes */
 
-int iosize_max_clamp = 0;
+#ifdef __LP64__
+static int iosize_max_clamp = 0;
 SYSCTL_INT(_debug, OID_AUTO, iosize_max_clamp, CTLFLAG_RW,
 _max_clamp, 0, "Clamp max i/o size to INT_MAX");
-int devfs_iosize_max_clamp = 1;
+static int devfs_iosize_max_clamp = 1;
 SYSCTL_INT(_debug, OID_AUTO, devfs_iosize_max_clamp, CTLFLAG_RW,
 _iosize_max_clamp, 0, "Clamp max i/o size to INT_MAX for devices");
+#endif
 
 /*
  * Assert that the return value of read(2) and write(2) syscalls fits
@@ -159,6 +161,24 @@ struct selfd {
 static uma_zone_t selfd_zone;
 static struct mtx_pool *mtxpool_select;
 
+#ifdef __LP64__
+size_t
+devfs_iosize_max(void)
+{
+
+   return (devfs_iosize_max_clamp || SV_CURPROC_FLAG(SV_ILP32) ?
+   INT_MAX : SSIZE_MAX);
+}
+
+size_t
+iosize_max(void)
+{
+
+   return (iosize_max_clamp || SV_CURPROC_FLAG(SV_ILP32) ?
+   INT_MAX : SSIZE_MAX);
+}
+#endif
+
 #ifndef _SYS_SYSPROTO_H_
 struct read_args {
int fd;

Modified: head/sys/sys/systm.h
==
--- head/sys/sys/systm.hFri Apr  1 17:28:55 2016(r297492)
+++ head/sys/sys/systm.hFri Apr  1 18:29:38 2016(r297493)
@@ -148,10 +148,14 @@ extern char **kenvp;
 extern const void *zero_region;/* address space maps to a zeroed page  
*/
 
 extern int unmapped_buf_allowed;
-extern int iosize_max_clamp;
-extern int devfs_iosize_max_clamp;
-#defineIOSIZE_MAX  (iosize_max_clamp ? INT_MAX : SSIZE_MAX)
-#defineDEVFS_IOSIZE_MAX(devfs_iosize_max_clamp ? INT_MAX : 
SSIZE_MAX)
+
+#ifdef __LP64__
+#defineIOSIZE_MAX  iosize_max()
+#defineDEVFS_IOSIZE_MAXdevfs_iosize_max()
+#else
+#defineIOSIZE_MAX  SSIZE_MAX
+#defineDEVFS_IOSIZE_MAXSSIZE_MAX
+#endif
 
 /*
  * General function declarations.
@@ -403,6 +407,11 @@ struct cdev;
 dev_t dev2udev(struct cdev *x);
 const char *devtoname(struct cdev *cdev);
 
+#ifdef __LP64__
+size_t devfs_iosize_max(void);
+size_t iosize_max(void);
+#endif
+
 int poll_no_poll(int events);
 
 /* XXX: Should be void nanodelay(u_int nsec); */
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


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

2016-04-01 Thread Bryan Drewery
On 4/1/16 9:16 AM, Sean Bruno wrote:
> Author: sbruno
> Date: Fri Apr  1 16:16:26 2016
> New Revision: 297488
> URL: https://svnweb.freebsd.org/changeset/base/297488
> 
> Log:
>   Repair a overflow condition where a user could submit a string that was
>   not getting a proper bounds check.
>   
>   Thanks to CTurt for pointing at this with a big red blinking neon sign.
>   
>   PR: 206761

I love this bit in the analysis: "Unfortunately, the sysctl node,
`kern.binmisc.add` is only accessible as root."

-- 
Regards,
Bryan Drewery
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r297492 - head/sys/kern

2016-04-01 Thread Edward Tomasz Napierala
Author: trasz
Date: Fri Apr  1 17:28:55 2016
New Revision: 297492
URL: https://svnweb.freebsd.org/changeset/base/297492

Log:
  Call rctl_enforce() in all cases the resource usage goes up, even when called
  from racct_*_force() functions.  It makes the "log" and "devctl" actions work
  in those cases.
  
  MFC after:1 month
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/kern/kern_racct.c

Modified: head/sys/kern/kern_racct.c
==
--- head/sys/kern/kern_racct.c  Fri Apr  1 17:21:55 2016(r297491)
+++ head/sys/kern/kern_racct.c  Fri Apr  1 17:28:55 2016(r297492)
@@ -548,12 +548,10 @@ racct_add_locked(struct proc *p, int res
PROC_LOCK_ASSERT(p, MA_OWNED);
 
 #ifdef RCTL
-   if (!force) {
-   error = rctl_enforce(p, resource, amount);
-   if (error && RACCT_IS_DENIABLE(resource)) {
-   SDT_PROBE3(racct, , rusage, add__failure, p, resource, 
amount);
-   return (error);
-   }
+   error = rctl_enforce(p, resource, amount);
+   if (error && !force && RACCT_IS_DENIABLE(resource)) {
+   SDT_PROBE3(racct, , rusage, add__failure, p, resource, amount);
+   return (error);
}
 #endif
racct_adjust_resource(p->p_racct, resource, amount);
@@ -670,9 +668,9 @@ racct_set_locked(struct proc *p, int res
 resource));
 #endif
 #ifdef RCTL
-   if (!force && diff_proc > 0) {
+   if (diff_proc > 0) {
error = rctl_enforce(p, resource, diff_proc);
-   if (error && RACCT_IS_DENIABLE(resource)) {
+   if (error && !force && RACCT_IS_DENIABLE(resource)) {
SDT_PROBE3(racct, , rusage, set__failure, p, resource,
amount);
return (error);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r297491 - head/sys/kern

2016-04-01 Thread Edward Tomasz Napierala
Author: trasz
Date: Fri Apr  1 17:21:55 2016
New Revision: 297491
URL: https://svnweb.freebsd.org/changeset/base/297491

Log:
  Reorder the functions; no functional changes.
  
  MFC after:1 month
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/kern/kern_racct.c

Modified: head/sys/kern/kern_racct.c
==
--- head/sys/kern/kern_racct.c  Fri Apr  1 17:17:32 2016(r297490)
+++ head/sys/kern/kern_racct.c  Fri Apr  1 17:21:55 2016(r297491)
@@ -582,6 +582,24 @@ racct_add(struct proc *p, int resource, 
return (error);
 }
 
+/*
+ * Increase allocation of 'resource' by 'amount' for process 'p'.
+ * Doesn't check for limits and never fails.
+ */
+void
+racct_add_force(struct proc *p, int resource, uint64_t amount)
+{
+
+   if (!racct_enable)
+   return;
+
+   SDT_PROBE3(racct, , rusage, add__force, p, resource, amount);
+
+   mtx_lock(_lock);
+   racct_add_locked(p, resource, amount, 1);
+   mtx_unlock(_lock);
+}
+
 static void
 racct_add_cred_locked(struct ucred *cred, int resource, uint64_t amount)
 {
@@ -614,24 +632,6 @@ racct_add_cred(struct ucred *cred, int r
mtx_unlock(_lock);
 }
 
-/*
- * Increase allocation of 'resource' by 'amount' for process 'p'.
- * Doesn't check for limits and never fails.
- */
-void
-racct_add_force(struct proc *p, int resource, uint64_t amount)
-{
-
-   if (!racct_enable)
-   return;
-
-   SDT_PROBE3(racct, , rusage, add__force, p, resource, amount);
-
-   mtx_lock(_lock);
-   racct_add_locked(p, resource, amount, 1);
-   mtx_unlock(_lock);
-}
-
 static int
 racct_set_locked(struct proc *p, int resource, uint64_t amount, int force)
 {
@@ -688,20 +688,6 @@ racct_set_locked(struct proc *p, int res
return (0);
 }
 
-void
-racct_set_force(struct proc *p, int resource, uint64_t amount)
-{
-
-   if (!racct_enable)
-   return;
-
-   SDT_PROBE3(racct, , rusage, set, p, resource, amount);
-
-   mtx_lock(_lock);
-   racct_set_locked(p, resource, amount, 1);
-   mtx_unlock(_lock);
-}
-
 /*
  * Set allocation of 'resource' to 'amount' for process 'p'.
  * Return 0 if it's below limits, or errno, if it's not.
@@ -725,6 +711,20 @@ racct_set(struct proc *p, int resource, 
return (error);
 }
 
+void
+racct_set_force(struct proc *p, int resource, uint64_t amount)
+{
+
+   if (!racct_enable)
+   return;
+
+   SDT_PROBE3(racct, , rusage, set, p, resource, amount);
+
+   mtx_lock(_lock);
+   racct_set_locked(p, resource, amount, 1);
+   mtx_unlock(_lock);
+}
+
 /*
  * Returns amount of 'resource' the process 'p' can keep allocated.
  * Allocating more than that would be denied, unless the resource
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r297490 - head/sys/kern

2016-04-01 Thread Edward Tomasz Napierala
Author: trasz
Date: Fri Apr  1 17:17:32 2016
New Revision: 297490
URL: https://svnweb.freebsd.org/changeset/base/297490

Log:
  Reduce code duplication.
  
  MFC after:1 month
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/kern/kern_racct.c

Modified: head/sys/kern/kern_racct.c
==
--- head/sys/kern/kern_racct.c  Fri Apr  1 17:05:46 2016(r297489)
+++ head/sys/kern/kern_racct.c  Fri Apr  1 17:17:32 2016(r297490)
@@ -534,7 +534,7 @@ racct_adjust_resource(struct racct *racc
 }
 
 static int
-racct_add_locked(struct proc *p, int resource, uint64_t amount)
+racct_add_locked(struct proc *p, int resource, uint64_t amount, int force)
 {
 #ifdef RCTL
int error;
@@ -542,18 +542,18 @@ racct_add_locked(struct proc *p, int res
 
ASSERT_RACCT_ENABLED();
 
-   SDT_PROBE3(racct, , rusage, add, p, resource, amount);
-
/*
 * We need proc lock to dereference p->p_ucred.
 */
PROC_LOCK_ASSERT(p, MA_OWNED);
 
 #ifdef RCTL
-   error = rctl_enforce(p, resource, amount);
-   if (error && RACCT_IS_DENIABLE(resource)) {
-   SDT_PROBE3(racct, , rusage, add__failure, p, resource, amount);
-   return (error);
+   if (!force) {
+   error = rctl_enforce(p, resource, amount);
+   if (error && RACCT_IS_DENIABLE(resource)) {
+   SDT_PROBE3(racct, , rusage, add__failure, p, resource, 
amount);
+   return (error);
+   }
}
 #endif
racct_adjust_resource(p->p_racct, resource, amount);
@@ -574,8 +574,10 @@ racct_add(struct proc *p, int resource, 
if (!racct_enable)
return (0);
 
+   SDT_PROBE3(racct, , rusage, add, p, resource, amount);
+
mtx_lock(_lock);
-   error = racct_add_locked(p, resource, amount);
+   error = racct_add_locked(p, resource, amount, 0);
mtx_unlock(_lock);
return (error);
 }
@@ -625,14 +627,8 @@ racct_add_force(struct proc *p, int reso
 
SDT_PROBE3(racct, , rusage, add__force, p, resource, amount);
 
-   /*
-* We need proc lock to dereference p->p_ucred.
-*/
-   PROC_LOCK_ASSERT(p, MA_OWNED);
-
mtx_lock(_lock);
-   racct_adjust_resource(p->p_racct, resource, amount);
-   racct_add_cred_locked(p->p_ucred, resource, amount);
+   racct_add_locked(p, resource, amount, 1);
mtx_unlock(_lock);
 }
 
@@ -898,8 +894,8 @@ racct_proc_fork(struct proc *parent, str
goto out;
}
 
-   error = racct_add_locked(child, RACCT_NPROC, 1);
-   error += racct_add_locked(child, RACCT_NTHR, 1);
+   error = racct_add_locked(child, RACCT_NPROC, 1, 0);
+   error += racct_add_locked(child, RACCT_NTHR, 1, 0);
 
 out:
mtx_unlock(_lock);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r297489 - head/sys/kern

2016-04-01 Thread Edward Tomasz Napierala
Author: trasz
Date: Fri Apr  1 17:05:46 2016
New Revision: 297489
URL: https://svnweb.freebsd.org/changeset/base/297489

Log:
  Reduce code duplication.  There should be no (intended) functional changes.
  
  MFC after:1 month
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/kern/kern_racct.c

Modified: head/sys/kern/kern_racct.c
==
--- head/sys/kern/kern_racct.c  Fri Apr  1 16:16:26 2016(r297488)
+++ head/sys/kern/kern_racct.c  Fri Apr  1 17:05:46 2016(r297489)
@@ -114,6 +114,8 @@ SDT_PROBE_DEFINE3(racct, , rusage, set,
 "struct proc *", "int", "uint64_t");
 SDT_PROBE_DEFINE3(racct, , rusage, set__failure,
 "struct proc *", "int", "uint64_t");
+SDT_PROBE_DEFINE3(racct, , rusage, set__force,
+"struct proc *", "int", "uint64_t");
 SDT_PROBE_DEFINE3(racct, , rusage, sub,
 "struct proc *", "int", "uint64_t");
 SDT_PROBE_DEFINE3(racct, , rusage, sub__cred,
@@ -597,8 +599,6 @@ racct_add_cred_locked(struct ucred *cred
 /*
  * Increase allocation of 'resource' by 'amount' for credential 'cred'.
  * Doesn't check for limits and never fails.
- *
- * XXX: Shouldn't this ever return an error?
  */
 void
 racct_add_cred(struct ucred *cred, int resource, uint64_t amount)
@@ -637,7 +637,7 @@ racct_add_force(struct proc *p, int reso
 }
 
 static int
-racct_set_locked(struct proc *p, int resource, uint64_t amount)
+racct_set_locked(struct proc *p, int resource, uint64_t amount, int force)
 {
int64_t old_amount, decayed_amount;
int64_t diff_proc, diff_cred;
@@ -647,8 +647,6 @@ racct_set_locked(struct proc *p, int res
 
ASSERT_RACCT_ENABLED();
 
-   SDT_PROBE3(racct, , rusage, set, p, resource, amount);
-
/*
 * We need proc lock to dereference p->p_ucred.
 */
@@ -676,7 +674,7 @@ racct_set_locked(struct proc *p, int res
 resource));
 #endif
 #ifdef RCTL
-   if (diff_proc > 0) {
+   if (!force && diff_proc > 0) {
error = rctl_enforce(p, resource, diff_proc);
if (error && RACCT_IS_DENIABLE(resource)) {
SDT_PROBE3(racct, , rusage, set__failure, p, resource,
@@ -694,6 +692,20 @@ racct_set_locked(struct proc *p, int res
return (0);
 }
 
+void
+racct_set_force(struct proc *p, int resource, uint64_t amount)
+{
+
+   if (!racct_enable)
+   return;
+
+   SDT_PROBE3(racct, , rusage, set, p, resource, amount);
+
+   mtx_lock(_lock);
+   racct_set_locked(p, resource, amount, 1);
+   mtx_unlock(_lock);
+}
+
 /*
  * Set allocation of 'resource' to 'amount' for process 'p'.
  * Return 0 if it's below limits, or errno, if it's not.
@@ -709,61 +721,12 @@ racct_set(struct proc *p, int resource, 
if (!racct_enable)
return (0);
 
-   mtx_lock(_lock);
-   error = racct_set_locked(p, resource, amount);
-   mtx_unlock(_lock);
-   return (error);
-}
-
-static void
-racct_set_force_locked(struct proc *p, int resource, uint64_t amount)
-{
-   int64_t old_amount, decayed_amount;
-   int64_t diff_proc, diff_cred;
-
-   ASSERT_RACCT_ENABLED();
-
-   SDT_PROBE3(racct, , rusage, set, p, resource, amount);
-
-   /*
-* We need proc lock to dereference p->p_ucred.
-*/
-   PROC_LOCK_ASSERT(p, MA_OWNED);
-
-   old_amount = p->p_racct->r_resources[resource];
-   /*
-* The diffs may be negative.
-*/
-   diff_proc = amount - old_amount;
-   if (RACCT_IS_DECAYING(resource)) {
-   /*
-* Resources in per-credential racct containers may decay.
-* If this is the case, we need to calculate the difference
-* between the new amount and the proportional value of the
-* old amount that has decayed in the ucred racct containers.
-*/
-   decayed_amount = old_amount * RACCT_DECAY_FACTOR / FSCALE;
-   diff_cred = amount - decayed_amount;
-   } else
-   diff_cred = diff_proc;
-
-   racct_adjust_resource(p->p_racct, resource, diff_proc);
-   if (diff_cred > 0)
-   racct_add_cred_locked(p->p_ucred, resource, diff_cred);
-   else if (diff_cred < 0)
-   racct_sub_cred_locked(p->p_ucred, resource, -diff_cred);
-}
-
-void
-racct_set_force(struct proc *p, int resource, uint64_t amount)
-{
-
-   if (!racct_enable)
-   return;
+   SDT_PROBE3(racct, , rusage, set__force, p, resource, amount);
 
mtx_lock(_lock);
-   racct_set_force_locked(p, resource, amount);
+   error = racct_set_locked(p, resource, amount, 0);
mtx_unlock(_lock);
+   return (error);
 }
 
 /*
@@ -930,7 +893,7 @@ racct_proc_fork(struct proc *parent, str
continue;
 
error = racct_set_locked(child, i,
-   parent->p_racct->r_resources[i]);
+   

svn commit: r297488 - head/sys/kern

2016-04-01 Thread Sean Bruno
Author: sbruno
Date: Fri Apr  1 16:16:26 2016
New Revision: 297488
URL: https://svnweb.freebsd.org/changeset/base/297488

Log:
  Repair a overflow condition where a user could submit a string that was
  not getting a proper bounds check.
  
  Thanks to CTurt for pointing at this with a big red blinking neon sign.
  
  PR:   206761
  Submitted by: sson
  Reviewed by:  ct...@hardenedbsd.org
  MFC after:3 days

Modified:
  head/sys/kern/imgact_binmisc.c

Modified: head/sys/kern/imgact_binmisc.c
==
--- head/sys/kern/imgact_binmisc.c  Fri Apr  1 11:32:52 2016
(r297487)
+++ head/sys/kern/imgact_binmisc.c  Fri Apr  1 16:16:26 2016
(r297488)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2013-15, Stacey D. Son
+ * Copyright (c) 2013-16, Stacey D. Son
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -220,16 +220,17 @@ imgact_binmisc_add_entry(ximgact_binmisc
 {
imgact_binmisc_entry_t *ibe;
char *p;
+   int cnt;
 
if (xbe->xbe_msize > IBE_MAGIC_MAX)
return (EINVAL);
 
-   for(p = xbe->xbe_name; *p != 0; p++)
-   if (!isascii((int)*p))
+   for(cnt = 0, p = xbe->xbe_name; *p != 0; cnt++, p++)
+   if (cnt >= IBE_NAME_MAX || !isascii((int)*p))
return (EINVAL);
 
-   for(p = xbe->xbe_interpreter; *p != 0; p++)
-   if (!isascii((int)*p))
+   for(cnt = 0, p = xbe->xbe_interpreter; *p != 0; cnt++, p++)
+   if (cnt >= IBE_INTERP_LEN_MAX || !isascii((int)*p))
return (EINVAL);
 
/* Make sure we don't have any invalid #'s. */
@@ -266,8 +267,6 @@ imgact_binmisc_add_entry(ximgact_binmisc
 
/* Preallocate a new entry. */
ibe = imgact_binmisc_new_entry(xbe);
-   if (!ibe)
-   return (ENOMEM);
 
SLIST_INSERT_HEAD(_list, ibe, link);
interp_list_entry_count++;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


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

2016-04-01 Thread Mateusz Guzik
On Fri, Apr 01, 2016 at 09:46:01AM -0500, Benjamin Kaduk wrote:
> On Fri, Apr 1, 2016 at 1:12 AM, Mateusz Guzik  wrote:
> 
> > Author: mjg
> > Date: Wed Apr  1 08:10:00 2016
> > New Revision: 280963
> >
> 
> Next year should probably update the "New Revision" line...
> 
> 
> > URL: https://svnweb.freebsd.org/changeset/base/297481
> >
> > Log:
> >   Increase responsiveness under load by being more aggressive with
> >   priority changes.
> >
> >   MFC after:1 week
> >
> > Modified:
> >   head/sys/kern/sched_ule.c
> >
> > Modified: head/sys/kern/sched_ule.c
> > ===
> > --- sys/kern/sched_ule.c(revision 297480)
> > +++ sys/kern/sched_ule.c(working copy)
> >
> 
> ...and use the version number instead of "working copy".
> 

Worked just fine last year:
https://lists.freebsd.org/pipermail/svn-src-head/2015-April/070150.html

For interested parties, this was a tribute. See
http://scholar.harvard.edu/files/mickens/files/thenightwatch.pdf

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


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

2016-04-01 Thread Benjamin Kaduk
On Fri, Apr 1, 2016 at 1:12 AM, Mateusz Guzik  wrote:

> Author: mjg
> Date: Wed Apr  1 08:10:00 2016
> New Revision: 280963
>

Next year should probably update the "New Revision" line...


> URL: https://svnweb.freebsd.org/changeset/base/297481
>
> Log:
>   Increase responsiveness under load by being more aggressive with
>   priority changes.
>
>   MFC after:1 week
>
> Modified:
>   head/sys/kern/sched_ule.c
>
> Modified: head/sys/kern/sched_ule.c
> ===
> --- sys/kern/sched_ule.c(revision 297480)
> +++ sys/kern/sched_ule.c(working copy)
>

...and use the version number instead of "working copy".

-Ben


> @@ -1696,15 +1696,10 @@
> }
> ts = td->td_sched;
> THREAD_LOCK_ASSERT(td, MA_OWNED);
> -   if (td->td_priority == prio)
> -   return;
> /*
> -* If the priority has been elevated due to priority
> -* propagation, we may have to move ourselves to a new
> -* queue.  This could be optimized to not re-add in some
> -* cases.
> +* DOES THIS WORK LOL
>  */
> -   if (TD_ON_RUNQ(td) && prio < td->td_priority) {
> +   if (TD_ON_RUNQ(td) && prio != td->td_priority) {
> sched_rem(td);
> td->td_priority = prio;
> sched_add(td, SRQ_BORROWING);
> ___
> svn-src-...@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/svn-src-all
> To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
>
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


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

2016-04-01 Thread Konstantin Belousov
On Fri, Apr 01, 2016 at 02:41:49PM +0300, Oleg Bulyzhin wrote:
> On Fri, Apr 01, 2016 at 08:12:50AM +0200, Mateusz Guzik wrote:
> > Author: mjg
> > Date: Wed Apr  1 08:10:00 2016
> > New Revision: 280963
> > URL: https://svnweb.freebsd.org/changeset/base/297481
> 
> Something is wrong with this commit. Revision 297481 is about
> head/sys/dev/hyperv/vmbus/hv_hv.c
> 
Yes, the comments where not style(9) compliant, thus the revision
was taken and given to the needy developer.
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


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

2016-04-01 Thread Oleg Bulyzhin
On Fri, Apr 01, 2016 at 08:12:50AM +0200, Mateusz Guzik wrote:
> Author: mjg
> Date: Wed Apr  1 08:10:00 2016
> New Revision: 280963
> URL: https://svnweb.freebsd.org/changeset/base/297481

Something is wrong with this commit. Revision 297481 is about
head/sys/dev/hyperv/vmbus/hv_hv.c

-- 
Oleg.


=== Oleg Bulyzhin -- OBUL-RIPN -- OBUL-RIPE -- o...@rinet.ru ===


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


Re: svn commit: r297392 - in head/sys: conf dev/ofw powerpc/mpc85xx powerpc/powermac powerpc/pseries

2016-04-01 Thread Zbigniew Bodek
Thanks. Done: https://svnweb.freebsd.org/changeset/base/297486

Best regards
zbb

2016-04-01 2:05 GMT+02:00 Nathan Whitehorn :

> I seem to be wrong. In any event, we don't have any non-device-tree
> platforms on PowerPC anymore, so you can just make it be "pci".
> -Nathan
>
> On 03/31/16 01:18, Zbigniew Bodek wrote:
>
>>
>> Are you sure? I don't see an example of what you are writing about.
>> Instead I can see several other examples such as:
>>
>> dev/usb/controller/ehci_fsl.coptionalehci mpc85xx | ehci qoriq_dpaa
>> dev/iicbus/adm1030.coptionalpowermac windtunnel | adm1030 powermac
>> etc.
>>
>> Why would they do that if they could simply type: ehci mpc85xx |
>> qoriq_dpaa?
>>
>> Best regards
>> zbb
>>
>> 2016-03-30 19:22 GMT+02:00 Nathan Whitehorn > >:
>>
>> I think it should be pci aim | fdt, just like the previous line
>> when the files lived in sys/powerpc. To conf, that evaluates as
>> pci && (aim || fdt).
>> -Nathan
>>
>>
>> On 03/30/16 08:55, Zbigniew Bodek wrote:
>>
>>>
>>> Thank you Nathan. Please check out new patch in the attachment.
>>>
>>> Best regards
>>> zbb
>>>
>>> 2016-03-30 16:33 GMT+02:00 Nathan Whitehorn
>>> >:
>>>
>>> PowerPC (and SPARC) can have real OFW without FDT support.
>>> Adding FDT to LINT is the wrong solution: rather, it should
>>> switch on fdt | aim like the rest of the Open Firmware code.
>>> -Nathan
>>>
>>>
>>> On 03/30/16 01:54, Zbigniew Bodek wrote:
>>>
 Hello Ed,

 Please check out the attached patch. For powerpc we should
 compile-in ofwpci.c regardless of FDT option.
 However, it seems that LINT for powerpc does not have FDT.
 What do you thing about adding it (as can be seen in the
 attached patch)?. This would be done in a separate commit.

 Best regards
 zbb

 2016-03-30 1:53 GMT+02:00 Ed Maste >:

 On 29 March 2016 at 15:19, Zbigniew Bodek
 > wrote:
 > Author: zbb
 > Date: Tue Mar 29 15:19:56 2016
 > New Revision: 297392
 > URL: https://svnweb.freebsd.org/changeset/base/297392
 >
 > Log:
 >   Reduce OFW PCI code duplication - involves ARM, PPC
 and SPARC64

 My 'make tinderbox' build is now failing (powerpc LINT)
 with:

 linking kernel
 cpcht.o: In function `cpcht_attach':
 cpcht.c:(.text+0x17dc): undefined reference to
 `ofw_pci_attach'
 cpcht.o:(.data.rel+0x0): undefined reference to
 `ofw_pci_driver'
 grackle.o: In function `grackle_attach':
 grackle.c:(.text+0x2dc): undefined reference to
 `ofw_pci_attach'
 grackle.o:(.data.rel+0x0): undefined reference to
 `ofw_pci_driver'
 uninorthpci.o: In function `uninorth_attach':
 uninorthpci.c:(.text+0x68c): undefined reference to
 `ofw_pci_attach'
 uninorthpci.o:(.data.rel+0x0): undefined reference to
 `ofw_pci_driver'
 *** [kernel] Error code 1
 ___
 svn-src-...@freebsd.org 
 mailing list
 https://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to
 "svn-src-all-unsubscr...@freebsd.org
 "



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


svn commit: r297486 - head/sys/conf

2016-04-01 Thread Zbigniew Bodek
Author: zbb
Date: Fri Apr  1 09:07:18 2016
New Revision: 297486
URL: https://svnweb.freebsd.org/changeset/base/297486

Log:
  Fix PowerPC LINT build after r297392
  
  PowerPC has real Open Firmware and does not necessarily need FDT.
  Make ofwpci.c only PCI dependent.
  
  Pointed out by:   emaste
  Reviewed by:  nwhitehorn
  Obtained from:Semihalf

Modified:
  head/sys/conf/files.powerpc

Modified: head/sys/conf/files.powerpc
==
--- head/sys/conf/files.powerpc Fri Apr  1 08:55:42 2016(r297485)
+++ head/sys/conf/files.powerpc Fri Apr  1 09:07:18 2016(r297486)
@@ -57,7 +57,7 @@ dev/ofw/ofw_console.c optionalaim
 dev/ofw/ofw_disk.c optionalofwd aim
 dev/ofw/ofw_iicbus.c   optionaliicbus aim
 dev/ofw/ofwbus.c   optionalaim | fdt
-dev/ofw/ofwpci.c   optionalfdt pci
+dev/ofw/ofwpci.c   optionalpci
 dev/ofw/ofw_standard.c optionalaim powerpc
 dev/ofw/ofw_subr.c optionalaim powerpc
 dev/powermac_nvram/powermac_nvram.c optional   powermac_nvram powermac
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r297484 - head/sys/x86/x86

2016-04-01 Thread Konstantin Belousov
Author: kib
Date: Fri Apr  1 08:47:23 2016
New Revision: 297484
URL: https://svnweb.freebsd.org/changeset/base/297484

Log:
  Style(9), use tabs for the #define LOOPS line.
  Print unsigned values with %u.
  Make code slightly more compact by inlining loop limit.
  
  Noted by: bde
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/x86/x86/local_apic.c

Modified: head/sys/x86/x86/local_apic.c
==
--- head/sys/x86/x86/local_apic.c   Fri Apr  1 06:43:05 2016
(r297483)
+++ head/sys/x86/x86/local_apic.c   Fri Apr  1 08:47:23 2016
(r297484)
@@ -511,7 +511,7 @@ native_lapic_init(vm_paddr_t addr)
}
 
 #ifdef SMP
-#define LOOPS 100
+#defineLOOPS   100
/*
 * Calibrate the busy loop waiting for IPI ack in xAPIC mode.
 * lapic_ipi_wait_mult contains the number of iterations which
@@ -535,7 +535,7 @@ native_lapic_init(vm_paddr_t addr)
r2 = r * 100;
lapic_ipi_wait_mult = r1 >= r2 ? r1 / r2 : 1;
if (bootverbose) {
-   printf("LAPIC: ipi_wait() us multiplier %jd (r %jd tsc %jd)\n",
+   printf("LAPIC: ipi_wait() us multiplier %ju (r %ju tsc %ju)\n",
(uintmax_t)lapic_ipi_wait_mult, (uintmax_t)r,
(uintmax_t)tsc_freq);
}
@@ -1762,14 +1762,13 @@ SYSINIT(apic_setup_io, SI_SUB_INTR, SI_O
 static int
 native_lapic_ipi_wait(int delay)
 {
-   uint64_t i, counter;
+   uint64_t rx;
 
/* LAPIC_ICR.APIC_DELSTAT_MASK is undefined in x2APIC mode */
if (x2apic_mode)
return (1);
 
-   counter = lapic_ipi_wait_mult * delay;
-   for (i = 0; delay == -1 || i < counter; i++) {
+   for (rx = 0; delay == -1 || rx < lapic_ipi_wait_mult * delay; rx++) {
if ((lapic_read_icr_lo() & APIC_DELSTAT_MASK) ==
APIC_DELSTAT_IDLE)
return (1);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r297482 - in head/sys: dev/cxgb dev/cxgbe dev/e1000 dev/hyperv/netvsc dev/ixgbe dev/ixl dev/mlx5/mlx5_en dev/mxge dev/oce dev/qlxgb dev/qlxge dev/vnic dev/vxge dev/xen/netfront netinet ...

2016-04-01 Thread Sepherosa Ziehau
Author: sephe
Date: Fri Apr  1 06:28:33 2016
New Revision: 297482
URL: https://svnweb.freebsd.org/changeset/base/297482

Log:
  tcp/lro: Use tcp_lro_flush_all in device drivers to avoid code duplication
  
  And factor out tcp_lro_rx_done, which deduplicates the same logic with
  netinet/tcp_lro.c
  
  Reviewed by:  gallatin (1st version), hps, zbb, np, Dexuan Cui 
  Sponsored by: Microsoft OSTC
  Differential Revision:https://reviews.freebsd.org/D5725

Modified:
  head/sys/dev/cxgb/cxgb_sge.c
  head/sys/dev/cxgbe/t4_sge.c
  head/sys/dev/e1000/if_igb.c
  head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
  head/sys/dev/ixgbe/ix_txrx.c
  head/sys/dev/ixl/ixl_txrx.c
  head/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c
  head/sys/dev/mxge/if_mxge.c
  head/sys/dev/oce/oce_if.c
  head/sys/dev/qlxgb/qla_isr.c
  head/sys/dev/qlxge/qls_isr.c
  head/sys/dev/vnic/nicvf_queues.c
  head/sys/dev/vxge/vxge.c
  head/sys/dev/xen/netfront/netfront.c
  head/sys/netinet/tcp_lro.c
  head/sys/ofed/drivers/net/mlx4/en_rx.c

Modified: head/sys/dev/cxgb/cxgb_sge.c
==
--- head/sys/dev/cxgb/cxgb_sge.cFri Apr  1 06:17:57 2016
(r297481)
+++ head/sys/dev/cxgb/cxgb_sge.cFri Apr  1 06:28:33 2016
(r297482)
@@ -2976,11 +2976,7 @@ process_responses(adapter_t *adap, struc
 
 #if defined(INET6) || defined(INET)
/* Flush LRO */
-   while (!SLIST_EMPTY(_ctrl->lro_active)) {
-   struct lro_entry *queued = SLIST_FIRST(_ctrl->lro_active);
-   SLIST_REMOVE_HEAD(_ctrl->lro_active, next);
-   tcp_lro_flush(lro_ctrl, queued);
-   }
+   tcp_lro_flush_all(lro_ctrl);
 #endif
 
if (sleeping)

Modified: head/sys/dev/cxgbe/t4_sge.c
==
--- head/sys/dev/cxgbe/t4_sge.c Fri Apr  1 06:17:57 2016(r297481)
+++ head/sys/dev/cxgbe/t4_sge.c Fri Apr  1 06:28:33 2016(r297482)
@@ -1397,13 +1397,8 @@ process_iql:
 #if defined(INET) || defined(INET6)
if (iq->flags & IQ_LRO_ENABLED) {
struct lro_ctrl *lro = >lro;
-   struct lro_entry *l;
 
-   while (!SLIST_EMPTY(>lro_active)) {
-   l = SLIST_FIRST(>lro_active);
-   SLIST_REMOVE_HEAD(>lro_active, next);
-   tcp_lro_flush(lro, l);
-   }
+   tcp_lro_flush_all(lro);
}
 #endif
 

Modified: head/sys/dev/e1000/if_igb.c
==
--- head/sys/dev/e1000/if_igb.c Fri Apr  1 06:17:57 2016(r297481)
+++ head/sys/dev/e1000/if_igb.c Fri Apr  1 06:28:33 2016(r297482)
@@ -4974,7 +4974,6 @@ igb_rxeof(struct igb_queue *que, int cou
struct rx_ring  *rxr = que->rxr;
struct ifnet*ifp = adapter->ifp;
struct lro_ctrl *lro = >lro;
-   struct lro_entry*queued;
int i, processed = 0, rxdone = 0;
u32 ptype, staterr = 0;
union e1000_adv_rx_desc *cur;
@@ -5202,10 +5201,7 @@ next_desc:
/*
 * Flush any outstanding LRO work
 */
-   while ((queued = SLIST_FIRST(>lro_active)) != NULL) {
-   SLIST_REMOVE_HEAD(>lro_active, next);
-   tcp_lro_flush(lro, queued);
-   }
+   tcp_lro_flush_all(lro);
 
if (done != NULL)
*done += rxdone;

Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
==
--- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c  Fri Apr  1 06:17:57 
2016(r297481)
+++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c  Fri Apr  1 06:28:33 
2016(r297482)
@@ -778,13 +778,8 @@ netvsc_channel_rollup(struct hv_vmbus_ch
struct hn_tx_ring *txr = chan->hv_chan_txr;
 #if defined(INET) || defined(INET6)
struct hn_rx_ring *rxr = chan->hv_chan_rxr;
-   struct lro_ctrl *lro = >hn_lro;
-   struct lro_entry *queued;
 
-   while ((queued = SLIST_FIRST(>lro_active)) != NULL) {
-   SLIST_REMOVE_HEAD(>lro_active, next);
-   tcp_lro_flush(lro, queued);
-   }
+   tcp_lro_flush_all(>hn_lro);
 #endif
 
/*

Modified: head/sys/dev/ixgbe/ix_txrx.c
==
--- head/sys/dev/ixgbe/ix_txrx.cFri Apr  1 06:17:57 2016
(r297481)
+++ head/sys/dev/ixgbe/ix_txrx.cFri Apr  1 06:28:33 2016
(r297482)
@@ -1753,7 +1753,6 @@ ixgbe_rxeof(struct ix_queue *que)
struct rx_ring  *rxr = que->rxr;
struct ifnet*ifp = adapter->ifp;
struct lro_ctrl *lro = >lro;
-   struct lro_entry*queued;
int i, nextp, processed = 0;
u32 staterr 

svn commit: r297483 - in head/sys: compat/linuxkpi/common/include/linux netinet

2016-04-01 Thread Sepherosa Ziehau
Author: sephe
Date: Fri Apr  1 06:43:05 2016
New Revision: 297483
URL: https://svnweb.freebsd.org/changeset/base/297483

Log:
  tcp/lro: Change SLIST to LIST, so that removing an entry is O(1)
  
  This is kinda critical to the performance when the CPU is slow and
  network bandwidth is high, e.g. in the hypervisor.
  
  Reviewed by:  rrs, gallatin, Dexuan Cui 
  Sponsored by: Microsoft OSTC
  Differential Revision:https://reviews.freebsd.org/D5765

Modified:
  head/sys/compat/linuxkpi/common/include/linux/list.h
  head/sys/netinet/tcp_lro.c
  head/sys/netinet/tcp_lro.h

Modified: head/sys/compat/linuxkpi/common/include/linux/list.h
==
--- head/sys/compat/linuxkpi/common/include/linux/list.hFri Apr  1 
06:28:33 2016(r297482)
+++ head/sys/compat/linuxkpi/common/include/linux/list.hFri Apr  1 
06:43:05 2016(r297483)
@@ -61,6 +61,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 

Modified: head/sys/netinet/tcp_lro.c
==
--- head/sys/netinet/tcp_lro.c  Fri Apr  1 06:28:33 2016(r297482)
+++ head/sys/netinet/tcp_lro.c  Fri Apr  1 06:43:05 2016(r297483)
@@ -93,8 +93,8 @@ tcp_lro_init_args(struct lro_ctrl *lc, s
lc->lro_ackcnt_lim = TCP_LRO_ACKCNT_MAX;
lc->lro_length_lim = TCP_LRO_LENGTH_MAX;
lc->ifp = ifp;
-   SLIST_INIT(>lro_free);
-   SLIST_INIT(>lro_active);
+   LIST_INIT(>lro_free);
+   LIST_INIT(>lro_active);
 
/* compute size to allocate */
size = (lro_mbufs * sizeof(struct mbuf *)) +
@@ -113,7 +113,7 @@ tcp_lro_init_args(struct lro_ctrl *lc, s
 
/* setup linked list */
for (i = 0; i != lro_entries; i++)
-   SLIST_INSERT_HEAD(>lro_free, le + i, next);
+   LIST_INSERT_HEAD(>lro_free, le + i, next);
 
return (0);
 }
@@ -125,11 +125,11 @@ tcp_lro_free(struct lro_ctrl *lc)
unsigned x;
 
/* reset LRO free list */
-   SLIST_INIT(>lro_free);
+   LIST_INIT(>lro_free);
 
/* free active mbufs, if any */
-   while ((le = SLIST_FIRST(>lro_active)) != NULL) {
-   SLIST_REMOVE_HEAD(>lro_active, next);
+   while ((le = LIST_FIRST(>lro_active)) != NULL) {
+   LIST_REMOVE(le, next);
m_freem(le->m_head);
}
 
@@ -233,8 +233,8 @@ tcp_lro_rx_done(struct lro_ctrl *lc)
 {
struct lro_entry *le;
 
-   while ((le = SLIST_FIRST(>lro_active)) != NULL) {
-   SLIST_REMOVE_HEAD(>lro_active, next);
+   while ((le = LIST_FIRST(>lro_active)) != NULL) {
+   LIST_REMOVE(le, next);
tcp_lro_flush(lc, le);
}
 }
@@ -245,14 +245,14 @@ tcp_lro_flush_inactive(struct lro_ctrl *
struct lro_entry *le, *le_tmp;
struct timeval tv;
 
-   if (SLIST_EMPTY(>lro_active))
+   if (LIST_EMPTY(>lro_active))
return;
 
getmicrotime();
timevalsub(, timeout);
-   SLIST_FOREACH_SAFE(le, >lro_active, next, le_tmp) {
+   LIST_FOREACH_SAFE(le, >lro_active, next, le_tmp) {
if (timevalcmp(, >mtime, >=)) {
-   SLIST_REMOVE(>lro_active, le, lro_entry, next);
+   LIST_REMOVE(le, next);
tcp_lro_flush(lc, le);
}
}
@@ -348,7 +348,7 @@ tcp_lro_flush(struct lro_ctrl *lc, struc
lc->lro_queued += le->append_cnt + 1;
lc->lro_flushed++;
bzero(le, sizeof(*le));
-   SLIST_INSERT_HEAD(>lro_free, le, next);
+   LIST_INSERT_HEAD(>lro_free, le, next);
 }
 
 static int
@@ -593,7 +593,7 @@ tcp_lro_rx(struct lro_ctrl *lc, struct m
seq = ntohl(th->th_seq);
 
/* Try to find a matching previous segment. */
-   SLIST_FOREACH(le, >lro_active, next) {
+   LIST_FOREACH(le, >lro_active, next) {
if (le->eh_type != eh_type)
continue;
if (le->source_port != th->th_sport ||
@@ -620,7 +620,7 @@ tcp_lro_rx(struct lro_ctrl *lc, struct m
 
/* Flush now if appending will result in overflow. */
if (le->p_len > (lc->lro_length_lim - tcp_data_len)) {
-   SLIST_REMOVE(>lro_active, le, lro_entry, next);
+   LIST_REMOVE(le, next);
tcp_lro_flush(lc, le);
break;
}
@@ -629,7 +629,7 @@ tcp_lro_rx(struct lro_ctrl *lc, struct m
if (__predict_false(seq != le->next_seq ||
(tcp_data_len == 0 && le->ack_seq == th->th_ack))) {
/* Out of order packet or duplicate ACK. */
-   SLIST_REMOVE(>lro_active, le, lro_entry, next);
+   LIST_REMOVE(le, next);
tcp_lro_flush(lc, le);
return (TCP_LRO_CANNOT);
  

svn commit: r297481 - head/sys/dev/hyperv/vmbus

2016-04-01 Thread Sepherosa Ziehau
Author: sephe
Date: Fri Apr  1 06:17:57 2016
New Revision: 297481
URL: https://svnweb.freebsd.org/changeset/base/297481

Log:
  hyperv: Register Hyper-V timer early enough for TSC freq calibration
  
  The i8254 simulation in Hyper-V is kinda broken and is not available
  in Generation 2 Hyper-V VMs, so Hyper-V timer must be registered early
  enough so that it can be used to do the TSC freq calibration.
  
  This fixes the notorious warning like this:
  calcru: runtime went backwards from 50 usec to 25 usec for pid 0 (kernel)
  
  Submitted by: Dexuan Cui 
  Reviewed by:  kib, sephe
  Tested by:kib, sephe
  MFC after:1 week
  Sponsored by: Microsoft OSTC
  Differential Revision:https://reviews.freebsd.org/D5778

Modified:
  head/sys/dev/hyperv/vmbus/hv_hv.c

Modified: head/sys/dev/hyperv/vmbus/hv_hv.c
==
--- head/sys/dev/hyperv/vmbus/hv_hv.c   Fri Apr  1 03:46:16 2016
(r297480)
+++ head/sys/dev/hyperv/vmbus/hv_hv.c   Fri Apr  1 06:17:57 2016
(r297481)
@@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -207,8 +208,6 @@ hv_vmbus_init(void) 
 
hv_vmbus_g_context.hypercall_page = virt_addr;
 
-   tc_init(_timecounter); /* register virtual timecount */
-
hv_et_init();

return (0);
@@ -437,3 +436,14 @@ void hv_vmbus_synic_cleanup(void *arg)
wrmsr(HV_X64_MSR_SIEFP, siefp.as_uint64_t);
 }
 
+static void
+hv_tc_init(void)
+{
+   if (vm_guest != VM_GUEST_HV)
+   return;
+
+   /* register virtual timecounter */
+   tc_init(_timecounter);
+}
+
+SYSINIT(hv_tc_init, SI_SUB_HYPERVISOR, SI_ORDER_FIRST, hv_tc_init, NULL);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


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

2016-04-01 Thread Andriy Gapon
On 01/04/2016 09:12, Mateusz Guzik wrote:
> Author: mjg
> Date: Wed Apr  1 08:10:00 2016
> New Revision: 280963
> URL: https://svnweb.freebsd.org/changeset/base/297481
> 
> Log:
>   Increase responsiveness under load by being more aggressive with
>   priority changes.
> 
>   MFC after:  1 week
> 
> Modified:
>   head/sys/kern/sched_ule.c
> 
> Modified: head/sys/kern/sched_ule.c
> ===
> --- sys/kern/sched_ule.c  (revision 297480)
> +++ sys/kern/sched_ule.c  (working copy)
> @@ -1696,15 +1696,10 @@
>   } 
>   ts = td->td_sched;
>   THREAD_LOCK_ASSERT(td, MA_OWNED);
> - if (td->td_priority == prio)
> - return;
>   /*
> -  * If the priority has been elevated due to priority
> -  * propagation, we may have to move ourselves to a new
> -  * queue.  This could be optimized to not re-add in some
> -  * cases.
> +  * DOES THIS WORK LOL

It does!  Nice one!

>*/
> - if (TD_ON_RUNQ(td) && prio < td->td_priority) {
> + if (TD_ON_RUNQ(td) && prio != td->td_priority) {
>   sched_rem(td);
>   td->td_priority = prio;
>   sched_add(td, SRQ_BORROWING);
> 


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


svn commit: r297481 - head/sys/kern

2016-04-01 Thread Mateusz Guzik
Author: mjg
Date: Wed Apr  1 08:10:00 2016
New Revision: 280963
URL: https://svnweb.freebsd.org/changeset/base/297481

Log:
  Increase responsiveness under load by being more aggressive with
  priority changes.

  MFC after:1 week

Modified:
  head/sys/kern/sched_ule.c

Modified: head/sys/kern/sched_ule.c
===
--- sys/kern/sched_ule.c(revision 297480)
+++ sys/kern/sched_ule.c(working copy)
@@ -1696,15 +1696,10 @@
} 
ts = td->td_sched;
THREAD_LOCK_ASSERT(td, MA_OWNED);
-   if (td->td_priority == prio)
-   return;
/*
-* If the priority has been elevated due to priority
-* propagation, we may have to move ourselves to a new
-* queue.  This could be optimized to not re-add in some
-* cases.
+* DOES THIS WORK LOL
 */
-   if (TD_ON_RUNQ(td) && prio < td->td_priority) {
+   if (TD_ON_RUNQ(td) && prio != td->td_priority) {
sched_rem(td);
td->td_priority = prio;
sched_add(td, SRQ_BORROWING);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"