svn commit: r345255 - head/sys/ufs/ufs

2019-03-17 Thread Mark Johnston
Author: markj
Date: Mon Mar 18 05:03:55 2019
New Revision: 345255
URL: https://svnweb.freebsd.org/changeset/base/345255

Log:
  Revert r345244 for now.
  
  The code which advances the block number is simplistic and is not
  correct when the starting offset is non-zero.  Revert the change until
  this is fixed.

Modified:
  head/sys/ufs/ufs/ufs_bmap.c
  head/sys/ufs/ufs/ufs_extern.h
  head/sys/ufs/ufs/ufs_vnops.c

Modified: head/sys/ufs/ufs/ufs_bmap.c
==
--- head/sys/ufs/ufs/ufs_bmap.c Mon Mar 18 02:58:34 2019(r345254)
+++ head/sys/ufs/ufs/ufs_bmap.c Mon Mar 18 05:03:55 2019(r345255)
@@ -56,9 +56,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-static int ufs_readindir(struct vnode *, ufs_lbn_t, ufs2_daddr_t,
-struct buf **);
-
 /*
  * Bmap converts the logical block number of a file to its physical block
  * number on the disk. The conversion is done by using the logical block
@@ -93,51 +90,6 @@ ufs_bmap(ap)
return (error);
 }
 
-static int
-ufs_readindir(vp, lbn, daddr, bpp)
-   struct vnode *vp;
-   ufs_lbn_t lbn;
-   ufs2_daddr_t daddr;
-   struct buf **bpp;
-{
-   struct buf *bp;
-   struct mount *mp;
-   struct ufsmount *ump;
-   int error;
-
-   mp = vp->v_mount;
-   ump = VFSTOUFS(mp);
-
-   bp = getblk(vp, lbn, mp->mnt_stat.f_iosize, 0, 0, 0);
-   if ((bp->b_flags & B_CACHE) == 0) {
-   KASSERT(daddr != 0,
-   ("ufs_readindir: indirect block not in cache"));
-
-   bp->b_blkno = blkptrtodb(ump, daddr);
-   bp->b_iocmd = BIO_READ;
-   bp->b_flags &= ~B_INVAL;
-   bp->b_ioflags &= ~BIO_ERROR;
-   vfs_busy_pages(bp, 0);
-   bp->b_iooffset = dbtob(bp->b_blkno);
-   bstrategy(bp);
-#ifdef RACCT
-   if (racct_enable) {
-   PROC_LOCK(curproc);
-   racct_add_buf(curproc, bp, 0);
-   PROC_UNLOCK(curproc);
-   }
-#endif
-   curthread->td_ru.ru_inblock++;
-   error = bufwait(bp);
-   if (error != 0) {
-   brelse(bp);
-   return (error);
-   }
-   }
-   *bpp = bp;
-   return (0);
-}
-
 /*
  * Indirect blocks are now on the vnode for the file.  They are given negative
  * logical block numbers.  Indirect blocks are addressed by the negative
@@ -260,10 +212,35 @@ ufs_bmaparray(vp, bn, bnp, nbp, runp, runb)
 */
if (bp)
bqrelse(bp);
-   error = ufs_readindir(vp, metalbn, daddr, &bp);
-   if (error != 0)
-   return (error);
 
