« first day (3175 days earlier)      last day (60 days later) » 

12:31 AM
@derobert I would distinguish between the review aspect and the voting/site quality aspect. If the answer attempts to answer the question, it passes the review. If you can tell whether it's a good answer or not, vote and/or comment your conscience.
@derobert you didn't ask my opinion on this, but here it is anyway. I haven't read the "flag as low quality" text since I got here. I don't think that first sentence of it is useful at all. None of the LQP items I can remember (of the 7,000+ I've done) met the criteria of "severe formatting or content problems", so that seems like a bad criterion to use for <3k users.
That post has had quite a contentious entry to U&L, between the first posts review ("Reviewed"), the late answer queue ("No action needed"), and the LQP (two "OK" and two "Delete")
 
 
2 hours later…
3:06 AM
Hello all,
I'm looking for some insights regarding Linux memory allocation, specifically what is used by the kernel and drivers. The reason is that I have a small VM in AWS and Azure, both with 0.5 GiB of memory. The odd thing is that the AWS VM shows 479 MiB total for `free --mebi` and the Azure VM shows 392 MiB for the same command. Feeling that I was being slighted the memory in Azure I had a ticket escalated to the Azure product team, and they finally back back saying that a lot of the memory was being used by the kernel and drivers, and that the following script would reveal the actual
totalmem=0;
for mem in /sys/devices/system/memory/memory*; do
[[ "$(cat ${mem}/online)" == "1" ]] \
   && totalmem=$((totalmem+$((0x$(cat /sys/devices/system/memory/block_size_bytes)))));
done
echo ${totalmem} bytes
echo $((totalmem/1024**2)) MiB
When I run this script on both VMs, they both seem to have exactly 536870912 bytes, or 512 MiB of memory. Examining what this script actually does, it seems to add 134217728 (the contents of `/sys/devices/system/memory/block_size_bytes`) four times (the number of memory devices where online == 1). What I'm wondering is:
- Is this information accurate, and there really is 512 MiB of memory in the VM?
- If so, how can I get a clear picture of what is happening to it?
If this is true, I assume that the VM running on the Azure platform (Hyper-V?) simply has some drivers which use significantly more memory than is needed on the AWS platform.
 
3:25 AM
@jdgregson this seems like it should be a question on the site
 
@jdgregson Memory usage is often a mystery. It often seems to me that such questions should be addressed to the kernel developers. They should have some idea what is going on, if anyone does.
Which is not to say that such questions are off-topic here, or anything.
It's just that users of this site may not be privy to such holy mysteries. Unless they are kernel developers who are familiar with how the Linux memory model works.
 
I'd ask on the site, but it seems a little vague, which runs the risk of being "too broad". I'll think of how I can reword it to ask a more specific question.
 
@jdgregson Yes, vague can be a problem if you are wondering what happened to the memory.
BTW, human readable figures are generally better. As opposed to figures in bytes.
 
I read that dmesg contains early-boot memory insights, so I tested on both:
Azure:
~# dmesg | grep "Memory"
[ 0.000000] Memory: 376860K/523832K available...

AWS:
root@ip-172-31-21-48:~# dmesg | grep "Memory"
[ 0.000000] Memory: 467376K/523892K available...
Ignore that IP.
At any rate, they both do have 512 MiB, but the Azure VM immediately ditches 30% of it.
 
Memory usage in Linux has never made much sense to me. In particular, how the kernel insists on usage swap even when plenty of RAM is available is a particular sore spot.
And it's also less then clear what memory is being used by what.
 
3:35 AM
AWS: Memory: 467376K/523892K available (12300K kernel code, 2394K rwdata, 3924K rodata, 2376K init, 2376K bss, 56516K reserved, 0K cma-reserved)
Azure: Memory: 376860K/523832K available (14348K kernel code, 2578K rwdata, 4252K rodata, 2320K init, 2296K bss, 146972K reserved, 0K cma-reserved)
"146972K reserved" in Azure. Reserved for what?? This is dumb...
 
3:50 AM
This is the free -m output for my machine:
root@orwell:/home/faheem# free -m
              total        used        free      shared  buff/cache   available
Mem:          15941        5722         752         152        9465        9740
Swap:          8191        3145        5046
I'm honestly not sure what those numbers mean.
The bottom line - if there is 9740M RAM available, why the hell is it using 3145M of swap??!!
 
