From owner-freebsd-mips@FreeBSD.ORG Wed May 26 10:07:32 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 44EA6106566C for ; Wed, 26 May 2010 10:07:32 +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 173588FC19 for ; Wed, 26 May 2010 10:07:31 +0000 (UTC) Received: by pzk13 with SMTP id 13so4802040pzk.13 for ; Wed, 26 May 2010 03:07:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=APxhQS8u9fNfAxQ7t/kXQ0bDtIobP0dtc0vfYtyKEn8=; b=VXqkYiVrE4PsnmiXuDIq/ci+jzFSJMhqFZv9pRQA6AvtlBhoQ5SlHILX1yooClKO/m FtW0vwoHyeKgTzJc9eBx2xlb7OJ06dXwz7ah/2XFREdr6cuV+kUIDrTppDlLF78WQlaU BPK31e75Kh2rcxdhmemOu2Pz82TzrQZQLr4Fg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=IyMO9uSFEvT8CQc3x5LOgsmm9ZBBMm6etaQMt+rTklxPUuqpuXslUHLR9Vjfinpau2 Kh6GQ0fRtMyKEBAc5GTU2aONr1Yhgz3rSJ8j+51UT3mx9QR4foo6egg8JV3ScNqKUxBn 0b67tkVYAT7YR5kGcbugT61dJ1jogHRACTh0w= MIME-Version: 1.0 Received: by 10.140.248.20 with SMTP id v20mr6435747rvh.235.1274868451532; Wed, 26 May 2010 03:07:31 -0700 (PDT) Received: by 10.141.32.4 with HTTP; Wed, 26 May 2010 03:07:31 -0700 (PDT) In-Reply-To: <20100526122719.5f163434.ray@dlink.ua> References: <20100526122719.5f163434.ray@dlink.ua> Date: Wed, 26 May 2010 15:37:31 +0530 Message-ID: From: "C. Jayachandran" To: Alexandr Rybalko Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-mips@freebsd.org Subject: Re: 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: Wed, 26 May 2010 10:07:32 -0000 On Wed, May 26, 2010 at 2:57 PM, Alexandr Rybalko wrote: > Hi, > > On Wed, 26 May 2010 10:33:58 +0530 > "C. Jayachandran" wrote: > >>> The attached patch (also at >>> http://people.freebsd.org/~jchandra/for-review/pmap-alloc-page-fix.diff= ) >>> has two fixes for the new pagetable page allocation code, one to >>> handle NULL return from the allocating function, and another to call >>> VM_WAIT in cases we can wait. It also removes the variable 'req' left >>> over from an earlier change. >>> >>> Please let me know if you have any comments... >>> >>> JC. > >>> + =A0 =A0for (;;) { >>> + =A0 =A0 =A0 =A0 =A0 =A0m =3D vm_phys_alloc_contig(1, 0, MIPS_KSEG0_LA= RGEST_PHYS, >>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0PAGE_SIZE, PAGE_SIZE); >>> + =A0 =A0 =A0 =A0 =A0 =A0if (m !=3D NULL) >>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0break; >>> + =A0 =A0 =A0 =A0 =A0 =A0if ((wait & M_WAITOK) =3D=3D 0) >>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return (NULL); >>> + =A0 =A0 =A0 =A0 =A0 =A0VM_WAIT; >>> + =A0 =A0} > > So under low memory, subsystem will blocked forever if set M_WAITOK? > I don`t think is good idea. This seems to be standard pattern followed for VM_WAIT usage, I had checked a few other architectures for the usage. Unfortunately, I don't have the sufficient background in FreeBSD VM to say why it is so. JC.