From owner-freebsd-hackers@freebsd.org Mon Oct 12 22:43:50 2015 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81318A11F29 for ; Mon, 12 Oct 2015 22:43:50 +0000 (UTC) (envelope-from alan.l.cox@gmail.com) Received: from mail-yk0-x232.google.com (mail-yk0-x232.google.com [IPv6:2607:f8b0:4002:c07::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 426011BF8 for ; Mon, 12 Oct 2015 22:43:50 +0000 (UTC) (envelope-from alan.l.cox@gmail.com) Received: by ykec126 with SMTP id c126so323063yke.2 for ; Mon, 12 Oct 2015 15:43:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=E+Iy/Zs5wZkYFeSFyOOoSZs9S8mA2JI7qaUdRunSIPU=; b=En4eTPFH9p+TXjT3trRrpdQUYX1+fuCrMwPAfkVbiZx3JZN1ZJdpmU4MtgxHLQnDJ8 h7tiYViZyCdUovDJpTOQJ/cE1g+PYH+KOYmuNBlEfkMCj9oVyE0WzCGCtfaQiy9P7bmo UqIHX6ygw8Q/hQImuGK5N/9W3DyufDybcq86JatTm1kwqgeHDf5KcSkBP90gsfW5pyw3 pMmVo/OtkjIhz0POg3p2q29BHA972W2sz42oNfn/mmBlyCHQk+H28HOMPKIPXIepP3mv 9++DWFCeqNgES8zqSrEzNP3DbTABRILuPyVl7UMCw0Er6fb9km40pYy9aeDAomCb5rkc WVyA== MIME-Version: 1.0 X-Received: by 10.129.99.139 with SMTP id x133mr24477438ywb.66.1444689829351; Mon, 12 Oct 2015 15:43:49 -0700 (PDT) Received: by 10.37.105.215 with HTTP; Mon, 12 Oct 2015 15:43:49 -0700 (PDT) Reply-To: alc@freebsd.org In-Reply-To: References: Date: Mon, 12 Oct 2015 17:43:49 -0500 Message-ID: Subject: Re: kernel pages superpage promotion/demotion From: Alan Cox To: suresh gumpula Cc: "freebsd-hackers@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Oct 2015 22:43:50 -0000 On Mon, Oct 12, 2015 at 3:11 PM, suresh gumpula wrote: > Hi, > I understand that user space VM map pages dynamically > promoted/demoted to super page > if the kernel thinks that it gains the performance. > The question is , does this apply to kernel map pages too ? > > Yes, it applies to memory allocated for UMA zones, malloc(9), and contigmalloc(9). > And is it possible to write protect kernel address space VA with > pmap_protect(9). Since the protection is per 4k page, I see this > routine tries to demote to 4k page. > Or this is only for user space maps to support mprotect(2) and gdb > watchpoints. > Do we have any other API to write protect kernel addresses which come from > UMA zone allocations ? > > No. Can you please try to describe what are you trying to do at a higher level?