From owner-freebsd-hackers@FreeBSD.ORG Sun Dec 12 17:08:43 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 638E71065670 for ; Sun, 12 Dec 2010 17:08:43 +0000 (UTC) (envelope-from extrudedaluminiu@gmail.com) Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com [209.85.216.54]) by mx1.freebsd.org (Postfix) with ESMTP id 186BC8FC12 for ; Sun, 12 Dec 2010 17:08:42 +0000 (UTC) Received: by qwj9 with SMTP id 9so5383377qwj.13 for ; Sun, 12 Dec 2010 09:08:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:date:from:x-x-sender :to:subject:message-id:user-agent:mime-version:content-type; bh=+KosSb2BvhD520qlNwub6ypkei9hzJSeghjtF7o6vUg=; b=EONmLGe7646ilu86pYn1PEdXFnBFOk/8UV89+mJW66NwnlbzqpixMpDTWHdLBYgVPQ DN9QwIXQWF0iZ/F2jVeUlU6Nj5kER0yJV5t0u1Jg1pLPv0Tf1/xGetAuu2M8XL6zR1mY cNf4u5l6WOS478zyRfxjqbte4cboU7lqDbyls= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:date:from:x-x-sender:to:subject:message-id:user-agent :mime-version:content-type; b=WaGii/+QBf3497MM63YkRizqVunLSp8XHLDyCeQQFOGF/wPGAlDL0ug3ZfJgLSWNMi ZAicYeZgYVsxQwASbh2ogt6CJiOtjch+7KgCdEB4l/zHZg36+5W8tk/pVNkXscnV/P3Z F5u3obaLMiroyPYQAL58GFBZ/+5vBCTWCU7gw= Received: by 10.229.84.135 with SMTP id j7mr2859292qcl.180.1292172066687; Sun, 12 Dec 2010 08:41:06 -0800 (PST) Received: from batman.acm.jhu.edu (batman.acm.jhu.edu [128.220.251.35]) by mx.google.com with ESMTPS id n7sm3424297qcu.16.2010.12.12.08.41.05 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 12 Dec 2010 08:41:05 -0800 (PST) Sender: Venkatesh Srinivas Date: Sun, 12 Dec 2010 11:40:59 -0500 (EST) From: Venkatesh Srinivas X-X-Sender: me@centaur.acm.jhu.edu To: freebsd-hackers@freebsd.org Message-ID: User-Agent: Alpine 2.00 (LFD 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII X-Mailman-Approved-At: Sun, 12 Dec 2010 17:39:58 +0000 Subject: i386 pmap_zero_page() late sched_pin()? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Dec 2010 17:08:43 -0000 Hi, In the i386 pmap's pmap_zero_page(), there is a fragment... sysmaps = &sysmaps_pcpu[PCPU_GET(cpuid)]; mtx_lock(&sysmaps->lock); * sched_pin(); /*map the page we mean to zero at sysmaps->CADDR2*/ pagezero(sysmaps->CADDR2); sched_unpin(); I don't know this bit of code too well, so I don't know if the sched_pin() being where it is is okay or not. My first reading says its not okay; if a thread is moved to another CPU before it is able to pin, it will use the wrong sysmaps structure. Is this the case? Is it alright that the wrong sysmap structure is used? Oh, Nathaniel Filardo (nwf@cs.jhu.edu) first spotted this, not I. Thanks, -- vs