Is your swappiness set too high?
 
@jdgregson Dunno. What's swappiness?
 
Swappiness is the setting that controls how likely the kernel is to swap memory out to swapspace. You can adjust it if you don't like how often your system swaps stuff.
 
cat  /proc/sys/vm/swappiness
60
That's the default, I think.
 
You can try setting it to 0 and see if it will leave the swap alone.
 
3:55 AM
@jdgregson Sure. Thank you for the suggestion.
 
Yeah, no problem.
 
Though perhaps 10 would be more conservative.
 
Yeah, that might be a good idea. Let it use swap if it has to, but not just because it feels like it.
 
Would vm.swappiness=10 in /etc/sysctl.conf do the trick?
And what value do you use?
 
Yeah, something like that to set it permanently (after a reboot). To set it for the current session you should be able to do echo 10 > /proc/sys/vm/swappiness
At least that used to be how it was.
 
3:59 AM
@jdgregson Yes, that's what the docs say.
 
I hope it works for you. I tried messing with the swappiness on a system back like sever years ago, but couldn't quite get what I wanted. Haven't messed with it much since then.
 
I just read somewhere that the default value of 0.6 means that the kernel starts using swap if 40% of RAM has been allocated. Which is kind of nuts, if true.
But of course, even then, the details of how RAM and swap proportions are allocated is not clear. Like I said, holy mysteries.
 
The only consolation is that it made sense to someone once.
 
And all the visible documentation is quite vague.
Now running swapoff -a. Sigh.
For a lot of the more obscure stuff, I think it probably makes more sense to pester the kernel developers (if they will listen). That might actually change something.
Though by reputation, they are not a friendly lot. I don't know if the recently adopted COC would have made any difference. It's quite easy to ignore documents. Happens here all the time.
Running swapoff -a was probably a bad idea. Someone suggested it in a SE comment, and it seemed like a good idea. But rebooting would have been a better idea.
 
@jdgregson Upvoted, FWIW.
 
Thanks, I appreciate it. Microsoft will too when I finally let them close the ticket.
 
@jdgregson Microsoft ticket?
They have tickets?
@jdgregson Hmm, actually people have recommended swappiness to me before. And it doesn't work.
I was just checking the archives of this chat, and there's quite a lot of discussion about this between me and other people.
 
Yeah, with Azure support. I've had one open for about a month basically asking "why you no give me all the RAM?" But it turns out that they ARE giving the same amount of memory, but the kernel uses it up with crappy drivers or something.
And that's basically what I thought of swappiness.
It seems like the right thing, but didn't seem to actually change anything.
You could always add more RAM and remove the Swap :P
 
@jdgregson If it's a Linux kernel problem, I don't see what MS could do about it.
@jdgregson I've got 16GB. And this machine mostly doesn't do much.
Perhaps I should just remove the swap? :-)
 
4:35 AM
I was thinking that they had the instance set to receive less RAM than they marketed.
 
@jdgregson Which is in fact not the case?
 
Yeah, it turns out I am getting the full 0.5 Gib -- but the instance utilizes it less efficiently.
 
@jdgregson I see. I doubt anyone but the Linux kernel devs could help you, though.
There seems to be plenty of confusion on the net on memory related issues.
 
If I had a larger instance I wouldn't care about the ~100 MiB used by their drivers. But with such a small instance, I'm losing about 22% of my memory to drivers versus what I saw on AWS.
 
@jdgregson Have you checked for drivers you don't need? You can always blacklist them, I expect. Or whatever the correct term is.
 
4:41 AM
I haven't looked too deeply into that yet. I'm hoping to find exactly which driver is eating up the memory. I suspect it's something critical to running on Azure, like they Hyper-V disk drivers or something like that.
 
@jdgregson It's not clear it's the right thing. The official documentation (what there is of it), is confusing, unclear and ambiguous.
@jdgregson If you want a breakdown of memory by driver, and you can't find it on the net, that would be a useful separate question.
Though it's possible no such command/mechanism exists.
I heard somewhere that the Linux kernel does not have a bug tracking system. Is that true?
 
Isn't bugzilla.kernel.org the official kernel bug tracker?
 
