From owner-freebsd-mips@FreeBSD.ORG Mon Sep 27 19:11:36 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 257CE106566B for ; Mon, 27 Sep 2010 19:11:36 +0000 (UTC) (envelope-from artemb@gmail.com) Received: from mail-gx0-f182.google.com (mail-gx0-f182.google.com [209.85.161.182]) by mx1.freebsd.org (Postfix) with ESMTP id D15E48FC1E for ; Mon, 27 Sep 2010 19:11:35 +0000 (UTC) Received: by gxk8 with SMTP id 8so2019754gxk.13 for ; Mon, 27 Sep 2010 12:11:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=sa5k+qm/H/AmKuZX06Ow2sU9gSJMf3RjCX2blEVge0c=; b=mZnCCzrO/VfybfBI1AlJt8Wi9mytlNE8Im2Q0esO2UBVQcVOQC6JJap3xnMs8rVxVI KIaFvftuiKIk4+inI+rLuZ6DIi5PGfm9UR232WHaxPxc1vCdeu6+Q2BMfi80ZeIWSsuj dxa8rIBWR3LFBfs/OV7oEJ1DDGykdobGtzDoo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=hvLgrYoskshIJH+PnG9x2EHmON8r4sGeOlgVh/H8Z8XVVL4SpvamtZHcfCDdVkbsx4 1HIkGr2rbe3RW1yHCR9suAu0RAfmNU1Nns4WLogWi/3Od4NxeKW9Ebr5fndbX7O9dhf0 NWyHjARow1N/6s2pBiJIgs4AoujLYlBz0OOqY= MIME-Version: 1.0 Received: by 10.220.184.74 with SMTP id cj10mr2061851vcb.47.1285613018002; Mon, 27 Sep 2010 11:43:38 -0700 (PDT) Sender: artemb@gmail.com Received: by 10.220.176.77 with HTTP; Mon, 27 Sep 2010 11:43:37 -0700 (PDT) In-Reply-To: <4CA07AF3.1040403@gmail.com> References: <4CA0436E.2080005@gmail.com> <4CA07AF3.1040403@gmail.com> Date: Mon, 27 Sep 2010 11:43:37 -0700 X-Google-Sender-Auth: GWwIjUYwwITk2jOs-2MUlF9rndA Message-ID: From: Artem Belevich To: =?ISO-8859-7?Q?Vladimir_=27=F6=2Dcoder=2Fphcoder=27_Serbinenko?= Content-Type: text/plain; charset=ISO-8859-7 Content-Transfer-Encoding: quoted-printable Cc: freebsd-mips@freebsd.org Subject: Re: [PATCH] [yeeloong] Kernel support for non-4K pages 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: Mon, 27 Sep 2010 19:11:36 -0000 Some time back FFS filesystem on FreeBSD had an issue when block size was smaller than page size. It was present circa FreeBSD-6. I'm not sure if the issue got fixed or not since then. It may be worth checking. Here's a rough outline of a test case my colleague Patrick Kerharo used to demonstrate an issue with 64K pages and 8K block size. The idea would apply to 16K pages as well if you use filesystem with 4K block size. fd =3D open("a_file"); /* Creates a file to be later mapped. */ unlink(fd); /* Use the file just for this program. */ ftruncate(fd,32k); / * Make the file size 32k, this creates an incomplete 64k page in the buffer cache, with nothing in the first 24k, then 8k of zeros, then nothing in the last 32k. The inode of the file points to the thrird block of data, there is no block #0, #1, #2. */ mmap(fd,n*64k); /* After that read anywhere in the first 64k and vm_fault() fails, because it does not handle faults in pages with a missing beginning. The assumption made by the vnode pager is that it has a block for this page if and only if it has the first block for the page. */ --Artem 2010/9/27 Vladimir '=F6-coder/phcoder' Serbinenko : > On 09/27/2010 09:10 AM, Vladimir '=F6-coder/phcoder' Serbinenko wrote: >> Loongson CPUs have an annoying VIPT cache and 14 bits of virtual address >> are used for tagging. So either we need an excessive and difficult to >> maintain cache flushing or to use 16K or biger pages. Note than when >> configuring Linux on Yeeloong only page size of 16K and 64K are proposed= . >> This patch fixes bunch of hardcoding of page size related constants and >> changes PAGE_SHIFT to 14 on Yeeloong. >> >> > > > -- > Regards > Vladimir '=F6-coder/phcoder' Serbinenko > > > _______________________________________________ > freebsd-mips@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-mips > To unsubscribe, send any mail to "freebsd-mips-unsubscribe@freebsd.org" > >