From owner-freebsd-mips@FreeBSD.ORG Thu May 27 14:26:27 2010 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D04A610656D4 for ; Thu, 27 May 2010 14:26:27 +0000 (UTC) (envelope-from c.jayachandran@gmail.com) Received: from mail-pz0-f183.google.com (mail-pz0-f183.google.com [209.85.222.183]) by mx1.freebsd.org (Postfix) with ESMTP id A50428FC0C for ; Thu, 27 May 2010 14:26:27 +0000 (UTC) Received: by pzk13 with SMTP id 13so25806pzk.13 for ; Thu, 27 May 2010 07:26:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=KgSDNeMtMRfshIOUXFplN+VnkpLBY2XMFh3yw8r05j0=; b=gE8rU4sPHVJWMO6ayT3LTS8EhKVDlCd05l1MQ5BTSQTvZHZTBogzaQTfr6UkwsTN37 Lc51lpyrIpO9UTfQe2P9xSs7JX3rRif5U+tIU3w5cc08SXKLadzES1kNZG6jkLoi/Ubh ufL8ERD14Rf8IDFLgHybH/e5vk4fIQjkP0rI0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=fsoKVL9ycuWZDE+4+4Ve+tx2IlkV7ZafgkpwoOeO8Ifi6+rStHapV3tGdAXSbhuELx stZk327807womMGRc3MVMt0l3tgbNXFwRxYqHIGh3ymRtsOV5ZeIGlWDamHTD5b+utVs 3erbE0genV+3iaJBHXkzCVgFJWU2fmDKe1BfM= MIME-Version: 1.0 Received: by 10.140.248.10 with SMTP id v10mr7953230rvh.245.1274970387149; Thu, 27 May 2010 07:26:27 -0700 (PDT) Received: by 10.141.32.4 with HTTP; Thu, 27 May 2010 07:26:26 -0700 (PDT) Date: Thu, 27 May 2010 19:56:26 +0530 Message-ID: From: "C. Jayachandran" To: Randall Stewart , Neel Natu , freebsd-mips@freebsd.org Content-Type: multipart/mixed; boundary=000e0cd0ed460673a50487942d73 Cc: Subject: Few more fixes to the new pagetable page allocation code. X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 May 2010 14:26:27 -0000 --000e0cd0ed460673a50487942d73 Content-Type: text/plain; charset=ISO-8859-1 The attached changes (http://people.freebsd.org/~jchandra/for-review/pmap-free-pte-page.diff) finally seems to get rid of the occasional hangs I saw during testing. The first part fixes a lock order reversal (in pmap_remove_pages...pmap_release_pte_page...uma_zfree_arg...kmem_malloc). The pmap and pagequeue locks have to be released before calling uma_zfree(). The second part takes the the pagequeue lock before changing the page fields of the pte page, I'm not sure this is necessary. Please let me know you comments. With these changes, I can get 'make -j128 buildworld' consistently work on a 32 cpu setup. Thanks, JC. --000e0cd0ed460673a50487942d73 Content-Type: text/x-patch; charset=US-ASCII; name="pmap-free-pte-page.diff" Content-Disposition: attachment; filename="pmap-free-pte-page.diff" Content-Transfer-Encoding: base64 X-Attachment-Id: f_g9po8fau0 SW5kZXg6IHN5cy9taXBzL21pcHMvcG1hcC5jCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIHN5cy9taXBzL21pcHMv cG1hcC5jCShyZXZpc2lvbiAyMDg1ODkpCisrKyBzeXMvbWlwcy9taXBzL3BtYXAuYwkod29ya2lu ZyBjb3B5KQpAQCAtODg2LDggKzg4NiwxMiBAQAogCS8qCiAJICogSWYgdGhlIHBhZ2UgaXMgZmlu YWxseSB1bndpcmVkLCBzaW1wbHkgZnJlZSBpdC4KIAkgKi8KKwlhdG9taWNfc3VidHJhY3RfaW50 KCZjbnQudl93aXJlX2NvdW50LCAxKTsKKwlQTUFQX1V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