@jdgregson Hmm. Maybe so.
I wonder if they do that dreadful autoclose thing that Mercurial has taken to doing.
Lots of open memory bugs - bugzilla.kernel.org/…
 
Maybe they don't autoclose enough. There are bugs open -- or at least "NEW" -- since 2013.
 
@jdgregson Autoclosing is a bad idea, imo.
Though it's even worse when the problems are reproducible, as is usually the case with Mercurial.
Linux kernel memory bugs fall in a more ambiguous area, granted.
Version control systems are usually very precise and relatively small things. As opposed to a monster like the Linux kernel.
I checked a few of those bugs. There is no sign that anyone has even bothered to look at them.
 
4:58 AM
I'm not finding much about driver memory. The modules are only using about 4.4 MiB of memory, which doesn't even begin to account for the usage I'm seeing.
 
@jdgregson That's odd.
 
 
1 hour later…
6:18 AM
This one actually has some discussion - bugzilla.kernel.org/show_bug.cgi?id=64121
I'm guessing the magic word here was "bisect".
 
 
2 hours later…
7:54 AM
I also came across [that post](https://unix.stackexchange.com/review/low-quality-posts/298161) in the LQP queue.
I always refer to the [guidelines for reviewing](https://meta.stackexchange.com/questions/155538/what-are-the-guidelines-for-reviewing/180029#180029) found in Meta SE, where we read:
> **Answers that fail to address the question**: If you evaluate the answer such, first check carefully whether there is a lack of clarity in the question that you and the answer’s author may have interpreted differently. Otherwise recommend deletion. Leave an explaining comment in both cases.
Not sure about why formatting is apparently not working in my last message.
 
8:20 AM
@fra-san I was wondering that too.
 
8:32 AM
@FaheemMitha Almost mysterious as Linux memory management.
 
@fra-san Try again on one line?
 
@FaheemMitha I'll bet it would work. E.g. I was referring to this review.
 
@fra-san Ah. Well, let me try a multiline link.
Let me just quote the same review.
Yes, looks like that is the problem.
I suppose this is a bug - but I've seen no discussion of it ever. Unless it's new.
You could report it.
 
@FaheemMitha Ah! So, chat is confused by newlines.
 
I don't do a lot of this url formatting, and for some reason have never done so in multiline comments. But I also rarely do multiline comments. Actually, I rarely write multiline comments, period.
@fra-san Yes, that's why I said to try it on one line.
 
8:37 AM
@FaheemMitha I think it's intended: the right punishment for the outrageously long messages I post.
 
@fra-san Unlikely.
@JeffSchaller Any idea?
 
@FaheemMitha Other people have already reported it, e.g. meta.stackexchange.com/questions/70141/…
 
@fra-san Ah so.
Along with suitably brain-damaged responses from whoever.
 
9:21 AM
@jdgregson unfortunately it depends on the subsystem, see the B: entries in the MAINTAINERS file in the kernel source code
 
9:36 AM
@StephenKitt So some people use it, and some don't?
 
10:02 AM
@FaheemMitha no idea; sounds like fra-san found it
 
@JeffSchaller Yes. It's a bug.
 
@FaheemMitha It is apparently "by design". Strange enough, proposals to clearly document it in the FAQ are not receiving a warm welcome: meta.stackexchange.com/q/329518/410681
 
@fra-san this is a great discussion -- the gray area of the LQP queue; perhaps Meta would be a good place to hash it out. My position on it has changed over the years, so I would be curious to hear everyone's perspectives on it.
 
@fra-san IMO, it's a bug. They can call it "by design" as much as they want.
 
10:18 AM
@JeffSchaller Thanks, I agree. I'll try to come up with a good question for Meta.
 
 
1 hour later…
11:46 AM
@FaheemMitha yes, which is pretty annoying really because users need to be quite familiar with the kernel development process to be able to file a bug
so what usually happens is someone files a bug on something else, and the maintainer there knows that it’s a kernel bug and either files the bug in the appropriate place directly, or tells the user what to do
users who try to help out and file bugs directly often end up with no response and thus a bad experience
 
@StephenKitt Sounds confusing. They should have a consistent process.
I've never tried to file a kernel bug myself.
 
12:20 PM
@JeffSchaller apparently mod edits kick pending suggested edits: unix.stackexchange.com/review/suggested-edits/298780
 
@StephenKitt you forgot the prefix: "Jeff, what the beep have you done, now? I see that ..."
@fra-san great! Don't let me influence you, but if I was going to write a Meta question, I would like to focus on the gray area, so the Question could address (and set aside) the obvious/easy LQ posts, so that Answers could focus on the handling of the gray area(s).
I thought the app was just misbehaving as I was trying to make that edit; sounds like I "crossed the streams"
 
@JeffSchaller right, that explains the glitch in the Matrix
 
@StephenKitt failing once again to do as little as possible
 
@JeffSchaller or really, being caught out because you want to continue doing all your editing, but your new powers mean there are fewer safety barriers
ha ha yes
but then who expects elected candidates to honour their electoral programs? oh wait
 
Jeff, just "let it go ♫, let it go"
hey, at least I'm keeping my promise to stay in the LQP queue too long
 
1:14 PM
@StephenKitt Apropos of nothing, have you ever used Lua?
(I may have asked that already. If so, blame my poor memory.)
 
@FaheemMitha yes
 
@StephenKitt What did you think of it?
 
@FaheemMitha as an embedable language it’s nice
 
BTW, I recently noticed that giving Lua 1 (just the integer one) produced an error. I was puzzled by this, because in my limited experience I'd never seen a language do that before.
I thought all languages would echo it as a matter of course.
So I asked on #lua, which was a mistake, because they took offense for some reason.
I certainly didn't mean to be offensive. I was just surprised.
 
Prolog wouldn’t like it either ;-).
 
1:20 PM
@StephenKitt Oh.
 
1:47 PM
@JeffSchaller Thanks! Really good advice. I'm also looking around on Meta SE before asking on our one, it looks like almost anything has already been discussed.
 
@fra-san good! I searched the U&L Meta but didn't find anything yet; writing more "Learning the Art of the $X queue" is on my TODO list, for X != "Close", so don't feel obligated to write anything you're not interested in. Your discovery of meta.stackexchange.com/questions/155538/… is a great start
 
2:13 PM
wydrukowaćf '%s\n' 'cześć czat'
 
@Jesse_b Good morning! When I suggested that you learn new languages, I didn't realize that you were going to run this far with it! :)
 
:p Good morning =)
 
 
3 hours later…
4:54 PM
@jdgregson What a specific line of kernel output means is the type of question you could ask on the site...
(oh, I see you have...)
[ 0.000000] Memory: 584416K/628332K available (6268K kernel code, 1161K rwdata, 2872K rodata, 1424K init, 656K bss, 43916K reserved, 0K cma-reserved) is what it looks like on Google Compute (tiniest instance), if you care
 
