1561347584 Q * Aiken Remote host closed the connection 1561351423 M * Ghislain Bertl: FYI do_sysinfo calls get_monotonic_boottime(&tp); not the non monotonic version :( 1561352235 Q * _pa Quit: Leaving 1561354665 M * Bertl_oO we'll find a solution there ... no worries ... 1561354674 M * Bertl_oO off to bed now ... have a good one! 1561354679 N * Bertl_oO Bertl_zZ 1561356497 J * dustinm`_ ~dustinm`@static.38.6.217.95.clients.your-server.de 1561356610 J * jrklein_ ~cloud@34.234.31.16 1561356669 Q * jrklein synthon.oftc.net reflection.oftc.net 1561356669 Q * dustinm` synthon.oftc.net reflection.oftc.net 1561358822 Q * romster Server closed connection 1561358844 J * romster ~romster@158.140.215.184 1561359994 M * Ghislain well the monotonic calls the non monotonic lol 1561361118 J * Aiken ~Aiken@b951.h.jbmb.net 1561363073 J * hijacker ~nikolay@149.235.255.3 1561369793 M * Ghislain what should i include to be able to use vs_check_flags 1561369793 M * Ghislain and current_vx_info ? 1561374595 M * Ghislain #include ? 1561381283 Q * Aiken Remote host closed the connection 1561383028 M * Ghislain well 1561383068 M * Ghislain all the code i try to make in timekeeping failed with ./include/linux/timekeeping.h: In function ‘ktime_get_boottime’: 1561383068 M * Ghislain ./include/linux/vserver/base.h:21:35: error: dereferencing pointer to incomplete type ‘struct task_struct’ 1561383068 M * Ghislain and things like that 1561385411 N * Bertl_zZ Bertl 1561385417 M * Bertl morning folks! 1561385447 M * Bertl Ghislain: yeah, that can be tricky as we need the task struct definition for those checks 1561385482 M * Ghislain well an if then else is allready tricky for me but here i am completly lost 1561385518 M * Ghislain i ended with the following but could not test it as it do not compile 1561385551 M * Ghislain https://pastebin.com/raw/kKZUkhRe 1561385621 M * Bertl when doing diffs, it's a good idea to use the unified form 1561385679 M * Bertl I've had good success with -NurpP --minimal as diff options 1561385739 M * Ghislain https://pastebin.com/raw/99se9MG5 1561385742 M * Ghislain oh ! 1561385754 M * Ghislain i tried -nurp it failed lol 1561385845 M * Ghislain so there: https://pastebin.com/raw/0cyUv320 1561385877 M * Ghislain oh damm wrong way... 1561385971 M * Ghislain 4 try latter: https://pastebin.com/gjB4uv6C 1561386016 M * Ghislain that should be ok, this is the diff after the vserver patch, ptrace is for the reject, the stats.c is because we moved the time bias in the upper kernel function 1561386026 M * Bertl close (raw missing :) but otherwise professional 1561386069 M * Ghislain ^^ 1561386104 M * Ghislain oh i lack one file 1561386225 M * Ghislain https://pastebin.com/raw/hfcnbw5L 1561386251 M * Bertl so here a few comments: 1561386264 M * Ghislain really not sure of the way i changed the offset here 1561386326 M * Bertl vx_flags() uses the current context for checks 1561386360 M * Ghislain so test should be inverted ? 1561386399 M * Bertl and thus a task from the host (admin/watch context) will not see the VXF_VIRT_UPTIME flag anyway 1561386418 M * Bertl i.e. you can reduce the 1561386421 M * Bertl (vx_flags(VXF_VIRT_UPTIME, 0) && !vx_check(0, VS_ADMIN|VS_WATCH)) 1561386422 M * Ghislain if (vx_flags(VXF_VIRT_UPTIME, 0) && !vx_check(0, VS_ADMIN|VS_WATCH)) => if (!vx_check(0, VS_ADMIN|VS_WATCH) && vx_flags(VXF_VIRT_UPTIME, 0) ) ? 1561386440 M * Bertl to simply (vx_flags(VXF_VIRT_UPTIME, 0)) 1561386483 M * Ghislain oh, in my previous patch if i did not tested for the admin context it crashed the kernel so i added it and all worked 1561386525 M * Bertl that sounds strange 1561386574 M * Bertl #define vx_flags(m, f) vx_info_flags(current_vx_info(), m, f) 1561386598 M * Bertl so for example on the admin context, the current_vx_info() will become Null 1561386610 M * Ghislain that was not really the test the issue but the   struct vx_info *vxi = current_vx_info(); 1561386618 M * Bertl #define vx_info_flags(v, m, f) vs_check_flags(__vx_flags(v), m, f) 1561386634 M * Bertl #define __vx_flags(v) ((v) ? (v)->vx_flags : 0) 1561386652 M * Bertl and here you see that __vx_flags(v) checks that (v) exists 1561386670 M * Bertl so it will simply return 0 for the flags on the admin context 1561386676 M * Ghislain i see 1561386701 M * Ghislain the crash should be callign &vxi->cvirt.nr_threads when vxi = null in admin context 1561386706 M * Bertl note that in your second diff hunk, you need the check 1561386725 M * Bertl yep, there you will end up dereferencing a null pointer otherwise 1561386829 M * Ghislain ok i see 1561386834 M * Bertl then you want to make sure to get the spacing and indentation right 1561386882 M * Bertl i.e. line limit of ~72 characters, space before '{' when in the same line, et 1561386886 M * Bertl *etc 1561386911 M * Ghislain 72, hell you should drop this 640x480 monitor ! :p 1561386939 M * Bertl well, it's not my monitor, it's the kernel coding guidelines :) 1561386948 M * Ghislain lol 1561386958 M * Ghislain k 1561386964 M * Bertl and the last patch looks quite fishy 1561387004 M * Bertl ktime_t ktime_get_with_offset(enum tk_offsets offs) 1561387031 M * Bertl so there are four 'offsets' defined in the tk_offsets enum 1561387036 M * Ghislain so you mean its not an offset but the name of an offset ? 1561387049 M * Bertl TK_OFFS_REAL, TK_OFFS_BOOT, TK_OFFS_TAI, and TK_OFFS_MAX 1561387060 M * Ghislain TK8WERESCREWED then 1561387067 M * Bertl yup 1561387085 M * Ghislain why dont they use getboottiem64 here also .. 1561387105 M * Bertl no idea, and it might make sense to adjust that 1561387127 M * Bertl it might just be a relict from ancient times :) 1561387164 M * Bertl the problem here is, that it requires testing and making sure that any change doesn't break the kernel ABI 1561387243 M * Ghislain getboottime64 is returning a timespec but use ktime first then convert it 1561387270 M * Ghislain so we could use the same way https://elixir.bootlin.com/linux/v4.9.183/source/kernel/time/timekeeping.c#L2161 just short of the conversion 1561387329 M * Ghislain i think the only diff is that on 32 bit system they use a trick 1561387351 M * Ghislain on 64bits it should not matter 1561387808 M * Ghislain i think https://pastebin.com/raw/3sKgHFJi could work but not sure for 32b 1561387839 M * Ghislain i used the getboottime64 code with the bias 1561387940 M * Ghislain but i cannot test as the code do nto compile because of the include 1561388719 M * Ghislain i thnik i reached the glass cieiling of the guy who try to do c in the kernel while not even knowing C :D 1561389217 M * Bertl :) 1561389466 M * Ghislain but anyway my firts patch that just change do_sysinfo worked. It is not deep enough to cover all the case but it cover one more than before (2 with the nrthread one) 1561389501 M * Ghislain so if i can help more tell me, for now i am stuck :D 1561389617 M * Bertl I'll update the kernel patches today or tomorrow and the nr_threads patch looks good by now, so will definitely add it 1561389663 M * AlexanderS Something like "ktime_sub(ktime_get_with_offset(TK_OFFS_BOOT), timespec_to_ktime(vxi->cvirt.bias_uptime))" does not work? 1561389705 M * AlexanderS Ghislain: What's the problem with the include? 1561389761 M * AlexanderS Can you pastebin the complete compiler error? 1561389831 M * Ghislain https://pastebin.com/j170VX34 1561389854 M * Ghislain Bertl: i am an official vserver dev now, how about that ? :D 1561389873 M * Bertl sure, let me add you to the list 1561389879 M * Ghislain lol 1561389917 M * Bertl got a picture? 1561390004 M * Ghislain nope i prefer not to :p 1561390020 M * Ghislain i will make the other looks bad 1561390090 M * Bertl well, you've done a lot more 'kernel work' thank most of the listed developers in the last three years :) 1561390238 M * Ghislain so much for not knowing C ahah ! 1561390726 M * AlexanderS Ghislain: I lost the overview of the various pastbins with patches. What is the final full patch (on top of the linux-vserver patch of course)? 1561390767 M * Bertl Ghislain: http://linux-vserver.org/Developers 1561390786 M * Ghislain my latest try was : https://pastebin.com/raw/tz0qpx0F but no compile 1561390797 M * Ghislain hey thanks Bertl :) 1561390917 M * Bertl you're welcome! 1561391299 M * Ghislain i think the getboottime64 should be fine too, this is the last part on the offset that is the issue 1561391306 M * Ghislain apart from the include maze 1561393069 Q * hijacker Remote host closed the connection 1561393549 M * AlexanderS It's a circular import problem. 1561395210 J * fstd_ ~fstd@xdsl-85-197-54-73.nc.de 1561395679 Q * fstd Ping timeout: 480 seconds 1561397281 M * AlexanderS Ghislain: The easiest fix for the include problem was to uninline the method: https://pastebin.com/raw/vGp6Hvqc 1561397353 M * AlexanderS Ghislain: I also changed the calculation of the boottime to remove a undeclared variable, can you test if it's doing the right stuff? 1561398304 M * Ghislain i tried patching against my patch and against the vserver one but it does not work 1561398311 M * Ghislain in both case 1561398382 M * Ghislain should i apply it to my version or the vserver base patch ? 1561398905 M * Ghislain i tried to put it by hand, lets see :) 1561403151 M * AlexanderS Ghislain: It is against the base vserver patch, but I think pastbin removes the tabs and so the patch does not apply anymore. :-( 1561406495 J * Aiken ~Aiken@b951.h.jbmb.net 1561409202 Q * any0n Remote host closed the connection 1561409233 J * any0n ~k@7MPAAAB7E.tor-irc.dnsbl.oftc.net 1561410144 M * Guy- AlexanderS: sprunge.us is better for such things 1561416552 M * CcxWrk Or ix.io or 0x0.st ... or just use git :P