+   bp = getblk(vp, metalbn, mp->mnt_stat.f_iosize, 0, 0, 0);
+   if ((bp->b_flags & B_CACHE) == 0) {
+#ifdef INVARIANTS
+   if (!daddr)
+   panic("ufs_bmaparray: indirect block not in 
cache");
+#endif
+   bp->b_blkno = blkptrtodb(ump, daddr);
+   bp->b_iocmd = BIO_READ;
+   bp->b_flags &= ~B_INVAL;
+   bp->b_ioflags &= ~BIO_ERROR;
+   vfs_busy_pages(bp, 0);
+   bp->b_iooffset = dbtob(bp->b_blkno);
+   bstrategy(bp);
+#ifdef RACCT
+   if (racct_enable) {
+   PROC_LOCK(curproc);
+   racct_add_buf(curproc, bp, 0);
+   PROC_UNLOCK(curproc);
+   }
+#endif /* RACCT */
+   curthread->td_ru.ru_inblock++;
+   error = bufwait(bp);
+   if (error) {
+   brelse(bp);
+   return (error);
+   }
+   }
+
if (I_IS_UFS1(ip)) {
daddr = ((ufs1_daddr_t *)bp->b_data)[ap->in_off];
if (num == 1 && daddr && runp) {
@@ -324,93 +301,6 @@ ufs_bmaparray(vp, bn, bnp, nbp, runp, runb)
*bnp = -1;
}
return (0);
-}
-
-int
-ufs_bmap_seekdata(vp, offp)
-   struct vnode *vp;
-   off_t *offp;
-{
-   struct buf *bp;
-   struct indir a[UFS_NIADDR + 1], *ap;
-   struct inode *ip;
-   struct mount *mp;
-   struct ufsmount *ump;
-   ufs2_daddr_t blockcnt, bn, daddr;
-   uint64_t bsize;
-   off_t numblks;
-   int error, num, num1;
-
-   bp = NULL;
-   ip = VTOI(vp);
-   mp = vp->v_mount;
-   ump = VFSTOUFS(mp);
-
-   if (vp->v_type != VREG || (ip->i_flags & SF_SNAPSHOT) != 0)
-   return (EINVAL);
-   if (*offp < 0)
-   return (ENXIO);
-
-   bsize = mp->mnt_stat.f_iosize;
-   for (bn = *offp / bsize, numblks = howmany(ip-

svn commit: r345254 - stable/11/sys/dev/urtwn

2019-03-17 Thread Andriy Voskoboinyk
Author: avos
Date: Mon Mar 18 02:58:34 2019
New Revision: 345254
URL: https://svnweb.freebsd.org/changeset/base/345254

Log:
  MFC r344745:
  urtwn(4): fix Tx instability with RTL8192CU chipsets
  
  PR:   233949

Modified:
  stable/11/sys/dev/urtwn/if_urtwn.c
  stable/11/sys/dev/urtwn/if_urtwnreg.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/urtwn/if_urtwn.c
==
--- stable/11/sys/dev/urtwn/if_urtwn.c  Mon Mar 18 02:56:51 2019
(r345253)
+++ stable/11/sys/dev/urtwn/if_urtwn.c  Mon Mar 18 02:58:34 2019
(r345254)
@@ -3036,10 +3036,17 @@ urtwn_tx_data(struct urtwn_softc *sc, struct ieee80211
R92C_TXDW4_HWRTSEN);
}
 
-   /* XXX TODO: rtsrate is configurable? 24mbit may
-* be a bit high for RTS rate? */
-   txd->txdw4 |= htole32(SM(R92C_TXDW4_RTSRATE,
-   URTWN_RIDX_OFDM24));
+   if (!(sc->chip & URTWN_CHIP_88E)) {
+   /* XXX other rates will not work without
+* urtwn_ra_init() */
+   txd->txdw4 |= htole32(SM(R92C_TXDW4_RTSRATE,
+   URTWN_RIDX_CCK1));
+   } else {
+   /* XXX TODO: rtsrate is configurable? 24mbit
+* may be a bit high for RTS rate? */
+   txd->txdw4 |= htole32(SM(R92C_TXDW4_RTSRATE,
+   URTWN_RIDX_OFDM24));
+   }
 
txd->txdw5 |= htole32(0x0001ff00);
} else  /* IEEE80211_FC0_TYPE_MGT */
@@ -5498,6 +5505,9 @@ urtwn_init(struct urtwn_softc *sc)
urtwn_write_1(sc, R88E_TX_RPT_CTRL,
urtwn_read_1(sc, R88E_TX_RPT_CTRL) | R88E_TX_RPT1_ENA);
}
+
+   if (!(sc->chip & URTWN_CHIP_88E))
+   urtwn_write_4(sc, R92C_POWER_STATUS, 0x5);
 
/* Perform LO and IQ calibrations. */
urtwn_iq_calib(sc);

Modified: stable/11/sys/dev/urtwn/if_urtwnreg.h
==
--- stable/11/sys/dev/urtwn/if_urtwnreg.h   Mon Mar 18 02:56:51 2019
(r345253)
+++ stable/11/sys/dev/urtwn/if_urtwnreg.h   Mon Mar 18 02:58:34 2019
(r345254)
@@ -163,6 +163,7 @@
 #define R92C_RD_RESP_PKT_TH0x463
 #define R92C_INIRTS_RATE_SEL   0x480
 #define R92C_INIDATA_RATE_SEL(macid)   (0x484 + (macid))
+#define R92C_POWER_STATUS  0x4a4
 #define R92C_MAX_AGGR_NUM  0x4ca
 #define R88E_TX_RPT_CTRL   0x4ec
 #define R88E_TX_RPT_MACID_MAX  0x4ed
___
svn-src-all@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 commit: r345253 - in stable/12/sys/dev/rtwn/rtl8192c: . usb

2019-03-17 Thread Andriy Voskoboinyk
Author: avos
Date: Mon Mar 18 02:56:51 2019
New Revision: 345253
URL: https://svnweb.freebsd.org/changeset/base/345253

Log:
  MFC r344745:
  rtwn_usb(4): fix Tx instability with RTL8192CU chipsets
  
  PR:   233949

Modified:
  stable/12/sys/dev/rtwn/rtl8192c/r92c_reg.h
  stable/12/sys/dev/rtwn/rtl8192c/r92c_tx.c
  stable/12/sys/dev/rtwn/rtl8192c/usb/r92cu_init.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/rtwn/rtl8192c/r92c_reg.h
==
--- stable/12/sys/dev/rtwn/rtl8192c/r92c_reg.h  Mon Mar 18 02:40:22 2019
(r345252)
+++ stable/12/sys/dev/rtwn/rtl8192c/r92c_reg.h  Mon Mar 18 02:56:51 2019
(r345253)
@@ -148,6 +148,7 @@
 #define R92C_RD_RESP_PKT_TH0x463
 #define R92C_INIRTS_RATE_SEL   0x480
 #define R92C_INIDATA_RATE_SEL(macid)   (0x484 + (macid))
+#define R92C_POWER_STATUS  0x4a4
 #define R92C_QUEUE_CTRL0x4c6
 #define R92C_MAX_AGGR_NUM  0x4ca
 #define R92C_BAR_MODE_CTRL 0x4cc

Modified: stable/12/sys/dev/rtwn/rtl8192c/r92c_tx.c
==
--- stable/12/sys/dev/rtwn/rtl8192c/r92c_tx.c   Mon Mar 18 02:40:22 2019
(r345252)
+++ stable/12/sys/dev/rtwn/rtl8192c/r92c_tx.c   Mon Mar 18 02:56:51 2019
(r345253)
@@ -211,6 +211,12 @@ r92c_tx_setup_macid(void *buf, int id)
struct r92c_tx_desc *txd = (struct r92c_tx_desc *)buf;
 
txd->txdw1 |= htole32(SM(R92C_TXDW1_MACID, id));
+
+   /* XXX does not belong here */
+   /* XXX temporary (I hope) */
+   /* Force CCK1 for RTS / CTS frames (driver bug) */
+   txd->txdw4 &= ~htole32(SM(R92C_TXDW4_RTSRATE, R92C_TXDW4_RTSRATE_M));
+   txd->txdw4 &= ~htole32(R92C_TXDW4_RTS_SHORT);
 }
 
 void

