diff for duplicates of <1471531306.4319.38.camel@perches.com> diff --git a/a/1.txt b/N1/1.txt index 3b881b6..8820098 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -5,9 +5,9 @@ On Thu, 2016-08-18 at 16:26 +0200, Michal Hocko wrote: > > > diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c > > [] > > > @@ -721,6 +721,13 @@ void __weak arch_show_smap(struct seq_file *m, struct vm_area_struct *vma) -> > > { -> > > } -> > > +> > > { +> > > } +> > > > > > +static void print_name_value_kb(struct seq_file *m, const char *name, unsigned long val) > > > +{ > > > + seq_puts(m, name); @@ -21,54 +21,54 @@ On Thu, 2016-08-18 at 16:26 +0200, Michal Hocko wrote: > OK, I haven't noticed that. I can rebase, although I wonder whether the > change is a universal win. Not that the strlen on a short string would > matter but just look at the usage: -> 76 " " -> 1 "/" -> 1 "" -> 1 "cpu " -> 1 "intr " -> 1 g ? " " : "", -> 1 "\nFDSize:\t" -> 1 "\nGid:\t" -> 1 "\nNgid:\t" -> 1 "\nnonvoluntary_ctxt_switches:\t" -> 1 "\nPid:\t" -> 1 "\nPPid:\t" -> 1 "\nSigQ:\t" -> 1 "\nTgid:\t" -> 1 "\nTracerPid:\t" -> 1 "\nUid:\t" -> 1 "Seccomp:\t" -> 1 "softirq " -> 10 "\t" -> 1 "Threads:\t" -> 1 "voluntary_ctxt_switches:\t" +> 76 " " +> 1 "/" +> 1 "" +> 1 "cpu " +> 1 "intr " +> 1 g ? " " : "", +> 1 "\nFDSize:\t" +> 1 "\nGid:\t" +> 1 "\nNgid:\t" +> 1 "\nnonvoluntary_ctxt_switches:\t" +> 1 "\nPid:\t" +> 1 "\nPPid:\t" +> 1 "\nSigQ:\t" +> 1 "\nTgid:\t" +> 1 "\nTracerPid:\t" +> 1 "\nUid:\t" +> 1 "Seccomp:\t" +> 1 "softirq " +> 10 "\t" +> 1 "Threads:\t" +> 1 "voluntary_ctxt_switches:\t" > > Most users simply need a single character. Those few could just seq_puts > for the string followed by seq_put_decimal_ull. -> +> > > > > Maybe this change in fs/proc/meminfo.c should be > > made into a public function. > > -> > $ git log --stat -p -1 5e27340c20516104c38668e597b3200f339fc64d +> > $ git log --stat -p -1 5e27340c20516104c38668e597b3200f339fc64d > > > > static void show_val_kb(struct seq_file *m, const char *s, unsigned long num) > > +{ -> > + char v[32]; -> > + static const char blanks[7] = {' ', ' ', ' ', ' ',' ', ' ', ' '}; -> > + int len; +> > + char v[32]; +> > + static const char blanks[7] = {' ', ' ', ' ', ' ',' ', ' ', ' '}; +> > + int len; > > + -> > + len = num_to_str(v, sizeof(v), num << (PAGE_SHIFT - 10)); +> > + len = num_to_str(v, sizeof(v), num << (PAGE_SHIFT - 10)); > > + -> > + seq_write(m, s, 16); +> > + seq_write(m, s, 16); > > + -> > + if (len > 0) { -> > + if (len < 8) -> > + seq_write(m, blanks, 8 - len); +> > + if (len > 0) { +> > + if (len < 8) +> > + seq_write(m, blanks, 8 - len); > > + -> > + seq_write(m, v, len); -> > + } -> > + seq_write(m, " kB\n", 4); +> > + seq_write(m, v, len); +> > + } +> > + seq_write(m, " kB\n", 4); > > +} > Uff, this is just ugly as hell, seriously! a) why does it hardcode the > name to be 16 characters max in such a subtle way and b) doesn't it try @@ -85,9 +85,3 @@ The output formatting can't be changed as it /proc And your proposed patch is actually inappropriate as it effectively changes %8lu to %lu - --- -To unsubscribe, send a message with 'unsubscribe linux-mm' in -the body to majordomo@kvack.org. For more info on Linux MM, -see: http://www.linux-mm.org/ . -Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a> diff --git a/a/content_digest b/N1/content_digest index 5f7b7bd..c32d7b6 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -18,9 +18,9 @@ "> > > diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c\n" "> > []\n" "> > > @@ -721,6 +721,13 @@ void __weak arch_show_smap(struct seq_file *m, struct vm_area_struct *vma)\n" - "> > > {\n" - "> > > }\n" - "> > > \n" + "> > > \302\240{\n" + "> > > \302\240}\n" + "> > > \302\240\n" "> > > +static void print_name_value_kb(struct seq_file *m, const char *name, unsigned long val)\n" "> > > +{\n" "> > > +\tseq_puts(m, name);\n" @@ -34,54 +34,54 @@ "> OK, I haven't noticed that. I can rebase, although I wonder whether the\n" "> change is a universal win. Not that the strlen on a short string would\n" "> matter but just look at the usage:\n" - "> 76 \" \"\n" - "> 1 \"/\"\n" - "> 1 \"\"\n" - "> 1 \"cpu \"\n" - "> 1 \"intr \"\n" - "> 1 g ? \" \" : \"\",\n" - "> 1 \"\\nFDSize:\\t\"\n" - "> 1 \"\\nGid:\\t\"\n" - "> 1 \"\\nNgid:\\t\"\n" - "> 1 \"\\nnonvoluntary_ctxt_switches:\\t\"\n" - "> 1 \"\\nPid:\\t\"\n" - "> 1 \"\\nPPid:\\t\"\n" - "> 1 \"\\nSigQ:\\t\"\n" - "> 1 \"\\nTgid:\\t\"\n" - "> 1 \"\\nTracerPid:\\t\"\n" - "> 1 \"\\nUid:\\t\"\n" - "> 1 \"Seccomp:\\t\"\n" - "> 1 \"softirq \"\n" - "> 10 \"\\t\"\n" - "> 1 \"Threads:\\t\"\n" - "> 1 \"voluntary_ctxt_switches:\\t\"\n" + "> \302\240\302\240\302\240\302\240\302\24076 \" \"\n" + "> \302\240\302\240\302\240\302\240\302\240\302\2401 \"/\"\n" + "> \302\240\302\240\302\240\302\240\302\240\302\2401 \"\"\n" + "> \302\240\302\240\302\240\302\240\302\240\302\2401 \"cpu\302\240\302\240\"\n" + "> \302\240\302\240\302\240\302\240\302\240\302\2401 \"intr \"\n" + "> \302\240\302\240\302\240\302\240\302\240\302\2401 g ? \" \" : \"\",\n" + "> \302\240\302\240\302\240\302\240\302\240\302\2401 \"\\nFDSize:\\t\"\n" + "> \302\240\302\240\302\240\302\240\302\240\302\2401 \"\\nGid:\\t\"\n" + "> \302\240\302\240\302\240\302\240\302\240\302\2401 \"\\nNgid:\\t\"\n" + "> \302\240\302\240\302\240\302\240\302\240\302\2401 \"\\nnonvoluntary_ctxt_switches:\\t\"\n" + "> \302\240\302\240\302\240\302\240\302\240\302\2401 \"\\nPid:\\t\"\n" + "> \302\240\302\240\302\240\302\240\302\240\302\2401 \"\\nPPid:\\t\"\n" + "> \302\240\302\240\302\240\302\240\302\240\302\2401 \"\\nSigQ:\\t\"\n" + "> \302\240\302\240\302\240\302\240\302\240\302\2401 \"\\nTgid:\\t\"\n" + "> \302\240\302\240\302\240\302\240\302\240\302\2401 \"\\nTracerPid:\\t\"\n" + "> \302\240\302\240\302\240\302\240\302\240\302\2401 \"\\nUid:\\t\"\n" + "> \302\240\302\240\302\240\302\240\302\240\302\2401 \"Seccomp:\\t\"\n" + "> \302\240\302\240\302\240\302\240\302\240\302\2401 \"softirq \"\n" + "> \302\240\302\240\302\240\302\240\302\24010 \"\\t\"\n" + "> \302\240\302\240\302\240\302\240\302\240\302\2401 \"Threads:\\t\"\n" + "> \302\240\302\240\302\240\302\240\302\240\302\2401 \"voluntary_ctxt_switches:\\t\"\n" "> \n" "> Most users simply need a single character. Those few could just seq_puts\n" "> for the string followed by seq_put_decimal_ull.\n" - "> \n" + "> \302\240\n" "> > \n" "> > Maybe this change in fs/proc/meminfo.c should be\n" "> > made into a public function.\n" "> > \n" - "> > $ git log --stat -p -1 5e27340c20516104c38668e597b3200f339fc64d\n" + "> > $\302\240git log --stat -p -1\302\240\302\2405e27340c20516104c38668e597b3200f339fc64d\n" "> > \n" "> > static void show_val_kb(struct seq_file *m, const char *s, unsigned long num)\n" "> > +{\n" - "> > + char v[32];\n" - "> > + static const char blanks[7] = {' ', ' ', ' ', ' ',' ', ' ', ' '};\n" - "> > + int len;\n" + "> > +\302\240\302\240\302\240\302\240\302\240\302\240\302\240char v[32];\n" + "> > +\302\240\302\240\302\240\302\240\302\240\302\240\302\240static const char blanks[7] = {' ', ' ', ' ', ' ',' ', ' ', ' '};\n" + "> > +\302\240\302\240\302\240\302\240\302\240\302\240\302\240int len;\n" "> > +\n" - "> > + len = num_to_str(v, sizeof(v), num << (PAGE_SHIFT - 10));\n" + "> > +\302\240\302\240\302\240\302\240\302\240\302\240\302\240len = num_to_str(v, sizeof(v), num << (PAGE_SHIFT - 10));\n" "> > +\n" - "> > + seq_write(m, s, 16);\n" + "> > +\302\240\302\240\302\240\302\240\302\240\302\240\302\240seq_write(m, s, 16);\n" "> > +\n" - "> > + if (len > 0) {\n" - "> > + if (len < 8)\n" - "> > + seq_write(m, blanks, 8 - len);\n" + "> > +\302\240\302\240\302\240\302\240\302\240\302\240\302\240if (len > 0) {\n" + "> > +\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240if (len < 8)\n" + "> > +\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240seq_write(m, blanks, 8 - len);\n" "> > +\n" - "> > + seq_write(m, v, len);\n" - "> > + }\n" - "> > + seq_write(m, \" kB\\n\", 4);\n" + "> > +\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240seq_write(m, v, len);\n" + "> > +\302\240\302\240\302\240\302\240\302\240\302\240\302\240}\n" + "> > +\302\240\302\240\302\240\302\240\302\240\302\240\302\240seq_write(m, \" kB\\n\", 4);\n" "> > +}\n" "> Uff, this is just ugly as hell, seriously! a) why does it hardcode the\n" "> name to be 16 characters max in such a subtle way and b) doesn't it try\n" @@ -97,12 +97,6 @@ "The output formatting can't be changed as it /proc\n" "\n" "And your proposed patch is actually inappropriate\n" - "as it effectively changes %8lu to %lu\n" - "\n" - "--\n" - "To unsubscribe, send a message with 'unsubscribe linux-mm' in\n" - "the body to majordomo@kvack.org. For more info on Linux MM,\n" - "see: http://www.linux-mm.org/ .\n" - "Don't email: <a href=mailto:\"dont@kvack.org\"> email@kvack.org </a>" + as it effectively changes %8lu to %lu -f363766d3c571fb1cb8646b71b80e8daad3db9c7bad79415a035055a258f418a +b92b387ed235e3458635b82142dbf672571dfbfe4dbe62f67e345befa866a369
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.