/srv/irclogs.ubuntu.com/2016/07/14/#ubuntu-kernel.txt

memguyi don't understand one thing if udev creates/destroys the mknod device file and loads/unloads the LKM for new devices . The what links the LKM to the device file when one does say cat  something > /dev/xxx  02:39
memguyFrom what know the LKM has to register the /dev devices and provide the structure like cdev methods read,ioctl,write,..etc02:40
memguySo udev may create the device files and load the LKM but it would be in the LKM that the linking of the device file would be. If there is no LKM code for the device file then it is useless only  useful for user defined stuff but not like to any system char or block device02:42
memguyand when bash executes the code like cat something > /dev/xxx ... it must translate into a execv syscall or something which then  some how reaches the LKM code that is my issue the bash to the LKM and back for device files ... haven't got real into it yet but if anybody know let me know. My first thing is using debuggers or strace utility 02:44
memguyright now i just don't see how the cat /dev/sda gets link to say the LKM for the ata hdd driver code. Get it translates to execv command but from there not sure at some level it must call a read function that some how calls the LKM03:02
mjg59The driver registers a major and minor number, and the kernel dispatches the access to the driver03:03
memguyits the &fops in the register_chrdev for example that will control what read function is called for a device file but how does the actual read() user level function get to that03:10
memguyLKM03:10
mjg59The kernel dispatches it to whatever registered that major and minor number03:10
memguyread( fd , , ) takes a file descriptor number so how does that call get to the correct LKM03:12
memguyafter its at the LKM then i get from the fops will call the correct read function for the device file.03:12
memguyplus the file descriptor doesn't even have to corrospond to a /dev/xxx file in the first place so i am assuming the userland code has tons of checks on what type of file descriptor this corrosponds to. And if it is  a /dev/xxx file it dispatches it to some syscall to dispatch it to the correct LKM code ... this is my guess mjp59 if you know more then by all means 03:15
mjg59The kernel dispatches it to whatever registered that major and minor number03:17
mjg59I don't really know how else to explain it03:17
mjg59The kernel knows that the file descriptor refers to a device node03:17
mjg59It knows the major and minor numbers of that device node03:17
mjg59It knows what registered those numbers03:17
mjg59And so it calls that code03:17
mjg59Userland doesn't need to do anything special03:18
memguyso read converts or looks up if the file descriptor fd has a major and minor number  from inode or filesystem info then how does userland know about the registered device thought only kernel level knows about that03:21
memguyit would have to syscall with a major and minor number or something03:21
mjg59Userland doesn't need to care03:21
memguyfor the read function at some level03:22
mjg59The kernel created the file descriptor03:22
mjg59It knows what it refers to03:22
memguyO so the open () function requests this int fd  from kernel  not at userspace when opening a file it fd is created in the kernel03:24
memguynever mind kind of stupid should have thought thanks for clearing that up03:25
memguyso then it is always in the LKM or built into the kernel the code for linking a device file with the read, writting, ioctl ,...etc . And all udev is doing is mknod and insmod LKM plug in play wises03:27
memguyBut it is the LKM that gives the device file life03:27
memguyclass_create ,device_create ,register_chrdev and from these the kernel can associate the fd , major/minor , and  LKM methods to call03:44
=== hypera1r is now known as hyperair
MoPacHello. I'm trying to understand more about (kernel-level?) control of CPU freq in this era of intel_pstate. My CPUs keep (at random-ish intervals) getting stuck at 800MHz until I suspend/resume or restart. But there's nothing obvious happening in kern.log/syslog/dmesg/thermald, and the governor's available frequencies always show the correct range (unlike old issues Googling shows).04:07
MoPacAm I even correct in thinking this is a kernel issue?04:07
MoPac(It's 16.04 /i7-4510U)04:09
apwNoPac (N,BFTL), that is cirtainly non-trivial to determine08:00
Evlbhey09:38
Evlbany1 here a tomoyo ninja?09:38
apwEvlb, always best to just ask your question, we might know, we might not09:43
EvlbIn my case, i need to be able to disable tomoyo to be able to install updates, how ever, down-time is not feasible in this project.. So the question really is how to be able to install new software/updates without restarting the hardware? I am not able to install updates as of now due to Tomoyo09:46
Amine_Hello all, I am running a Linux kernel version 3.14.32 under a remote Ubuntu 14.04 LTS linux machine. After a recent upgrade and a reboot the machine refused to boot and freeze at some point. I was able to reboot the machine in system rescue and also read the content of /var/log/dmesg to see what happened.13:31
Amine_here is the dump of dmesg http://codepad.org/llFGvb6213:31
Amine_can anyone help me please to interpret what's going on ?13:32
=== fg__ is now known as fg_
apwAmine_, that pastebin doesn't look to be a dump from the failure that looks to be a failsafe boot14:42
apwAmine_, is this a grsecurity kernel ?14:42
Amine_apw, hmmm 14:48
Amine_apw, are you sure ?14:48
apwinit: failsafe main process (1130) killed by TERM signal14:48
Amine_I am a true newbie where can I found such logs please ?14:48
apwlogs for a previous boot are normally in syslog14:49
Amine_apw, hmm ok14:52
apwassuming of course they got there before the machine imploded beyond begin able to write14:52
Amine_but I just monted a var partition where the logs has been recorded so I don't see if it concerns the mode rescue 14:52
Amine_the current dmesg that I dumped was here14:53
Amine_ /mnt/var/log/dmesg14:54
Amine_the dmesg of the current rescue mode is in /var/log/dmesg14:54
jtaylorhi perf is broken in xenial due to the binutils update :(14:54
jtaylorincludes the -31 in proposed14:54
jtaylorneeds a rebuild to pickup the new libbfd soname14:54
jtaylorapw: I think you handled that last time ^14:55
apwjtaylor, that might imply we need to promote the libbfd update to -security or something14:56
apwjtaylor, could you file me a bug so i can track it14:56
jtaylork14:56
apwjtaylor, and we might not be able to fix kernels already released either, hrm14:57
apwjtaylor, i assume you are saying if you downgrade binutils to the version in -security it starts working ?14:58
jtaylorapw: probably, the libbfd library changed named with the update14:59
jtaylor2.26 to 2.26.114:59
jtaylordon't know if that change really broke abi14:59
apwbah, really they should not be allowed to do that14:59
infinityErk.14:59
apwerk indeed14:59
infinityThat means a transition in xenial, other things depend on that too.14:59
infinityHow annoying.14:59
jtaylorif it did not updating binutils to add a compat symlink might work15:00
apwjtaylor, which was the first kernel you noticed this with15:00
jtaylorapw: 28, but it should be all where perf links with libbfd15:01
jtaylorwhich probably goes back to before xenial release15:01
jtaylordon'T remember when exactly we fixed this (the link is needed so perf can demangle c++)15:01
infinityDepends: binutils (>= 2.26), binutils (<< 2.27)15:03
infinitySo, that's a lie.15:03
infinityAnd it's binutils' fault.15:03
infinityThe fix belongs there, if it's still compatible.15:03
jtaylorso should I file a bug against binutils instead?15:04
apwjtaylor, that was prolly when we first compiled against that version of binutil15:07
infinityjtaylor: Yeah.  Either the SONAME shouldn't bump, or the shlibs need to change to (>= 2.26.1), (<< 2.26.2)15:07
infinityjtaylor: In the latter case, we need a transition in -updates for all the rdeps. :/15:07
jtaylorapw: when bug 1248289 was closed I think, so 4.4.0-24.4315:08
ubot5bug 1248289 in linux (Ubuntu Yakkety) "Missing libunwind support in perf" [Medium,Fix released] https://launchpad.net/bugs/124828915:08
infinityslangasek: ^-- FYI15:08
infinityIt's not just a perf issue anyway, there are several packages that depend on binutils for libbfd.15:09
infinityIIRC.15:09
apwjtaylor, ok15:15
apwinfinity, ok those deps come from ${misc:Depends} how are those calculated15:18
infinityapw: shlibs:Depends, from binutils' shlibs file.15:18
apwok so either way it is binutils... sigh15:19
infinityYeah, you've done nothing wrong here.15:20
infinityIt's all doko.15:20
infinityWho's on VAC for a week or two. :P15:20
apwinfinity, oh derp, thats helpful15:21
jtaylorI guess best option is to run the abi tool on libbfd and if its still compatible add a symlink15:21
jtaylorits probably reasonably likely this minor release did not break the abi15:21
jtaylorfwiw perf does not explode if you simply use the new soname ;)15:21
infinityABI tracking on binaries is an inexact science, mind you.15:22
apwinfinity, it does look from the way the shlibs is contructed that the lib name is not meant ot need to change for X.Y.Z Z++15:22
infinityThere's no way from the binary to know if a symbol is compatible, only if it was dropped or added.15:22
jtaylorinfinity: I mean this tool that looks at the source code15:22
infinityjtaylor: Yeah, the header mangling tools are more exact, to be sure.  Just a pain to use.15:22
infinityjtaylor: If you feel the urge, please do?15:23
* infinity is meant to be out today with a head-exploding cold, but was here for a meeting happening in parallel.15:23
slangasekinfinity: so the problem is we have a new bfd soname in 2.26.1, and a shlibs there which appears to be correct, but the previous binutils package declared a broader versioned dep which is no longer applicable?  Oh, and also this binutils was SRUed into xenial, brilliant15:24
infinityThe other "simple" way could just be to diff the header files manually and look for prototype changes.15:24
infinityThey could be identical.15:24
infinityslangasek: Is the new shlibs correct?15:24
slangasekinfinity: it's "correct" in that it matches the files in the new package15:24
slangasekI don't know if it's correct that the soname should have changed15:25
infinityOh, so it is.15:25
infinityslangasek: Right, I meant the former.15:25
infinitySo, that's been "fixed", but in fixing it, doko didn't consider it meant a transition.15:25
infinity\o/15:25
slangasekso we basically need rebuilds + a binutils with Breaks: added15:25
infinityAlternately, if they *are* compatible, we could fix it in a hurry with a symlink, then unwind the mess.15:26
slangasekyeah, I can look at that15:26
infinityapw: None of that should prevent promotion of your current kernel, nothing's more broken than it was before.15:27
apwinfinity, agreed15:27
apwslangasek, thanks15:28
apwjtaylor, would you file a bug if you haven't on binutils and let us know the number so we cna track this15:29
slangasekapw, infinity: there's a single symbol dropped between 2.26 and 2.26.1 libbfd, "_bfd_elf_strtab_restore_size", which looks like an internal symbol name that shouldn't impact ABI. and libopcodes has no changed symbols.  I can dig a little deeper to make sure none of the symbols have changed ABI, but it looks like a compat symlink is going to be the aswer15:36
slangasekjtaylor: ^^15:36
jtaylorapw: bug 160313715:36
ubot5bug 1603137 in binutils (Ubuntu) "libbfd changed name without transition" [Undecided,New] https://launchpad.net/bugs/160313715:36
apwslangasek, it does feel like we are switching to a stable branch which might explain the .1 suffix on the overall version15:37
infinityslangasek: In that case, changing the shlibs to (>= 2.26), (<< 2.26.2) along with the symlink addition would avoid the breaks-and-rebuild mess.15:37
jtaylorslangasek: grepping perf code it uses no symbol starting with _bfd15:37
jtaylorslangasek: only a small handful of bfd_ functions15:37
slangasekyes, _bfd is a strong indicator that this is an internal symbol that should be ignored for ABI15:38
apwinfinity, then we get the same problem with the next one ?15:38
slangasekapw: next one we stand at the entrance to the SRU queue with canes and make the SRUer get it right before it's accepted ;)15:38
infinityapw: Yeah, but at least we'll know, because the deps will be correct. :P15:38
slangasekright, someone know where I should look for binutils upstream VCS?15:39
slangaseksince debian/copyright points me at cvs://:pserver:anoncvs@sources.redhat.com:/cvs/src and I desperately want that to not be correct15:39
apwinfinity, right but if the intent was never to change the .so, then we _do_ have to rebuild everything with the tight restriction15:39
infinityslangasek: That symbol doesn't show in the headers, so I concur with your internal-only assessment.  Vaguely entertaining that the binutils maintainers don't know how to make private symbols hidden. :P15:39
infinityslangasek: https://sourceware.org/git/?p=binutils.git;a=summary15:40
infinityErr, no.15:40
infinityThat's dead.15:40
slangasekhttps://www.gnu.org/software/binutils/ says git://sourceware.org/git/binutils-gdb.git instead15:41
infinityAhh, it moved, yes.15:41
infinityFound it when you did.15:41
infinityapw: Well, kernels will rebuild organically but, indeed, we'd need to transition other rdeps if we want to keep the right restriction.  Point made.15:42
jtayloror we convince upstream to not release point releases which break abi anymore15:42
jtaylorthen the restriction could stay correct15:42
infinityIt may well be that's upstream's intent already, but because it's a private library with a full-ver SONAME, they fail even when they succeed.15:43
infinityWould be tempting to submit patches to both make it a proper shared library and mark all the internal symbols hidden.15:45
infinityBut I suspect the first would be rejected, and the second would be an annoying amount of fiddly work.15:45
infinityEspecially if the first wasn't considered.15:46
slangasekI, too, am often tempted when I see a rathole to get out my yak clippers15:46
infinityslangasek: I'm going to go find chickens and oranges.  If you need an emergency SRU review later for this mess, text me, and I'll show up if I'm not out like a light.15:50
unixabgapw: Greetings, we talked about a year ago about overlayfs and casper. I am trying to add additional partial.squashfs to live media16:21
unixabgso a filesystem.squafhs and a partial.squashfs file.16:22
unixabgI believe I see what the issue is and I am testing with 16.04. Should I test and work with 16.10 daily to do more debug16:22
unixabgwork. The issue (or so I think) is that the partial.squashfs file gets mounted but does not get added to the lowerdir16:23
apwunixabg, blimey, that was a long time ago, but yes, i remember vaguely16:24
unixabgstack. 16:24
unixabghere http://install.fyeox.com/scripts/live-partial-squashfs-updates is how I make my partial updates.16:24
unixabgThis is probably a better link to share: https://github.com/unixabg/live-medium-install-tools/blob/master/scripts/live-partial-squashfs-updates  16:26
apwunixabg, you should work on the yakkety one yes, as we can rotate that quicker to get fixes in16:28
unixabgNot sure where in casper that happens but in my partial squashfs update script PSU, I am appending see line 35-37 on link from githup.16:28
unixabgs/githup/github/g16:28
unixabgOk my time is like vapor just as I suspect yours is. Ok to just download daily.iso and start from there ?16:29
unixabgI would like to get to where you can have the prestine original filesystem.squashfs and a psu.squashfs for easy16:30
unixabgremaster and a clean path of updates.16:30
unixabgs/updates/updates for custom iso/g16:30
apwsounds reaosnable indeed16:33
dmj_s76kamal: So I've tested the patch, and it fixes the installer in uefi mode.17:39
dmj_s76kamal: Bios mode seems a little more complicated.17:41
dmj_s76There's a difference in behavior regarding vga modes at install time vs first boot17:41
kamaldmj_s76, the ISO kernel just went out the door so if there are further issues we'll have to tackle them in the next cycle17:45
kamaldmj_s76, so pls start up a fresh bug report to track that, when you get to that point17:46
apwkamal, indeed, they are publishing right now17:50
kamalapw, launchpad has been flooding my inbox with the news :-)17:51
apwkamal, i bet ... :)  mine is deluged too17:51
dmj_s76kamal: Well, it's a huge improvement17:57
dmj_s76kamal: Might not be a kernel specific issue either17:57
kamaldmj_s76, my favorite kind of issue: not the kernel's problem ;-)17:59
dmj_s76kamal: ...seems that bios mode only works if you set a vga mode manually17:59
dmj_s76(in the live install)18:00
dmj_s76(first boot doesn't need a vga mode set)18:00
unixabgapw: Ok just a bit of overlayfs mounting help? When I setup overlay for partial squashfs creation, I compose a list and mount all18:17
unixabgin one. In casper it looks like it wants to sort of compose them together one at a time. So I am not sure about that. Is there18:18
unixabgsomewhere I can read to help me better understand how to mount overlay in on top of $rootmnt ?18:19
unixabgmount -t overlay overlay -olowerdir="${_LSTACK}",upperdir=./psu_overlay_rw,workdir=./psu_overlay_work ./psu_overlay18:20
unixabgis what I am used to using and I have the ${_LSTACK} confiured with all the mounts in the correct order.18:20
apwunixabg, so i think we didn't use to be able to mount multiple underlays, can ou do that now with overlay ?18:23
apwif so then the code is suboptimal as it is18:23
unixabgapw: well I do it so, I will say yes. Can you take a quick look at my utility script to create psu and rejoin work?18:27
unixabghttps://github.com/unixabg/live-medium-install-tools/blob/master/scripts/live-partial-squashfs-updates18:27
unixabgIt is not long and it does work, so I _think_ it not a large jump to just compose the lower mount list and 18:27
unixabgpass that for a single mount command. Or at least that is what I _think_.18:28
unixabgcasper currently does mount the partial-squashfs-update.squashfs file, but it just does not get mounted in 18:29
unixabgthe lower stack. I hope this helps apw and I am willing to test.18:29
slangasekinfinity, jtaylor, apw: I've satisfied myself that the only ABI change in 2.26.1 is the dropped "internal" symbol (not exported in headers); will take care of fixing up the backwards-compatibility18:35
apwslangasek, excellent news18:36
=== cmagina is now known as cmagina-errand
memguyI am wondering if the is a file in /proc/pid that tells you stuff about the fs_struct locks for a particular process i know there is /proc/locks or lsof one can uses but was just curious if on dumped that info into each process folder seems it should be there but haven't found it19:43
memguy/proc/pid/fd tells you what files via file descriptors but not anything about the file locks or file attributes of the descriptor19:48
memguy/proc/locks is the only thing i really see for locks was thinking it would be under each process the locking for a process in each pid folder as well 19:49
memguyas /proc should contain all the info for any process so i may just be forgetting where to look for this anybody know19:52
memguySeems to me proc is missing alot of info on things that have to do with locks there should be for each process a memlocks , filelocks , process_locks /thread_lock files ( maybe the latter of the 3 should be broken down into semephores, mutex, spinlocks info files )20:01
apwmemguy, not everything is out there indeed20:02
memguywell it seems /proc should contain anything held in the task_struct and substruct info that one could view and in most cases it does just right now not really good with locks20:03
memguyat least for me that is20:03
infinitymemguy: /proc/<pid>/fdinfo/<fd> maps to /proc/locks.  Same info, different view.20:04
memguywell that tells you the filenames and descriptors the process uses but where does it tell you what region is locked , what type of lock,...etc20:06
infinitymemguy: http://paste.ubuntu.com/19406450/20:06
infinityFor example.20:07
memguyhum weird i only get pos:020:11
memguyflags:01 maybe its something with my lock because i get it showing up in /proc/locks20:11
memguyAnother thing though is this is just for file locking where does one get the info for thread/process locks 20:12
memguyfor memory locks i have similar to file locks map_files and maps which i imagine the 20:16
memguyb751b000-b76c4000 r-xp 00000000 07:00 3792       /lib/i386-linux-gnu/libc-2.19.so20:16
infinityBy thread locks, you mean pthread_mutex_lock()?20:16
memguyr-xp  p means protected memory  20:17
infinityCause I can't see how or why that would be exported in /proc20:17
memguyI mean all of the locks spinlock , semphores , or the binary ones called mutex all of it would depend on the process to say i was looking at kernel level kworker or 20:17
memguynormally it would just be mutex i get that but i it also on the rare occasion provide the things when spinlocking or other semephores occur20:19
apwthe kernel does not export info on its internal locks no20:19
infinityYou're unlikely to find ways to introspect that without gdb and a knowledge of how those bits are implemented on your platform.20:19
infinityIt's a libc/kernel tag-team, and very hard (impossible on some platforms, I'd suggest) to export.20:20
memguyok but for pthreads and userlevel multitasking that needs to lock parts of code i imagine it is mostly all done with mutex or semephores not so much busy waiting spinlocks so is there a file to look up that info for those for each /proc/pid/xxx20:24
apwthose are implemented with futex's normally, no idea if they are exposed in uspace, though by definition you only get half the story20:31
apwas they only implement the "not spinning and wasting cpu" parts20:32
=== cmagina-errand is now known as cmagina
memguyhow about more on the memory attributes  r-xp "p or s " tell me its shard but nothing about if it is locked or other attributes that the MMU imposes on it?20:47
memguyI know i could write an LKM to create a file in each /proc/pid printing any info i want from task_struct or sub structures so in theory i can do it all but if its already there i would be reinventing the wheel plus my point of view right now is understanding how to trouble shoot any problem that could happen with a process/scheduler, filesystem , or MMU . Think of it more like I am finishing up with super sysadmin and moving 20:51
memguyback to developer soon. I fluctuate between software engineer/program to sysadmin.20:51
unixabgapw: ok I think this is the answer of support of multiple lower layers:21:01
unixabghttps://kernelnewbies.org/Linux_4.0#head-2274894c6e481a014a984600daeb55d8e5d6d91a21:01
unixabgWhich in fact is similar to what my script does. Now how to move casper in to this format I think is in the21:03
unixabgsetup_unionfs function line 385. 21:03
memguyalso what is futex its seems like it is a type of mutex at the syscall level all most. But is it only for processor locking or can it do memory locking and file locking because kind of confused about this and flock or mlock where they all stand21:51
memguynever mind its for process's /code /shared memory locking 21:55
memguyfast user space mutexes21:55

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