/srv/irclogs.ubuntu.com/2009/01/05/#upstart.txt

sadmacKeybuk: good morning10:19
Keybukmorning10:19
Keybukhappy new year10:19
sadmacKeybuk: you too10:20
sadmacKeybuk: just pushed events-related code to my state machine prototype10:21
sadmacKeybuk: so what's up with that secret kernel patch? :)10:21
ion_I want to know, too10:23
KeybukI posted it to lkml already10:24
Keybukhttp://lkml.org/lkml/2008/12/27/8010:24
Keybuk(patch is in my in-reply-to message)10:25
sadmacKeybuk: ah. I misthunderbirded10:29
Keybukmisthunderbirded?10:29
Keybukv. to use the wrong mail client10:30
Keybuk? :p10:30
sadmacprobably the case10:30
* Keybuk likes the fact the objections to that patch all come from @redhat.com :p10:30
sadmacKeybuk: well it is lkml :P10:30
Keybukas I keep pointing out, if we do so well, you guys give up - we're *screwed*! :p10:31
sadmacheh.10:31
sadmacKeybuk: well, now that I've implemented large chunks of the state machine, I've found it to be even less quirky and more simple than I thought.10:34
sadmacI've been able to nudge out a lot of the semi-strange behavior.10:34
Keybukyou've been working during the break, haven't you? :p10:38
Keybukthat's naughty10:38
sadmacKeybuk: well, I became almost totally noctournal. Nobody's around to party with between 3 and 7am10:39
Keybukodd10:39
KeybukI returned to something like normal UK waking hours10:39
sadmacheh10:40
sorenKeybuk: I'm looking at that patch, and can't help but wonder if there's a mechanism for reparenting a process to a different process than pid 1?10:45
sadmacsoren: check the clone() manpage. I almost want to say I saw something like that in there10:45
sadmacI might be thinking of the option to signal the parent with something other than sigchld though10:46
sadmacthe most fun part of my waitfd patch: read returns ECHILD10:47
sadmactook a bit to convince myself that was legal10:47
sorenKeybuk: I understand that if it only works for init, the code would just never be triggered if another process has done the PR_SET_ADOPTSIG thing, and that there's no particular reason to hardcode anything like that, but still it left me wondering.10:47
Keybukit's the same mechanism10:47
Keybukthat's why the 1 isn't hardcoded, but uses a child_reaper variable10:47
Keybukyou'd generally not use SIGCHLD for that notification, since they're not queued10:48
Keybukyou'd use SIGRTMIN+n10:48
sorenI don't think I get it. How can a process other than init adopt a process?10:52
* sadmac wonders what happens if you clone with CLONE_PARENT from init...10:54
Keybuksoren: you're forgetting that in Linux, threads are just processes :p11:50
Keybukso when a thread parent dies, it's reparented to another thread in the same group, not init11:50
Keybuksadmac: init's ppid is 1, so nothing - you get a child of init11:51
sadmacKeybuk: I was goig to mention that, but I think he wanted to know if there was a way to explicitly set where a child will be reparented11:51
sadmacKeybuk: ah11:51
sadmacKeybuk: what about unices like (I think) HPUX that display a system_idle process with pid 011:52
sadmacdoes that not appear as the parent of anything?11:52
Keybukdoes HPUX even have clone() ? :p11:53
sadmacnobody has clone11:53
sadmacthat's just us11:53
Keybukso who cares? :p11:53
sadmacsomeone at HP I'd imagine11:53
KeybukUpstart doesn't work on HPUX, so EOFFTOPIC :p11:54
sadmacLinux also has a system idle process of a kind I believe, but it doesn't appear in ps.11:54
sadmacit may not be a "process" of any real sort.11:54
Keybukactually, I'm lying11:55
Keybukinit has a ppid of 011:55
sadmacah. thought so11:55
sadmacgraphs with loops feels very un-unix11:55
KeybukLinux has kernel threads, they are all children of kthreadd11:55
Keybukwhich is pid=2, ppid=011:55
sadmacah11:57
Keybukwe looked12:00
Keybuksummary12:00
Keybuk"Don't do that then"12:00
Keybukit'd be ok until the clone exited, at which point you'd maybe get an OOPS or a PANIC :)12:00
sadmacadd that to the list of "things to make an intern patch when you're bored"12:01
sadmacyeah, I could see that reading as an init crash12:02
sadmacThere's something kind of sad about all of APL being in unicode12:06
sadmacnot quite as sad as the klingon alphabet, but still...12:06
KeybukAPL?12:08
sadmacKeybuk: "A Programming Language"12:09
Keybukwhat's wrong with unicode?12:09
sadmacKeybuk: there's nothing wrong with unicode per se12:09
sadmacKeybuk: APL has no textual commands12:09
sadmacKeybuk: its all symbols. some greek ones, some not even in any alphabet12:10
Keybukah, how silly12:10
sadmacKeybuk: its the esoteric programming language that saw production time12:10
sadmacEnterprise Brainfuck12:10
sadmacKeybuk: it was reeeeely good at matrix operations, which was good for getting certain tasks done in a hurry.12:11
sadmachttp://en.wikipedia.org/wiki/File:LifeInApl.gif12:11
sadmac^^conway's game of life12:11
Keybukdoes it use the Unicode Interrobang character as an exception operator?12:11
sadmacdunno. It predates unicode by about 30 years, so it wouldn't have drawn the inspiration from there12:12
Keybukn < 2 → ⁈12:13
ion_That’s not an interrobang.12:13
sadmacN is less than 2 implies WTF12:13
Keybuk1 + 1 ≠ 2 → ‼12:13
Keybukion_: yes it is?12:13
ion_12:14
sadmac12:14
sadmacwhere is your god now?12:14
Keybukah, right12:14
Keybukwe can use utf-8 in C now, right ?12:15
ion_What i still don’t know is why Unicode has white smiling and frowning face, but only a black smiling face.12:15
ion_faces12:15
sadmacion_: I blogged on this once12:15
ion_Oh12:16
sadmacion_: http://screwyouenterpriseedition.blogspot.com/2008/02/worst-of-unicode.html12:16
ion_Yeah, just found it with google.12:17
Keybukmost of Unicode's symbol characters are inherited from other standard sets12:17
KeybukI mean12:18
Keybukyou're talking about a character set that has an entire code block reserved for "Byzantine Musical Symbols" and you're complaining about its smiley faces12:19
sadmacKeybuk: I believe I did mention the klingon alphabet earlier12:19
sadmacKeybuk: and there are musical instrument companies open today that were around during the byzantine empire12:19
sadmac(World's oldest corporation: Zildjian)12:20
KeybukUnicode doesn't have space for Klingon12:21
Keybukthat's nowhere near the oldest company!12:22
Keybukthere are European breweries older than that! :p12:23
sadmac2Keybuk: when does fork return EBUSY?12:39
sadmac2or whatever equates to Resource temporarily unavailable12:39
Keybukmemory limits, process limits, etc.12:40
sadmac2hmm12:41
sadmac2left my workstation running over the break12:41
sadmac2and my login session appears to be unwell12:42
sadmac2heh, the whole python state machine is 390 lines12:46
sadmac2I have a real desk now!14:29
sadmac2Keybuk: what do you think the interface for waitfd should look like?14:31
Keybukwaitfd(flags)14:33
Keybukgives you an fd14:33
Keybukyou read() something like siginfo_t with all the expanded status information14:33
sadmac2Keybuk: its more the list of pids to wait on that concerns me14:34
Keybukhow do you mean?14:35
sadmac2Keybuk: do you always want to wait on /all/ children with waitfd, or do you want some of the selection power that you have with waitpid&co14:36
sadmac2Keybuk: and if so, what replaces the wait on just one process mechanic? it doesn't make much sense for this case14:36
sadmac2but waiting on a few specific ones might14:36
KeybukI figured you'd  use something like the waitid() syntax14:37
Keybukwaitfd (P_PID, pid, 0)14:37
Keybukwaitfd (P_ALL, 0, WEXITED | WSTOPPED)14:38
Keybuktype thing14:38
Keybukbut then I'm about the only person in the world who even knows about waitid() :p14:38
sadmac2Keybuk: yes, but say I want to wait on pid 3, 4, and 7, but not 5,6,whatever else14:38
Keybukfd = waitfd (-1, P_PID, 6, WEXITED);14:41
Keybukerr14:41
Keybukfd = waitfd (-1, P_PID, 3, WEXITED);14:41
Keybukwaitfd (fd, P_PID, 4, WEXITED);14:41
Keybukwaitfd (fd, P_PID, 7, WEXITED);14:41
Keybuk?14:41
Keybuksignalfd-style?14:41
sadmac2Keybuk: if that's ok with everyone14:41
sadmac2Keybuk: right now it has waitpid's signature14:42
KeybukI don't really like the whole "read an int and figure it out" type approach14:43
Keybukthat int is squashed from a siginfo_t-style struct in the first place14:43
Keybukwhy not just read that struct?14:43
sadmac2Keybuk: I didn't use waitid because it doesn't return a different status if it errors out due to WNOHANG, so you have to zero the return struct and then test14:44
sadmac2Keybuk: and I need to check this from /inside/ the kernel in places.14:44
sadmac2Keybuk: but I think all of this was in the name of not having to add crap to exit.c, and I think I've had to do that already anyway14:44
sadmac2there goes my laptop14:46
sadmac2IRC > Nagios14:46
Keybuksadmac2: err, isn't the point that read() returns you that status now ? :P14:48
sadmac2Keybuk: poll() was the issue14:48
Keybukyou don't *have* a WNOHANG flag with waitfd14:48
Keybukinstead you make the socket blocking/non-blocking14:48
Keybukand read() returns EAGAIN14:48
sadmac2Keybuk: I use WNOHANG for poll14:48
Keybukwhy?14:49
sadmac2Keybuk: check if something exited with WNOHANG+WNOWAIT. If it didn't, poll_wait, if it did, return14:49
Keybukoh, I see14:52
sadmac2Keybuk: you do have a WNOHANG flag with waitfd15:10
sadmac2Keybuk: WNOHANG == O_NONBLOCK15:10
sadmac2I've allowed it, and its cheap enough that I'm going to keep on allowing it15:11

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!