5:23 PM
@FaheemMitha Never seen a language do that before?
test.c:1:1: error: expected identifier or ‘(’ before numeric constant
 1
 
@FaheemMitha All bugs are just eccentric features
 
[2495237.732993] Out of memory: Kill process 124154 (apt-check) score 148 or sacrifice child
They didn't have to make it sound so... chilling
How many children do you need to sacrifice to get 1TB of memory?
 
@jdgregson all of them
 
5:38 PM
Back to my recent question: unix.stackexchange.com/questions/525761/…, I checked the BIOS-provided memory map on both systems in dmesg.
AWS
[ 0.000000] e820: BIOS-provided physical RAM map:
[ 0.000000] BIOS-e820: [mem 0x0000000000000000-0x000000000009dfff] usable
[ 0.000000] BIOS-e820: [mem 0x000000000009e000-0x000000000009ffff] reserved
[ 0.000000] BIOS-e820: [mem 0x00000000000e0000-0x00000000000fffff] reserved
[ 0.000000] BIOS-e820: [mem 0x0000000000100000-0x000000001fffffff] usable
[ 0.000000] BIOS-e820: [mem 0x00000000fc000000-0x00000000ffffffff] reserved
Azure
[ 0.000000] BIOS-provided physical RAM map:
[ 0.000000] BIOS-e820: [mem 0x0000000000000000-0x000000000009fbff] usable
[ 0.000000] BIOS-e820: [mem 0x000000000009fc00-0x000000000009ffff] reserved
[ 0.000000] BIOS-e820: [mem 0x00000000000e0000-0x00000000000fffff] reserved
[ 0.000000] BIOS-e820: [mem 0x0000000000100000-0x000000001ffeffff] usable
[ 0.000000] BIOS-e820: [mem 0x000000001fff0000-0x000000001fffefff] ACPI data
[ 0.000000] BIOS-e820: [mem 0x000000001ffff000-0x000000001fffffff] ACPI NVS
Without calculating the size of those blocks, it looks like Azure might be dedicating the missing memory to ACPI data and ACPI NVS?
ACIP data: ~ 0.058 KiB
ACPI NVS: ~ 0.004 KiB
Nope, that doesn't account for hardly anything.
 
@derobert C doesn't count.
 
@FaheemMitha C doesn't count? Errr, did you forget which site you're on?
 
5:55 PM
@derobert Nope, I know where I am.
 
6:05 PM
Other than Ruby and Python (and then only at their interactive prompts), which languages is 1 a quine?
$ 1
bash: 1: command not found
... doesn't work in shell either
 
$ 1
hello world
1 is a valid command in awk
 
6:40 PM
@derobert one way to find out: find / -type f -executable -exec sh -c ' [ "$(timeout 1 $1 <<< 1 2>&1)" = "1" ]' findsh {} \; ... be prepared to kill things off, though :)
closest I got was wall
 
