From owner-freebsd-hackers@FreeBSD.ORG Fri Mar 13 18:18:48 2009 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 E74D91065674 for ; Fri, 13 Mar 2009 18:18:48 +0000 (UTC) (envelope-from bsd.quest@googlemail.com) Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.186]) by mx1.freebsd.org (Postfix) with ESMTP id 72C148FC12 for ; Fri, 13 Mar 2009 18:18:48 +0000 (UTC) (envelope-from bsd.quest@googlemail.com) Received: by nf-out-0910.google.com with SMTP id d21so788535nfb.33 for ; Fri, 13 Mar 2009 11:18:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=MXKX7a3xFiwoLsLIi8qDnLl+iLTRQStuz6xfRoZ7XVg=; b=JemjrkQia7AN0jkMFMOpYmY/Ejs/FYQcJWtnUq4+Vxo58wzZRbPVgB1Kgv2rbsjH+8 BaYYCf4oZdvFu7TYl4oZjMnlI8m3ujy2u66kR9wyuP42hmY5uQHbIZqLzdPEUvsLndzF AR75G6XDEZx4S04vCuw8RTEs8wRnNa+akKtU0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=EiVXPCClYf/auKEZlpTMO6whw6l9oBkQJ0p/6Pe50LrLJM4Xya+5ZtnUswU0WNup0i Y7NEAppaWqx0UbeKjrXiCNeHPfpjdvJhpfg7mZbKWxgPPyDHiSwo10TCLXvpP35ebC9a 9FcvmJAFeEK2Q7ToHm/ZWSKvOnP9f5/g/PFbw= MIME-Version: 1.0 Received: by 10.210.125.13 with SMTP id x13mr1134977ebc.33.1236968327142; Fri, 13 Mar 2009 11:18:47 -0700 (PDT) In-Reply-To: <37364E21-701A-42F9-95B7-1B3386AEDE71@nomadiclab.com> References: <37364E21-701A-42F9-95B7-1B3386AEDE71@nomadiclab.com> Date: Fri, 13 Mar 2009 19:18:47 +0100 Message-ID: <671bb5fc0903131118u31b5b9b6l46b5d063aee78ff0@mail.gmail.com> From: Alexej Sokolov To: Pekka Nikander Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-hackers@freebsd.org Subject: Re: Problems mapping an vm_object to a process memory space 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: Fri, 13 Mar 2009 18:18:49 -0000 hi , I had a problem with remapping too. Could I see your code? here is my code, that some times on AMD64 runs wrong : http://pastebin.com/m78da0b37 And now I solved the problem with remapping by using /dev/mem device. It has mmap syscal. And it seems to be working without problem. Alexej < 2009/3/13 Pekka Nikander > As a part of a research project, I'm trying to build publish/subscribe > shared memory semantics where the idea is to first map an vm_object as > read/write to a publisher's memory space, and then a COW shadow of that > later to the subscriber processes' memory space. > > I've got to the point where the code works most of the time, but at certain > scenarios (which are hard to classify and seem slightly random) the mapping > goes wrong, and either the subscriber process has no physical mapping at the > supposed address or there appears some random page. To me it appears as if > the vm_object, vm_map etc data structures are OK, but somehow the pmaps > don't get right. I'm currently using 7.1 RELEASE on amd64, but I'm planning > to try the same on -CURRENT as soon as I get it properly ported. I even > tried calling pmap_enter_object explicitly before returning to the user > space, but it doesn't seem to help. > > Another thing is that there may be some bugs related OBJ_ONEMAPPING. We > need to explicitly clear it at places, and sometimes artificially bump up > the vm_object reference count to avoid code related to ONEMAPPING from > trashing the object's mappings. Is this a known issue? > > Any advice? > > --Pekka Nikander > > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" >