Skip to content

Instantly share code, notes, and snippets.

@thesjg
thesjg / renice-Makefile.patch
Created December 29, 2010 11:31
renice -a patchset
--- Makefile-old Sat Apr 26 00:33:36 2003
+++ Makefile Sat Apr 26 00:32:27 2003
@@ -3,5 +3,7 @@
PROG= renice
MAN= renice.8
+DPADD= ${LIBKVM}
+LDADD= -lkvm
.include <bsd.prog.mk
@thesjg
thesjg / tag_magic.txt
Created December 29, 2010 11:13
Tag Magic
tags
id
tag
On update of tag create synonym
synonyms
tag_id
synonym
unique(tag_id, synonym)
@thesjg
thesjg / gist:791721
Created January 23, 2011 01:38
Software, Dragonflies and Reciprocal Altruism
Samuel J. Greear
15 March 2010
Many of the best ideas and implementations of those ideas in the realm of
computing come about when a single individual decides to sit down and create
something. It may be a new feature or entire system, or perhaps a new take on an
old idea. Perhaps popularized by Eric S. Raymond, in software engineering
parlance this is sometimes referred to as “scratching an itch” (Raymond, pars.
6-8). DragonFly BSD is a liberally licensed Unix-like operating system
@thesjg
thesjg / gist:846391
Created February 27, 2011 18:23
GSoC 2010 VFS Proposal
Title: VFS Quota's
Student: Samuel Greear
Abstract: Implement filesystem-agnostic kernel quota support and tools.
Content:
Name: Samuel J. Greear
Email: sjg@thesjg.com
Project title: VFS Quota's
Project goals and description:
@thesjg
thesjg / gist:846711
Created February 27, 2011 23:54
GSoC 2010 kevent proposal
Title: Coalesce + MPSAFE kevent, select, poll and wakeup
Student: Samuel Greear
Abstract: This project aims to apply DragonFly BSD design ideals to several related key kernel subsystems in an attempt to improve kernel performance, scalability and maintainability.
Content:
Name: Samuel J. Greear
Email: sjg@thesjg.com
Project title: Coalesce + MPSAFE kevent, select, poll and wakeup
[21:27] <@dillon> the current implementation is pretty bad, though it is using VOP_READ so there should be read-ahead by virtue of it going through the filesystem
[21:27] <@vsrinivas> also its mplocked.
[21:28] <@vsrinivas> actually looks not; just around the fd work.
[21:28] <@thesjg> so feel free to drop all your insight on me and i'll make note of it
[21:28] <@thesjg> but i'm not prepared to do it quite yet
[21:28] <@dillon> it shouldn't need that mplock since its holding the fp
[21:29] <@vsrinivas> ummm -- in the core loop it ssb_lock()s;
[21:29] <@vsrinivas> tcp output needs the ssb lock also iirc to read from that queue.
[21:29] <@dillon> w/ regards to the rest I think it can pass a larger value in the ioflags it passes to VOP_READ ... figure out what the maximum sequential heuristic value is there and pass that
[21:29] <@dillon> (in the upper 16 bits. See line 1694)
<thesjg!~sjgirc@67-54-133-153.cust.wildblue.net> [03:10] i think we should commit an optimization for that phoronix threaded i/o tester
<thesjg!~sjgirc@67-54-133-153.cust.wildblue.net> [03:10] that just ignores about 80% of the i/o's
<thesjg!~sjgirc@67-54-133-153.cust.wildblue.net> [03:10] :-)
<dillon!~dillon@leaf.dragonflybsd.org> [03:11] we could certainly optimize buffers containing all-zeros (if we don't already). heh
<thesjg!~sjgirc@67-54-133-153.cust.wildblue.net> [03:11] that might be useful
<thesjg!~sjgirc@67-54-133-153.cust.wildblue.net> [03:11] they are probably all zero's
<thesjg!~sjgirc@67-54-133-153.cust.wildblue.net> [03:11] i looked at what it did
<thesjg!~sjgirc@67-54-133-153.cust.wildblue.net> [03:11] it just allocated a chunk ala malloc() and then wrote that allocated buffers contents to a file
<thesjg!~sjgirc@67-54-133-153.cust.wildblue.net> [03:12] it never touched the buffer
<thesjg!~sjgirc@67-54-133-153.cust.wildblue.net> [03:13] how do you know if its all zero's, in an efficient fashion
KEVENT SUBSYSTEM REFACTOR DESIGN DOCUMENT
/*
* Drivers and etc. will only expose an event filter now, instead of
* attach/detach/event filters. One filter function each is exposed for read,
* write, except, etc (instead of 3 each).
*
* A new kq api will be exposed for drivers to hook themselves into kq at
* initialization time, they will provide flags (such as whether they are mpsafe
* or not), some opaque private data (a hook) and a function pointer. The driver
@thesjg
thesjg / SOC11DEVAPI1.txt
Created June 3, 2011 23:24
Basic kevent device API
/*
* Used to maintain information about processes that wish to be
* notified when I/O becomes possible.
*/
struct kev_filter {
struct kev_filter_entry_list kf_entry;
struct kev_filter_ops kf_ops;
caddr_t fo_hook;
};
/*
* Needs a tile layer, something like (for Leaflet) ..
*
* var tl = L.tileLayer("content://com.pahasapatrails.m.tiles/{style}/{z}/{x}/{y}.png",
* { style: "XXX", minZoom: 9, maxZoom: 13, tms: true });
* map.addLayer(tl);
*
*
* Also needs a provider entry under the application tag in the Android
* Manifest, something like the following ..