LOL, that sounds like something best done in a VM!
 
you can't have fun like that in an alpine container, that's for sure
 
Python only works if stdin is a tty. irb manages to spit out some extra stuff. (I tried a few I figured would work manually)
 
can't decide if that's a codegolf question or a U&L question or a SO question
 
Hah
 
6:46 PM
probably not a great SE question, since it's a list request; nevermind me :)
 
I thought you were going to ask for a better test harness to find them all.
 
"How can I prevent this command from hanging?" as a back door
 
timeout -s KILL might help
It probably defaults to something else
 
yes, TERM; sorry, it was a quick hack
 
 
2 hours later…
8:48 PM
Seems like a slow day
 
8:58 PM
@Jesse_b Technically, it's not a command. It's a condition that triggers the default command.
 
=)
awk is not my native tongue :p
 
@Jesse_b My native tongue is my primary organ of taste in the gustatory system.
 
@Kusalananda My creamy milk beverage brings all the gentlefolk to the garden in front of my domicile and they insist that it is of a better quality than thine. I could instruct you but it would incur a fee.
(My milkshake brings all the boys to the yard...)
 
@Jesse_b If it's not coffee flavoured, I'm not interested.
 
You probably hate american covfefe anyway
 
9:23 PM
@Jesse_b I know I do. :-)
 
@Kusalananda You would definitely hate the coffee in my office
we have one of those kuerig atrocities. It makes coffee that is somehow both bitter and watered down. It never gets cleaned so it's disgusting
 
@Jesse_b This is what's currently brewing at home: arvidnordquist.com/coffee/sortiment/svea
 
looks high faluten
 
But very nice coffee.
 
I buy chock full o nuts
I like my coffee like I like my women: Soaked in boiling hot water
 
9:36 PM
Or was that "brown and strong"?
Or, a bit nutty?
 
scolding hot and gritty
I really do need my coffee to be mouth scorching hot though, once it starts to cool off even a bit I usually heat it up
 
Not just scolding.
 
(In the microwave) gasps such american
 
My grandmother's brother used to call brewed coffee "cold coffee". He wanted his straight from the coffeepot on the stove.
@Jesse_b I sometimes heat up coffee in the mircowave. My brewer has no heating plate/element, but it brewes into a thermos. That cools down over the day, so in the afternoon, the last cup has to be heated.
 
Greetings @StéphaneChazelas
 
9:42 PM
If he hasn't said anything, he's not here. I did the same to Gilles once and I thikn he got a bit annoyed.
 
@Kusalananda =) Yeah a good thermos is something I didn't realize was worth paying the money for until recently. I used to have cheap thermoses that would keep coffee hot for maybe 30 minutes. I have two now that will keep it hot most of the day
Stéphane's computer has no backspace button, Stéphane doesn't make mistakes.
 
10:00 PM
@Kusalananda: I think you Europeans are unfair about American coffee. The main argument that I've seen is that our coffee is weak so that we can drink a lot of it
Well yes...more is better
 

« first day (3175 days earlier)      last day (60 days later) »