Modified: stable/12/sys/dev/rtwn/rtl8192c/usb/r92cu_init.c
==
--- stable/12/sys/dev/rtwn/rtl8192c/usb/r92cu_init.cMon Mar 18 02:40:22 
2019(r345252)
+++ stable/12/sys/dev/rtwn/rtl8192c/usb/r92cu_init.cMon Mar 18 02:56:51 
2019(r345253)
@@ -357,6 +357,8 @@ void
 r92cu_post_init(struct rtwn_softc *sc)
 {
 
+   rtwn_write_4(sc, R92C_POWER_STATUS, 0x5);
+
/* Perform LO and IQ calibrations. */
r92c_iq_calib(sc);
/* Perform LC calibration. */
___
svn-src-all@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 commit: r345252 - head/sys/net80211

2019-03-17 Thread Andriy Voskoboinyk
Author: avos
Date: Mon Mar 18 02:40:22 2019
New Revision: 345252
URL: https://svnweb.freebsd.org/changeset/base/345252

Log:
  net80211: correct check for SMPS node flags updates
  
  Update node flags when driver supports SMPS, not when it is disabled or
  in dynamic mode ((iv_htcaps & HTCAP_SMPS) != 0).
  
  Checked with RTL8188EE (1T1R), STA mode - 'smps' word should disappear
  from 'ifconfig wlan0' output.
  
  MFC after:2 weeks

Modified:
  head/sys/net80211/ieee80211_ht.c

Modified: head/sys/net80211/ieee80211_ht.c
==
--- head/sys/net80211/ieee80211_ht.cSun Mar 17 22:26:50 2019
(r345251)
+++ head/sys/net80211/ieee80211_ht.cMon Mar 18 02:40:22 2019
(r345252)
@@ -1727,7 +1727,7 @@ ieee80211_ht_updateparams(struct ieee80211_node *ni,
const struct ieee80211_ie_htinfo *htinfo;
 
ieee80211_parse_htcap(ni, htcapie);
-   if (vap->iv_htcaps & IEEE80211_HTCAP_SMPS)
+   if (vap->iv_htcaps & IEEE80211_HTC_SMPS)
htcap_update_mimo_ps(ni);
htcap_update_shortgi(ni);
htcap_update_ldpc(ni);
@@ -1880,7 +1880,7 @@ ieee80211_ht_updatehtcap(struct ieee80211_node *ni, co
struct ieee80211vap *vap = ni->ni_vap;
 
ieee80211_parse_htcap(ni, htcapie);
-   if (vap->iv_htcaps & IEEE80211_HTCAP_SMPS)
+   if (vap->iv_htcaps & IEEE80211_HTC_SMPS)
htcap_update_mimo_ps(ni);
htcap_update_shortgi(ni);
htcap_update_ldpc(ni);
___
svn-src-all@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 commit: r345251 - head/usr.bin/calendar/calendars

2019-03-17 Thread Greg Lehey
Author: grog
Date: Sun Mar 17 22:26:50 2019
New Revision: 345251
URL: https://svnweb.freebsd.org/changeset/base/345251

Log:
  Change date of Canberra Day, now on second Monday in March.
https://en.wikipedia.org/wiki/Canberra_Day

Modified:
  head/usr.bin/calendar/calendars/calendar.australia

Modified: head/usr.bin/calendar/calendars/calendar.australia
==
--- head/usr.bin/calendar/calendars/calendar.australia  Sun Mar 17 20:43:31 
2019(r345250)
+++ head/usr.bin/calendar/calendars/calendar.australia  Sun Mar 17 22:26:50 
2019(r345251)
@@ -17,7 +17,7 @@ Jun/MonSecond Queen's Birthday Holiday (Australia, exc
 Oct/SunFirst   Daylight Savings Time starts in ACT, NSW, SA and VIC.
 
 /* ACT, NSW, common */
-Mar 18 Canberra Day (ACT)
+Mar/MonSecond  Canberra Day (ACT)
 Sep/MonLastFamily & Community Day (ACT)
 Aug/MonFirst   Bank Holiday (ACT, NSW)
 Oct/MonFirst   Labour Day (ACT, NSW, SA)
___
svn-src-all@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 commit: r345250 - in stable/12/sys/cddl/contrib/opensolaris/uts: common/dtrace intel/dtrace

2019-03-17 Thread Mark Johnston
Author: markj
Date: Sun Mar 17 20:43:31 2019
New Revision: 345250
URL: https://svnweb.freebsd.org/changeset/base/345250

Log:
  MFC r344599:
  Fix fasttrap_sig{trap,segv}().

Modified:
  stable/12/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c
  stable/12/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c
==
--- stable/12/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Sun Mar 
17 20:43:01 2019(r345249)
+++ stable/12/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Sun Mar 
17 20:43:31 2019(r345250)
@@ -291,30 +291,15 @@ fasttrap_hash_str(const char *p)
 void
 fasttrap_sigtrap(proc_t *p, kthread_t *t, uintptr_t pc)
 {
-#ifdef illumos
-   sigqueue_t *sqp = kmem_zalloc(sizeof (sigqueue_t), KM_SLEEP);
+   ksiginfo_t ksi;
 
-   sqp->sq_info.si_signo = SIGTRAP;
-   sqp->sq_info.si_code = TRAP_DTRACE;
-   sqp->sq_info.si_addr = (caddr_t)pc;
-
-   mutex_enter(&p->p_lock);
-   sigaddqa(p, t, sqp);
-   mutex_exit(&p->p_lock);
-
-   if (t != NULL)
-   aston(t);
-#else
-   ksiginfo_t *ksi = kmem_zalloc(sizeof (ksiginfo_t), KM_SLEEP);
-
-   ksiginfo_init(ksi);
-   ksi->ksi_signo = SIGTRAP;
-   ksi->ksi_code = TRAP_DTRACE;
-   ksi->ksi_addr = (caddr_t)pc;
+   ksiginfo_init(&ksi);
+   ksi.ksi_signo = SIGTRAP;
+   ksi.ksi_code = TRAP_DTRACE;
+   ksi.ksi_addr = (caddr_t)pc;
PROC_LOCK(p);
-   (void) tdsendsignal(p, t, SIGTRAP, ksi);
+   (void)tdsendsignal(p, t, SIGTRAP, &ksi);
PROC_UNLOCK(p);
-#endif
 }
 
 #ifndef illumos

Modified: stable/12/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c
==
--- stable/12/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c  
Sun Mar 17 20:43:01 2019(r345249)
+++ stable/12/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c  
Sun Mar 17 20:43:31 2019(r345250)
@@ -735,13 +735,15 @@ fasttrap_return_common(struct reg *rp, uintptr_t pc, p
 static void
 fasttrap_sigsegv(proc_t *p, kthread_t *t, uintptr_t addr)
 {
-   ksiginfo_t *ksi = kmem_zalloc(sizeof (ksiginfo_t), KM_SLEEP);
+   ksiginfo_t ksi;
 
-   ksiginfo_init(ksi);
-   ksi->ksi_signo = SIGSEGV;
-   ksi->ksi_code = SEGV_MAPERR;
-   ksi->ksi_addr = (caddr_t)addr;
-   (void) tdksignal(t, SIGSEGV, ksi);
+   ksiginfo_init(&ksi);
+   ksi.ksi_signo = SIGSEGV;
+   ksi.ksi_code = SEGV_MAPERR;
+   ksi.ksi_addr = (caddr_t)addr;
+   PROC_LOCK(p);
+   (void)tdksignal(t, SIGSEGV, &ksi);
+   PROC_UNLOCK(p);
 }
 
 #ifdef __amd64
___
svn-src-all@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 commit: r345249 - stable/12/sys/cddl/contrib/opensolaris/uts/intel/dtrace

2019-03-17 Thread Mark Johnston
Author: markj
Date: Sun Mar 17 20:43:01 2019
New Revision: 345249
URL: https://svnweb.freebsd.org/changeset/base/345249

Log:
  MFC r344588:
  Remove illumos-specific code from the x86 fasttrap_isa.c.

Modified:
  stable/12/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c
==
--- stable/12/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c  
Sun Mar 17 20:41:06 2019(r345248)
+++ stable/12/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c  
Sun Mar 17 20:43:01 2019(r345249)
@@ -28,21 +28,11 @@
  * Use is subject to license terms.
  */
 
-#ifdef illumos
-#pragma ident  "%Z%%M% %I% %E% SMI"
-#endif
-
 #include 
 #include 
 #include 
 #include 
 #include 
-#ifdef illumos
-#include 
-#include 
-#include 
-#include 
-#else
 #include 
 #include 
 #include 
@@ -53,14 +43,8 @@
 #include 
 #include 
 #include 
-#endif
 #include 
-#ifdef illumos
-#include 
-#include 
-#else
 #include 
-#endif /* illumos */
 
 #ifdef __i386__
 #definer_rax   r_eax
@@ -707,16 +691,9 @@ fasttrap_return_common(struct reg *rp, uintptr_t pc, p
fasttrap_tracepoint_t *tp;
fasttrap_bucket_t *bucket;
fasttrap_id_t *id;
-#ifdef illumos
-   kmutex_t *pid_mtx;
-
-   pid_mtx = &cpu_core[CPU->cpu_id].cpuc_pid_lock;
-   mutex_enter(pid_mtx);
-#else
struct rm_priotracker tracker;
 
rm_rlock(&fasttrap_tp_lock, &tracker);
-#endif
bucket = &fasttrap_tpoints.fth_table[FASTTRAP_TPOINTS_INDEX(pid, pc)];
 
for (tp = bucket->ftb_data; tp != NULL; tp = tp->ftt_next) {
@@ -731,11 +708,7 @@ fasttrap_return_common(struct reg *rp, uintptr_t pc, p
 * is not essential to the correct execution of the process.
 */
if (tp == NULL) {
-#ifdef illumos
-   mutex_exit(pid_mtx);
-#else
rm_runlock(&fasttrap_tp_lock, &tracker);
-#endif
return;
}
 
@@ -756,30 +729,12 @@ fasttrap_return_common(struct reg *rp, uintptr_t pc, p
rp->r_rax, rp->r_rbx, 0, 0);
}
 
-#ifdef illumos
-   mutex_exit(pid_mtx);
-#else
rm_runlock(&fasttrap_tp_lock, &tracker);
-#endif
 }
 
 static void
 fasttrap_sigsegv(proc_t *p, kthread_t *t, uintptr_t addr)
 {
-#ifdef illumos
-   sigqueue_t *sqp = kmem_zalloc(sizeof (sigqueue_t), KM_SLEEP);
-
-   sqp->sq_info.si_signo = SIGSEGV;
-   sqp->sq_info.si_code = SEGV_MAPERR;
-   sqp->sq_info.si_addr = (caddr_t)addr;
-
-   mutex_enter(&p->p_lock);
-   sigaddqa(p, t, sqp);
-   mutex_exit(&p->p_lock);
-
-   if (t != NULL)
-   aston(t);
-#else
ksiginfo_t *ksi = kmem_zalloc(sizeof (ksiginfo_t), KM_SLEEP);
 
ksiginfo_init(ksi);
@@ -787,7 +742,6 @@ fasttrap_sigsegv(proc_t *p, kthread_t *t, uintptr_t ad
ksi->ksi_code = SEGV_MAPERR;
ksi->ksi_addr = (caddr_t)addr;
(void) tdksignal(t, SIGSEGV, ksi);
-#endif
 }
 
 #ifdef __amd64
@@ -971,9 +925,6 @@ fasttrap_pid_probe(struct trapframe *tf)
uintptr_t pc;
uintptr_t new_pc = 0;
fasttrap_bucket_t *bucket;
-#ifdef illumos
-   kmutex_t *pid_mtx;
-#endif
fasttrap_tracepoint_t *tp, tp_local;
pid_t pid;
dtrace_icookie_t cookie;
@@ -1013,15 +964,6 @@ fasttrap_pid_probe(struct trapframe *tf)
 * parent. We know that there's only one thread of control in such a
 * process: this one.
 */
-#ifdef illumos
-   while (p->p_flag & SVFORK) {
-   p = p->p_parent;
-   }
-
-   pid = p->p_pid;
-   pid_mtx = &cpu_core[CPU->cpu_id].cpuc_pid_lock;
-   mutex_enter(pid_mtx);
-#else
pp = p;
sx_slock(&proctree_lock);
while (pp->p_vmspace == pp->p_pptr->p_vmspace)
@@ -1045,7 +987,6 @@ fasttrap_pid_probe(struct trapframe *tf)
sx_sunlock(&proctree_lock);
 
rm_rlock(&fasttrap_tp_lock, &tracker);
-#endif
 
bucket = &fasttrap_tpoints.fth_table[FASTTRAP_TPOINTS_INDEX(pid, pc)];
 
@@ -1064,10 +1005,6 @@ fasttrap_pid_probe(struct trapframe *tf)
 * fasttrap_ioctl), or somehow we have mislaid this tracepoint.
 */
if (tp == NULL) {
-#ifdef illumos
-   mutex_exit(pid_mtx);
-   return (-1);
-#else
rm_runlock(&fasttrap_tp_lock, &tracker);
gen = atomic_load_acq_64(&pp->p_fasttrap_tp_gen);
if (pp != p)
@@ -1088,7 +1025,6 @@ fasttrap_pid_probe(struct trapframe *tf)
return (0);
}
return (-1);
-#endif
}
if (pp != p)
PRELE(pp);
@@ -1210,11 +1146,7 @@ fasttrap_pid_probe(struct trapframe *tf)
 * tracepoint again later if we need to light up any return probes.
 */
tp_local = *tp;
-#ifdef

svn commit: r345248 - stable/12/sys/kern

2019-03-17 Thread Mark Johnston
Author: markj
Date: Sun Mar 17 20:41:06 2019
New Revision: 345248
URL: https://svnweb.freebsd.org/changeset/base/345248

Log:
  MFC r344670:
  Allow FIONBIO and FIOASYNC ioctls on POSIX shm descriptors.

Modified:
  stable/12/sys/kern/uipc_shm.c

Modified: stable/12/sys/kern/uipc_shm.c
==
--- stable/12/sys/kern/uipc_shm.c   Sun Mar 17 20:30:27 2019
(r345247)
+++ stable/12/sys/kern/uipc_shm.c   Sun Mar 17 20:41:06 2019
(r345248)
@@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -126,6 +127,7 @@ static int  shm_remove(char *path, Fnv32_t fnv, struct 
 static fo_rdwr_t   shm_read;
 static fo_rdwr_t   shm_write;
 static fo_truncate_t   shm_truncate;
+static fo_ioctl_t  shm_ioctl;
 static fo_stat_t   shm_stat;
 static fo_close_t  shm_close;
 static fo_chmod_t  shm_chmod;
@@ -139,7 +141,7 @@ struct fileops shm_ops = {
.fo_read = shm_read,
.fo_write = shm_write,
.fo_truncate = shm_truncate,
-   .fo_ioctl = invfo_ioctl,
+   .fo_ioctl = shm_ioctl,
.fo_poll = invfo_poll,
.fo_kqfilter = invfo_kqfilter,
.fo_stat = shm_stat,
@@ -361,6 +363,24 @@ shm_truncate(struct file *fp, off_t length, struct ucr
return (error);
 #endif
return (shm_dotruncate(shmfd, length));
+}
+
+int
+shm_ioctl(struct file *fp, u_long com, void *data, struct ucred *active_cred,
+struct thread *td)
+{
+
+   switch (com) {
+   case FIONBIO:
+   case FIOASYNC:
+   /*
+* Allow fcntl(fd, F_SETFL, O_NONBLOCK) to work,
+* just like it would on an unlinked regular file
+*/
+   return (0);
+   default:
+   return (ENOTTY);
+   }
 }
 
 static int
___
svn-src-all@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 commit: r345247 - in stable/12/sys: cddl/contrib/opensolaris/uts/common/dtrace cddl/contrib/opensolaris/uts/intel/dtrace cddl/dev/dtrace modules/dtrace

2019-03-17 Thread Mark Johnston
Author: markj
Date: Sun Mar 17 20:30:27 2019
New Revision: 345247
URL: https://svnweb.freebsd.org/changeset/base/345247

Log:
  MFC r344450, r344452, r344453:
  Fix a tracepoint lookup race in fasttrap_pid_probe().

Modified:
  stable/12/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c
  stable/12/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c
  stable/12/sys/cddl/dev/dtrace/dtrace_cddl.h
  stable/12/sys/modules/dtrace/Makefile
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c
==
--- stable/12/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Sun Mar 
17 18:31:48 2019(r345246)
+++ stable/12/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Sun Mar 
17 20:30:27 2019(r345247)
@@ -1089,6 +1089,8 @@ fasttrap_tracepoint_disable(proc_t *p, fasttrap_probe_
ASSERT(p->p_proc_flag & P_PR_LOCK);
 #endif
p->p_dtrace_count--;
+
+   atomic_add_rel_64(&p->p_fasttrap_tp_gen, 1);
}
 
/*

Modified: stable/12/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c
==
--- stable/12/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c  
Sun Mar 17 18:31:48 2019(r345246)
+++ stable/12/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c  
Sun Mar 17 20:30:27 2019(r345247)
@@ -967,6 +967,7 @@ fasttrap_pid_probe(struct trapframe *tf)
struct reg reg, *rp;
proc_t *p = curproc, *pp;
struct rm_priotracker tracker;
+   uint64_t gen;
uintptr_t pc;
uintptr_t new_pc = 0;
fasttrap_bucket_t *bucket;
@@ -1026,8 +1027,22 @@ fasttrap_pid_probe(struct trapframe *tf)
while (pp->p_vmspace == pp->p_pptr->p_vmspace)
pp = pp->p_pptr;
pid = pp->p_pid;
+   if (pp != p) {
+   PROC_LOCK(pp);
+   if ((pp->p_flag & P_WEXIT) != 0) {
+   /*
+* This can happen if the child was created with
+* rfork(2).  Userspace tracing cannot work reliably in
+* such a scenario, but we can at least try.
+*/
+   PROC_UNLOCK(pp);
+   sx_sunlock(&proctree_lock);
+   return (-1);
+   }
+   _PHOLD_LITE(pp);
+   PROC_UNLOCK(pp);
+   }
sx_sunlock(&proctree_lock);
-   pp = NULL;
 
rm_rlock(&fasttrap_tp_lock, &tracker);
 #endif
@@ -1051,11 +1066,32 @@ fasttrap_pid_probe(struct trapframe *tf)
if (tp == NULL) {
 #ifdef illumos
mutex_exit(pid_mtx);
+   return (-1);
 #else
rm_runlock(&fasttrap_tp_lock, &tracker);
+   gen = atomic_load_acq_64(&pp->p_fasttrap_tp_gen);
+   if (pp != p)
+   PRELE(pp);
+   if (curthread->t_fasttrap_tp_gen != gen) {
+   /*
+* At least one tracepoint associated with this PID has
+* been removed from the table since #BP was raised.
+* Speculate that we hit a tracepoint that has since
+* been removed, and retry the instruction.
+*/
+   curthread->t_fasttrap_tp_gen = gen;
+#ifdef __amd64
+   tf->tf_rip = pc;
+#else
+   tf->tf_eip = pc;
 #endif
+   return (0);
+   }
return (-1);
+#endif
}
+   if (pp != p)
+   PRELE(pp);
 
/*
 * Set the program counter to the address of the traced instruction

Modified: stable/12/sys/cddl/dev/dtrace/dtrace_cddl.h
==
--- stable/12/sys/cddl/dev/dtrace/dtrace_cddl.h Sun Mar 17 18:31:48 2019
(r345246)
+++ stable/12/sys/cddl/dev/dtrace/dtrace_cddl.h Sun Mar 17 20:30:27 2019
(r345247)
@@ -37,7 +37,7 @@ typedef struct kdtrace_proc {
u_int64_t   p_dtrace_count; /* Number of DTrace tracepoints 
*/
void*p_dtrace_helpers;  /* DTrace helpers, if any */
int p_dtrace_model;
-
+   uint64_tp_fasttrap_tp_gen;  /* Tracepoint hash table gen */
 } kdtrace_proc_t;
 
 /*
@@ -86,6 +86,7 @@ typedef struct kdtrace_thread {
u_int64_t   td_hrtime;  /* Last time on cpu. */
void*td_dtrace_sscr; /* Saved scratch space location. */
void*td_systrace_args; /* syscall probe arguments. */
+   uint64_ttd_fasttrap_tp_gen; /* Tracepoint hash table gen. */
 } kdtrace_thread_t;
 
 /*
@@ -113,10 +114,12 @@ typedef stru

svn commit: r345246 - head/sys/i386/i386

2019-03-17 Thread Konstantin Belousov
Author: kib
Date: Sun Mar 17 18:31:48 2019
New Revision: 345246
URL: https://svnweb.freebsd.org/changeset/base/345246

Log:
  i386: improve detection of the fast page fault assist.
  
  In particular, check that we are assisting the page fault from kernel mode.
  
  Sponsored by: The FreeBSD Foundation
  MFC after:3 days

Modified:
  head/sys/i386/i386/exception.s

Modified: head/sys/i386/i386/exception.s
==
--- head/sys/i386/i386/exception.s  Sun Mar 17 18:06:13 2019
(r345245)
+++ head/sys/i386/i386/exception.s  Sun Mar 17 18:31:48 2019
(r345246)
@@ -131,6 +131,10 @@ IDTVEC(prot)
pushl   $T_PROTFLT
jmp irettraps
 IDTVEC(page)
+   testl   $PSL_VM, TF_EFLAGS-TF_ERR(%esp)
+   jnz 1f
+   testb   $SEL_RPL_MASK, TF_CS-TF_ERR(%esp)
+   jnz 1f
cmpl$PMAP_TRM_MIN_ADDRESS, TF_EIP-TF_ERR(%esp)
jb  1f
movl%ebx, %cr3
___
svn-src-all@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 commit: r345245 - head/sys/ufs/ufs

2019-03-17 Thread Mark Johnston
Author: markj
Date: Sun Mar 17 18:06:13 2019
New Revision: 345245
URL: https://svnweb.freebsd.org/changeset/base/345245

Log:
  Fix the gcc build (-Wstrict-prototypes) after r345244.
  
  Reported by:  jenkins
  MFC with: r345244

Modified:
  head/sys/ufs/ufs/ufs_bmap.c

Modified: head/sys/ufs/ufs/ufs_bmap.c
==
--- head/sys/ufs/ufs/ufs_bmap.c Sun Mar 17 17:34:06 2019(r345244)
+++ head/sys/ufs/ufs/ufs_bmap.c Sun Mar 17 18:06:13 2019(r345245)
@@ -56,6 +56,9 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+static int ufs_readindir(struct vnode *, ufs_lbn_t, ufs2_daddr_t,
+struct buf **);
+
 /*
  * Bmap converts the logical block number of a file to its physical block
  * number on the disk. The conversion is done by using the logical block
___
svn-src-all@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"


Re: svn commit: r345244 - head/sys/ufs/ufs

2019-03-17 Thread Mark Johnston
On Sun, Mar 17, 2019 at 05:34:06PM +, Mark Johnston wrote:
> Author: markj
> Date: Sun Mar 17 17:34:06 2019
> New Revision: 345244
> URL: https://svnweb.freebsd.org/changeset/base/345244
> 
> Log:
>   Optimize lseek(SEEK_DATA) on UFS.
>   
>   The old implementation, at the VFS layer, would map the entire range of
>   logical blocks between the starting offset and the first data block
>   following that offset.  With large sparse files this is very
>   inefficient.  The VFS currently doesn't provide an interface to improve
>   upon the current implementation in a generic way.
>   
>   Add ufs_bmap_seekdata(), which uses the obvious algorithm of scanning
>   indirect blocks to look for data blocks.  Use it instead of
>   vn_bmap_seekhole() to implement SEEK_DATA.
>   
>   Reviewed by:kib, mckusick
>   MFC after:  2 weeks
>   Sponsored by:   The FreeBSD Foundation
>   Differential Revision:  https://reviews.freebsd.org/D19598

This should have been: https://reviews.freebsd.org/D19599
___
svn-src-all@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 commit: r345244 - head/sys/ufs/ufs

2019-03-17 Thread Mark Johnston
Author: markj
Date: Sun Mar 17 17:34:06 2019
New Revision: 345244
URL: https://svnweb.freebsd.org/changeset/base/345244

Log:
  Optimize lseek(SEEK_DATA) on UFS.
  
  The old implementation, at the VFS layer, would map the entire range of
  logical blocks between the starting offset and the first data block
  following that offset.  With large sparse files this is very
  inefficient.  The VFS currently doesn't provide an interface to improve
  upon the current implementation in a generic way.
  
  Add ufs_bmap_seekdata(), which uses the obvious algorithm of scanning
  indirect blocks to look for data blocks.  Use it instead of
  vn_bmap_seekhole() to implement SEEK_DATA.
  
  Reviewed by:  kib, mckusick
  MFC after:2 weeks
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D19598

Modified:
  head/sys/ufs/ufs/ufs_bmap.c
  head/sys/ufs/ufs/ufs_extern.h
  head/sys/ufs/ufs/ufs_vnops.c

Modified: head/sys/ufs/ufs/ufs_bmap.c
==
--- head/sys/ufs/ufs/ufs_bmap.c Sun Mar 17 13:02:24 2019(r345243)
+++ head/sys/ufs/ufs/ufs_bmap.c Sun Mar 17 17:34:06 2019(r345244)
@@ -90,6 +90,51 @@ ufs_bmap(ap)
return (error);
 }
 
+static int
+ufs_readindir(vp, lbn, daddr, bpp)
+   struct vnode *vp;
+   ufs_lbn_t lbn;
+   ufs2_daddr_t daddr;
+   struct buf **bpp;
+{
+   struct buf *bp;
+   struct mount *mp;
+   struct ufsmount *ump;
+   int error;
+
+   mp = vp->v_mount;
+   ump = VFSTOUFS(mp);
+
+   bp = getblk(vp, lbn, mp->mnt_stat.f_iosize, 0, 0, 0);
+   if ((bp->b_flags & B_CACHE) == 0) {
+   KASSERT(daddr != 0,
+   ("ufs_readindir: indirect block not in cache"));
+
+   bp->b_blkno = blkptrtodb(ump, daddr);
+   bp->b_iocmd = BIO_READ;
+   bp->b_flags &= ~B_INVAL;
+   bp->b_ioflags &= ~BIO_ERROR;
+   vfs_busy_pages(bp, 0);
+   bp->b_iooffset = dbtob(bp->b_blkno);
+   bstrategy(bp);
+#ifdef RACCT
+   if (racct_enable) {
+   PROC_LOCK(curproc);
+   racct_add_buf(curproc, bp, 0);
+   PROC_UNLOCK(curproc);
+   }
+#endif
+   curthread->td_ru.ru_inblock++;
+   error = bufwait(bp);
+   if (error != 0) {
+   brelse(bp);
+   return (error);
+   }
+   }
+   *bpp = bp;
+   return (0);
+}
+
 /*
  * Indirect blocks are now on the vnode for the file.  They are given negative
  * logical block numbers.  Indirect blocks are addressed by the negative
@@ -212,35 +257,10 @@ ufs_bmaparray(vp, bn, bnp, nbp, runp, runb)
 */
if (bp)
bqrelse(bp);
+   error = ufs_readindir(vp, metalbn, daddr, &bp);
+   if (error != 0)
+   return (error);
 
-   bp = getblk(vp, metalbn, mp->mnt_stat.f_iosize, 0, 0, 0);
-   if ((bp->b_flags & B_CACHE) == 0) {
-#ifdef INVARIANTS
-   if (!daddr)
-   panic("ufs_bmaparray: indirect block not in 
cache");
-#endif
-   bp->b_blkno = blkptrtodb(ump, daddr);
-   bp->b_iocmd = BIO_READ;
-   bp->b_flags &= ~B_INVAL;
-   bp->b_ioflags &= ~BIO_ERROR;
-   vfs_busy_pages(bp, 0);
-   bp->b_iooffset = dbtob(bp->b_blkno);
-   bstrategy(bp);
-#ifdef RACCT
-   if (racct_enable) {
-   PROC_LOCK(curproc);
-   racct_add_buf(curproc, bp, 0);
-   PROC_UNLOCK(curproc);
-   }
-#endif /* RACCT */
-   curthread->td_ru.ru_inblock++;
-   error = bufwait(bp);
-   if (error) {
-   brelse(bp);
-   return (error);
-   }
-   }
-
if (I_IS_UFS1(ip)) {
daddr = ((ufs1_daddr_t *)bp->b_data)[ap->in_off];
if (num == 1 && daddr && runp) {
@@ -301,6 +321,93 @@ ufs_bmaparray(vp, bn, bnp, nbp, runp, runb)
*bnp = -1;
}
return (0);
+}
+
+int
+ufs_bmap_seekdata(vp, offp)
+   struct vnode *vp;
+   off_t *offp;
+{
+   struct buf *bp;
+   struct indir a[UFS_NIADDR + 1], *ap;
+   struct inode *ip;
+   struct mount *mp;
+   struct ufsmount *ump;
+   ufs2_daddr_t blockcnt, bn, daddr;
+   uint64_t bsize;
+   off_t numblks;
+   int error, num, num1;
+
+   bp = NULL;
+   ip = VTOI(vp);
+   mp = vp->v_mount;
+   ump = VFSTOUFS(mp);
+
+   if (vp->v_type != VRE

Re: svn commit: r345238 - head

2019-03-17 Thread Ian Lepore
On Sun, 2019-03-17 at 10:32 +0100, Wolfram Schneider wrote:
> On Sat, 16 Mar 2019 at 23:37, Ian Lepore  wrote:
> > 
> > On Sat, 2019-03-16 at 20:02 +, Wolfram Schneider wrote:
> > > Author: wosch
> > > Date: Sat Mar 16 20:02:57 2019
> > > New Revision: 345238
> > > URL: https://svnweb.freebsd.org/changeset/base/345238
> > > 
> > > Log:
> > >   `make buildkernel' should display the build time in seconds
> > > 
> > >   PR: 224433
> > >   Approved by:cem
> > >   Differential Revision:  https://reviews.freebsd.org/D13910
> > > 
> > > Modified:
> > >   head/Makefile.inc1
> > > 
> > > Modified: head/Makefile.inc1
> > > =
> > > CMSG
> > > =
> > > --- head/Makefile.inc1Sat Mar 16 17:55:22
> > > 2019(r345237)
> > > +++ head/Makefile.inc1Sat Mar 16 20:02:57
> > > 2019(r345238)
> > > @@ -1584,6 +1584,11 @@ _cleankernobj_fast_depend_hack: .PHONY
> > > 
> > >  ${WMAKE_TGTS:N_worldtmp:Nbuild${libcompat}}
> > > ${.ALLTARGETS:M_*:N_worldtmp}: .MAKE .PHONY
> > > 
> > > +# record kernel(s) build time in seconds
> > > +.if make(buildkernel)
> > > +_BUILDKERNEL_START!= date '+%s'
> > > +.endif
> > > +
> > >  #
> > >  # buildkernel
> > >  #
> > > @@ -1640,7 +1645,12 @@ buildkernel: .MAKE .PHONY
> > >   @echo "--
> > > 
> > > "
> > >   @echo ">>> Kernel build for ${_kernel} completed on
> > > `LC_ALL=C
> > > date`"
> > >   @echo "--
> > > 
> > > "
> > > +
> > >  .endfor
> > > + @seconds=$$(($$(date '+%s') - ${_BUILDKERNEL_START})); \
> > > +   echo -n ">>> Kernel(s) build for${BUILDKERNELS} in
> > > $$seconds
> > > seconds, "; \
> > > +   echo "ncpu: $$(sysctl -n hw.ncpu)${.MAKE.JOBS:S/^/, make
> > > -j/}"
> > > + @echo "--
> > > 
> > > "
> > > 
> > >  NO_INSTALLEXTRAKERNELS?= yes
> > > 
> > > 
> > 
> > Does this really report the buildkernel time, or the time from when
> > make starts until when the kernel portion of the make
> > finishes?  Will
> > the result be right when you do "make buildworld buildkernel"?
> 
> Good point, I didn't checked this yet. The handbook at
> https://www.freebsd.org/doc/handbook/makeworld.html
> 
> recommends to run buildworld and buildkernel in 2 steps:
> 
> make -j4 buildworld ; make -j4 kernel
> 
> 
> 
> PS: it seems to work fine. The time will be recorded when the make
> target is called, not when make is called.
> 

_BUILDKERNEL_START will be set to the time when the makefile is parsed,
before any target is run.  My questions were basically rhetorical; what
you've done is make it report the time from when make is launched until
when various targets complete, and each report will include the
cumulative time of any targets that ran before that point.  If the goal
is to time the entire run of make (which is effectively what this is
doing), then that is probably best addressed with .BEGIN and .END
targets in Makefile, rather than multiple duplicated entries in
Makefile.inc1.

-- Ian

> $ grep ncpu build.log
> > > > World build in 2004 seconds, ncpu: 32, make -j33
> > > > Kernel(s) build for GENERIC in 138 seconds, ncpu: 32, make -j33
> 
> -Wolfram
> 

___
svn-src-all@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"


Re: svn commit: r345238 - head

2019-03-17 Thread Wolfram Schneider
On Sat, 16 Mar 2019 at 23:37, Ian Lepore  wrote:
>
> On Sat, 2019-03-16 at 20:02 +, Wolfram Schneider wrote:
> > Author: wosch
> > Date: Sat Mar 16 20:02:57 2019
> > New Revision: 345238
> > URL: https://svnweb.freebsd.org/changeset/base/345238
> >
> > Log:
> >   `make buildkernel' should display the build time in seconds
> >
> >   PR: 224433
> >   Approved by:cem
> >   Differential Revision:  https://reviews.freebsd.org/D13910
> >
> > Modified:
> >   head/Makefile.inc1
> >
> > Modified: head/Makefile.inc1
> > =
> > =
> > --- head/Makefile.inc1Sat Mar 16 17:55:22 2019(r345237)
> > +++ head/Makefile.inc1Sat Mar 16 20:02:57 2019(r345238)
> > @@ -1584,6 +1584,11 @@ _cleankernobj_fast_depend_hack: .PHONY
> >
> >  ${WMAKE_TGTS:N_worldtmp:Nbuild${libcompat}}
> > ${.ALLTARGETS:M_*:N_worldtmp}: .MAKE .PHONY
> >
> > +# record kernel(s) build time in seconds
> > +.if make(buildkernel)
> > +_BUILDKERNEL_START!= date '+%s'
> > +.endif
> > +
> >  #
> >  # buildkernel
> >  #
> > @@ -1640,7 +1645,12 @@ buildkernel: .MAKE .PHONY
> >   @echo "--
> > "
> >   @echo ">>> Kernel build for ${_kernel} completed on `LC_ALL=C
> > date`"
> >   @echo "--
> > "
> > +
> >  .endfor
> > + @seconds=$$(($$(date '+%s') - ${_BUILDKERNEL_START})); \
> > +   echo -n ">>> Kernel(s) build for${BUILDKERNELS} in $$seconds
> > seconds, "; \
> > +   echo "ncpu: $$(sysctl -n hw.ncpu)${.MAKE.JOBS:S/^/, make
> > -j/}"
> > + @echo "--
> > "
> >
> >  NO_INSTALLEXTRAKERNELS?= yes
> >
> >
>
> Does this really report the buildkernel time, or the time from when
> make starts until when the kernel portion of the make finishes?  Will
> the result be right when you do "make buildworld buildkernel"?

Good point, I didn't checked this yet. The handbook at
https://www.freebsd.org/doc/handbook/makeworld.html

recommends to run buildworld and buildkernel in 2 steps:

make -j4 buildworld ; make -j4 kernel



PS: it seems to work fine. The time will be recorded when the make
target is called, not when make is called.

$ grep ncpu build.log
>>> World build in 2004 seconds, ncpu: 32, make -j33
>>> Kernel(s) build for GENERIC in 138 seconds, ncpu: 32, make -j33

-Wolfram

-- 
Wolfram Schneider  https://wolfram.schneider.org
___
svn-src-all@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 commit: r345243 - stable/12/sys/mips/mips

2019-03-17 Thread Konstantin Belousov
Author: kib
Date: Sun Mar 17 13:02:24 2019
New Revision: 345243
URL: https://svnweb.freebsd.org/changeset/base/345243

Log:
  MFC r345141:
  mips: remove dead comment and definitions.

Modified:
  stable/12/sys/mips/mips/vm_machdep.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/mips/mips/vm_machdep.c
==
--- stable/12/sys/mips/mips/vm_machdep.cSun Mar 17 11:27:27 2019
(r345242)
+++ stable/12/sys/mips/mips/vm_machdep.cSun Mar 17 13:02:24 2019
(r345243)
@@ -456,14 +456,6 @@ cpu_set_upcall(struct thread *td, void (*entry)(void *
 }
 
 /*
- * Implement the pre-zeroed page mechanism.
- * This routine is called from the idle loop.
- */
-
-#defineZIDLE_LO(v) ((v) * 2 / 3)
-#defineZIDLE_HI(v) ((v) * 4 / 5)
-
-/*
  * Software interrupt handler for queued VM system processing.
  */
 void
___
svn-src-all@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 commit: r345241 - head/libexec/rc

2019-03-17 Thread Bjoern A. Zeeb
Author: bz
Date: Sun Mar 17 09:31:09 2019
New Revision: 345241
URL: https://svnweb.freebsd.org/changeset/base/345241

Log:
  Fix legacy IP autoconfiguration.
  
  It seems my subconcious plan in r345088 to not only prefer IPv6 autoconf
  but to also slowly deteriorate legacy IP auto-configuration was uncovered
  way too early.
  
  In case IPv6 is a thing yet ipv6_autoconfif was not true, we would not
  bring up the interface yet tell the follow-up DHCPv4 configuration in
  ifconfig_up() that we did.  So unless you were doing SYNCDHCP or IPv6
  you would not get legacy-IP DHCPv4 configuration.
  
  I see multiple problems here: (a) people not yet using IPv6 (obviously a
  problem), and (b) the dhclient startup script not running dhclient in
  that case despite configured to do so (needs to be investigated seperately).
  
  Reported by:  Pawel Biernacki (pawel.biernacki gmail.com)
  Tested by:Pawel Biernacki
  Differential Revision:https://reviews.freebsd.org/D19488
  Pointyhat to: bz (not sure if it is for breaking or
for letting them notice it so easily)

Modified:
  head/libexec/rc/network.subr

Modified: head/libexec/rc/network.subr
==
--- head/libexec/rc/network.subrSun Mar 17 06:05:19 2019
(r345240)
+++ head/libexec/rc/network.subrSun Mar 17 09:31:09 2019
(r345241)
@@ -230,8 +230,7 @@ ifconfig_up()
fi
 
if ! noafif $1 && afexists inet6; then
-   ipv6_accept_rtadv_up $1
-   _cfg=0
+   ipv6_accept_rtadv_up $1 && _cfg=0
fi
 
if dhcpif $1; then
@@ -1205,7 +1204,9 @@ ipv6_accept_rtadv_up()
if [ -x /sbin/rtsol ]; then
/sbin/rtsol ${rtsol_flags} $1
fi
+   return 0
fi
+   return 1
 }
 
 # ipv6_accept_rtadv_down if
___
svn-src-all@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 commit: r345242 - head/lib/libomp

2019-03-17 Thread Dimitry Andric
Author: dim
Date: Sun Mar 17 11:27:27 2019
New Revision: 345242
URL: https://svnweb.freebsd.org/changeset/base/345242

Log:
  Explicitly link libomp.so against -lpthread, as it depends on pthread
  functionality.  This should make example OpenMP programs work out of the
  box.
  
  Reported by:  jbeich
  PR:   236062, 236581
  MFC after:1 month
  X-MFC-With:   r344779

Modified:
  head/lib/libomp/Makefile

Modified: head/lib/libomp/Makefile
==
--- head/lib/libomp/MakefileSun Mar 17 09:31:09 2019(r345241)
+++ head/lib/libomp/MakefileSun Mar 17 11:27:27 2019(r345242)
@@ -66,4 +66,6 @@ LDFLAGS+= -Wl,-soname,libomp.so
 
 VERSION_MAP=   ${OMPSRC}/exports_so.txt
 
+LIBADD+=   pthread
+
 .include 
___
svn-src-all@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 commit: r345240 - stable/12/sys/ufs/ffs

2019-03-17 Thread Jason A. Harmening
Author: jah
Date: Sun Mar 17 06:05:19 2019
New Revision: 345240
URL: https://svnweb.freebsd.org/changeset/base/345240

Log:
  MFC r344562:
  
  FFS: allow sendfile(2) to work with block sizes greater than the page size
  
  Implement ffs_getpages_async(), which when possible calls the asynchronous
  flavor of the generic pager's getpages function. When the underlying
  block size is larger than the system page size, however, it will invoke
  the (synchronous) buffer cache pager, followed by a call to the client
  completion routine. This retains true asynchronous completion in the most
  common (block size <= page size) case, which is important for the performance
  of the new sendfile(2). The behavior in the larger block size case mirrors
  the default implementation of VOP_GETPAGES_ASYNC, which most other
  filesystems use anyway as they do not override the getpages_async method.
  
  PR:   235708

Modified:
  stable/12/sys/ufs/ffs/ffs_vnops.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/ufs/ffs/ffs_vnops.c
==
--- stable/12/sys/ufs/ffs/ffs_vnops.c   Sun Mar 17 04:33:17 2019
(r345239)
+++ stable/12/sys/ufs/ffs/ffs_vnops.c   Sun Mar 17 06:05:19 2019
(r345240)
@@ -111,6 +111,7 @@ extern int  ffs_rawread(struct vnode *vp, struct uio *u
 static vop_fdatasync_t ffs_fdatasync;
 static vop_fsync_t ffs_fsync;
 static vop_getpages_t  ffs_getpages;
+static vop_getpages_async_tffs_getpages_async;
 static vop_lock1_t ffs_lock;
 static vop_read_t  ffs_read;
 static vop_write_t ffs_write;
@@ -132,7 +133,7 @@ struct vop_vector ffs_vnodeops1 = {
.vop_fsync =ffs_fsync,
.vop_fdatasync =ffs_fdatasync,
.vop_getpages = ffs_getpages,
-   .vop_getpages_async =   vnode_pager_local_getpages_async,
+   .vop_getpages_async =   ffs_getpages_async,
.vop_lock1 =ffs_lock,
.vop_read = ffs_read,
.vop_reallocblks =  ffs_reallocblks,
@@ -154,7 +155,7 @@ struct vop_vector ffs_vnodeops2 = {
.vop_fsync =ffs_fsync,
.vop_fdatasync =ffs_fdatasync,
.vop_getpages = ffs_getpages,
-   .vop_getpages_async =   vnode_pager_local_getpages_async,
+   .vop_getpages_async =   ffs_getpages_async,
.vop_lock1 =ffs_lock,
.vop_read = ffs_read,
.vop_reallocblks =  ffs_reallocblks,
@@ -1742,3 +1743,25 @@ ffs_getpages(struct vop_getpages_args *ap)
return (vfs_bio_getpages(vp, ap->a_m, ap->a_count, ap->a_rbehind,
ap->a_rahead, ffs_gbp_getblkno, ffs_gbp_getblksz));
 }
+
+static int
+ffs_getpages_async(struct vop_getpages_async_args *ap)
+{
+   struct vnode *vp;
+   struct ufsmount *um;
+   int error;
+
+   vp = ap->a_vp;
+   um = VFSTOUFS(vp->v_mount);
+
+   if (um->um_devvp->v_bufobj.bo_bsize <= PAGE_SIZE)
+   return (vnode_pager_generic_getpages(vp, ap->a_m, ap->a_count,
+   ap->a_rbehind, ap->a_rahead, ap->a_iodone, ap->a_arg));
+
+   error = vfs_bio_getpages(vp, ap->a_m, ap->a_count, ap->a_rbehind,
+   ap->a_rahead, ffs_gbp_getblkno, ffs_gbp_getblksz);
+   ap->a_iodone(ap->a_arg, ap->a_m, ap->a_count, error);
+
+   return (error);
+}
+
___
svn-src-all@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"