From owner-svn-src-user@FreeBSD.ORG Mon May 13 18:59:52 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A2AD8442; Mon, 13 May 2013 18:59:52 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-ie0-x230.google.com (mail-ie0-x230.google.com [IPv6:2607:f8b0:4001:c03::230]) by mx1.freebsd.org (Postfix) with ESMTP id 65B8D232; Mon, 13 May 2013 18:59:52 +0000 (UTC) Received: by mail-ie0-f176.google.com with SMTP id at1so13074058iec.35 for ; Mon, 13 May 2013 11:59:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:reply-to:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=qvF4867KEQZU7ZxdzCrXe7mT2fgq/XYSQXcv96ZmcbQ=; b=T+coiggH9NfP0oN/xEScwTQb+nsPkNEEJvIPeE8y/YsHwGjweFZiRoQsIAnuAzzmCd xWkc+HbYC1jh120eXHLxUBGKih3mN55CebfydlyKUuUe2baNWzAl6bkzIoaBdIkPFzeM V6BOHseHG9k63DKyuMzcYdyreVRt14+Q2VykO+8G7/NT2ZmTXpHMv8qRcUbCZeDUJtlE qUYbnok1tb2wV4l6VXTTbNqKKSVOKSEAoc/UT/V6Lr9vMKi1+kdYbDBwNPd4Oc+pF3Up wvdEh/wjURV/sUL8BFQXFSL+7oeSursi2a21BwRo+qcezNokNuHiUk8UZTOcp0i1LLbJ oLHg== MIME-Version: 1.0 X-Received: by 10.50.41.66 with SMTP id d2mr2642797igl.100.1368471592179; Mon, 13 May 2013 11:59:52 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.42.117.134 with HTTP; Mon, 13 May 2013 11:59:52 -0700 (PDT) In-Reply-To: <519134BB.5030400@FreeBSD.org> References: <201305120153.r4C1r3DN071206@svn.freebsd.org> <51912816.1020603@FreeBSD.org> <519134BB.5030400@FreeBSD.org> Date: Mon, 13 May 2013 20:59:52 +0200 X-Google-Sender-Auth: KYbBU0zh8HL_LKa_2C_5IADHi-s Message-ID: Subject: Re: svn commit: r250543 - user/attilio/jeff-numa/sys/vm From: Attilio Rao To: John Baldwin Content-Type: text/plain; charset=UTF-8 Cc: src-committers@freebsd.org, svn-src-user@freebsd.org X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: attilio@FreeBSD.org List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 May 2013 18:59:52 -0000 On Mon, May 13, 2013 at 8:45 PM, John Baldwin wrote: > On 5/13/13 2:23 PM, Attilio Rao wrote: >> On Mon, May 13, 2013 at 7:51 PM, John Baldwin wrote: >>> On 5/11/13 9:53 PM, Attilio Rao wrote: >>>> Author: attilio >>>> Date: Sun May 12 01:53:03 2013 >>>> New Revision: 250543 >>>> URL: http://svnweb.freebsd.org/changeset/base/250543 >>>> >>>> Log: >>>> Scan all the domains when trying to allocate from freepages. >>>> Some domains may be empty but others may still have some available pages >>>> satisfying the allocations. >>> >>> It seems like you have nested loops here so you are doing N^2 scans >>> rather than N? >> >> If you want to say so. In most cases N=2 and M=4. However also >> consider the less overhead caming from all the adjustement of the >> flind because of now split DOMAINS-NFREELISTS concepts. > > *sigh* > > No. Read the code. I wrote the code so I certainly read it. > vm_phys_alloc_pages() does 'for i = 0; i < > vm_ndomains; i++' around calls to vm_phys_alloc_pages_domain() which > internally has its _own_ 'for i = 0; i < vm_ndomains; i++'. Same with > vm_phys_alloc_freelist_pages(). You don't need it in both places. It is not true. vm_phys_alloc_domain_pages() (if this is what you are speaking about) doesn't have internally i < vm_ndomains. > Also, vm_phys_alloc_pages() should now be able to just call > vm_phys_alloc_freelist_pages() and just be a simple loop that only > iterates on flind as it used to do before all the NUMA changes. I don't mind either way. This means I should do a version that accepts domain for vm_phys_alloc_freelist_pages(). I just thought this version is smaller. Attilio -- Peace can only be achieved by understanding - A. Einstein