From owner-freebsd-hackers@FreeBSD.ORG Fri Apr 10 21:45:37 2015 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EA9F2794 for ; Fri, 10 Apr 2015 21:45:37 +0000 (UTC) Received: from mail-ie0-x232.google.com (mail-ie0-x232.google.com [IPv6:2607:f8b0:4001:c03::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 B158FBFF for ; Fri, 10 Apr 2015 21:45:37 +0000 (UTC) Received: by iejt8 with SMTP id t8so27879997iej.2 for ; Fri, 10 Apr 2015 14:45:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type; bh=LqlRVIO5On0+hl511n9R5jiLatbtoP8EblTa53LjKqk=; b=SUA0I49yODVtB0E5zec/kunR0NwD/b7zPE27wNs6CJkrqaFO7K7rgZwsmG3Wkg2ZCA 2+A/wG9/9FoBD4ldBKJC+S/yUMIoN4Kk0Tv9/zabti/LR8DhbFNqz/SErHBfOjmdNHS+ 6duEtHaN/hbDStK18MTsdJoNXB8hb9N6x7Mst6g5enOize3MaBiea07jT7lZB7it+ZHC nhAOtPGzXeYOn3f0aaJvFiOCcTrHMXMe24A/YnpwZi7y1h1KNUhyEBngXsTUoipZoRk8 ggJNHFh1Ds3JLiyIInIxXwl6K5G+C3C8+B3LwnkxXm5Fdmt71TFi0X05G2z8Sy8H2IqI eIew== X-Received: by 10.42.171.8 with SMTP id h8mr6275293icz.25.1428702336837; Fri, 10 Apr 2015 14:45:36 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.131.194 with HTTP; Fri, 10 Apr 2015 14:45:16 -0700 (PDT) From: Alex Merritt Date: Fri, 10 Apr 2015 17:45:16 -0400 Message-ID: Subject: Page Coloring Manipulation To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Apr 2015 21:45:38 -0000 Hello hackers, I am interested in playing with the page-coloring support within the virtual memory subsystem. Specifically: i. Methods to specify the number of colors a task receives ii. Methods to change the quantity of colors at runtime iii. Understand what areas of memory coloring governs, e.g., just task data/instructions, file-backed/anon, or even task page-table entries created by the kernel? Great if there are user-level methods, but not necessary. Does the kernel determine these values automatically? Is it disabled by default or always exercised? Here is what I found thus far -- // during page fault, in vm_fault_hold() #if VM_NRESERVLEVEL > 0 if ((fs.object->flags & OBJ_COLORED) == 0) { fs.object->flags |= OBJ_COLORED; fs.object->pg_color = atop(vaddr) - fs.pindex; } #endif // and in vm_object_init #if VM_NRESERVLEVEL > 0 kernel_object->flags |= OBJ_COLORED; kernel_object->pg_color = (u_short)atop(VM_MIN_KERNEL_ADDRESS); #endif So it seems an object must be explicitly marked as "colorable", which is true always? Please help me interpret. I am new to FreeBSD hacking ;) and appreciate any pointers for me to study further. Thanks, Alex