From nobody@FreeBSD.org  Fri Dec 20 20:35:32 2013
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
	(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by hub.freebsd.org (Postfix) with ESMTPS id 918C5CD6
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 20 Dec 2013 20:35:32 +0000 (UTC)
Received: from oldred.freebsd.org (oldred.freebsd.org [IPv6:2001:1900:2254:206a::50:4])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mx1.freebsd.org (Postfix) with ESMTPS id 7DE72182D
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 20 Dec 2013 20:35:32 +0000 (UTC)
Received: from oldred.freebsd.org ([127.0.1.6])
	by oldred.freebsd.org (8.14.5/8.14.7) with ESMTP id rBKKZWm1008505
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 20 Dec 2013 20:35:32 GMT
	(envelope-from nobody@oldred.freebsd.org)
Received: (from nobody@localhost)
	by oldred.freebsd.org (8.14.5/8.14.5/Submit) id rBKKZWfa008504;
	Fri, 20 Dec 2013 20:35:32 GMT
	(envelope-from nobody)
Message-Id: <201312202035.rBKKZWfa008504@oldred.freebsd.org>
Date: Fri, 20 Dec 2013 20:35:32 GMT
From: Adrian Chadd <adrian@FreeBSD.org>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [armv6] issues with dhclient/sshd and jemalloc on raspberry pi and others
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         185046
>Category:       arm
>Synopsis:       [armv6] issues with dhclient/sshd and jemalloc on raspberry pi and others
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-arm
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Dec 20 20:40:00 UTC 2013
>Closed-Date:    
>Last-Modified:  Fri Dec 27 22:10:00 UTC 2013
>Originator:     Adrian Chadd
>Release:        
>Organization:
>Environment:
>Description:
There's been issues with sshd/dhclient being very upset.

It was traced down to some jemalloc behaviour with processes that fork and do.. stuff. I'm not going to pretend to know exactly what the errnat behaviour was; it's likely lurking in the freebsd-arm mailing lists.

It was bisected down to this commit:

http://svnweb.freebsd.org/base/head/sys/arm/arm/pmap-v6.c?r1=251370&r2=252694&pathrev=252694

Reverting this apparently fixes the issue.

From the committer of the change:

> I guess it should be some performance impact since we will need to
> write all pages marked as RW to backing
> storage on page-out. This is regardless of its actual dirty state (no
> modified emulation).
> But this was how it behaved earlier and nothing bad happened so it
> might be worth to temporary revert it and
> debug the problem without the negative influence on the users. After
> proper fix we should apply it again.
>
> It's up to you. I have no objections to that (I have few other patches
> that need to wait for pmap problems
> resolution anyway like pmap_copy() + SP).

>How-To-Repeat:

>Fix:


>Release-Note:
>Audit-Trail:

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: arm/185046: commit references a PR
Date: Fri, 27 Dec 2013 05:01:20 +0000 (UTC)

 Author: adrian
 Date: Fri Dec 27 05:01:13 2013
 New Revision: 259936
 URL: http://svnweb.freebsd.org/changeset/base/259936
 
 Log:
   Revert r252694 - which attempted to fix bit emulation for armv6/armv7.
   
   This seems to cause issues with jemalloc + {dhclient, sshd}.
   
   Thus, revert this for now until the root cause can be found and
   fixed.
   
   This should quieten some runtime problems with the Raspberry Pi.
   
   PR: kern/185046
   MFC after: 3 days
 
 Modified:
   head/sys/arm/arm/pmap-v6.c
 
 Modified: head/sys/arm/arm/pmap-v6.c
 ==============================================================================
 --- head/sys/arm/arm/pmap-v6.c	Fri Dec 27 04:30:32 2013	(r259935)
 +++ head/sys/arm/arm/pmap-v6.c	Fri Dec 27 05:01:13 2013	(r259936)
 @@ -3094,21 +3094,16 @@ validate:
  			if ((m->oflags & VPO_UNMANAGED) == 0) {
  				vm_page_aflag_set(m, PGA_WRITEABLE);
  				/*
 -				 * Enable write permission if the access type
 -				 * indicates write intention. Emulate modified
 -				 * bit otherwise.
 +				 * XXX: Skip modified bit emulation for now.
 +				 *	The emulation reveals problems
 +				 *	that result in random failures
 +				 *	during memory allocation on some
 +				 *	platforms.
 +				 *	Therefore, the page is marked RW
 +				 *	immediately.
  				 */
 -				if ((access & VM_PROT_WRITE) != 0) {
 -					npte &= ~(L2_APX);
 -					/*
 -					 * The access type and permissions
 -					 * indicate that the page will be
 -					 * written as soon as returned from
 -					 * fault service.
 -					 * Mark it dirty from the outset.
 -					 */
 -					vm_page_dirty(m);
 -				}
 +				npte &= ~(L2_APX);
 +				vm_page_dirty(m);
  			} else
  				npte &= ~(L2_APX);
  		}
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: arm/185046: commit references a PR
Date: Fri, 27 Dec 2013 22:05:58 +0000 (UTC)

 Author: adrian
 Date: Fri Dec 27 22:05:51 2013
 New Revision: 259963
 URL: http://svnweb.freebsd.org/changeset/base/259963
 
 Log:
   Revert r252694 from stable/10 to fix instabilities seen with jemalloc + dhclient/sshd.
   
   This is a direct commit to stable/10 as the VM code has changed
   since the stable/10 branch.
   
   PR:		kern/185046
 
 Modified:
   stable/10/sys/arm/arm/pmap-v6.c
 
 Modified: stable/10/sys/arm/arm/pmap-v6.c
 ==============================================================================
 --- stable/10/sys/arm/arm/pmap-v6.c	Fri Dec 27 22:00:22 2013	(r259962)
 +++ stable/10/sys/arm/arm/pmap-v6.c	Fri Dec 27 22:05:51 2013	(r259963)
 @@ -3087,13 +3087,8 @@ validate:
  		}
  
  		if (prot & VM_PROT_WRITE) {
 -			/*
 -			 * Enable write permission if the access type
 -			 * indicates write intention. Emulate modified
 -			 * bit otherwise.
 -			 */
 -			if ((access & VM_PROT_WRITE) != 0)
 -				npte &= ~(L2_APX);
 +			/* Write enable */
 +			npte &= ~(L2_APX);
  
  			if ((m->oflags & VPO_UNMANAGED) == 0) {
  				vm_page_aflag_set(m, PGA_WRITEABLE);
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
>Unformatted:
