License cleanup: add SPDX GPL-2.0 license identifier to files with no license
Many source files in the tree are missing licensing information, which
makes it harder for compliance tools to determine the correct license.
By default all files without license information are under the default
license of the kernel, which is GPL version 2.
Update the files which contain no license information with the 'GPL-2.0'
SPDX license identifier. The SPDX identifier is a legally binding
shorthand, which can be used instead of the full boiler plate text.
This patch is based on work done by Thomas Gleixner and Kate Stewart and
Philippe Ombredanne.
How this work was done:
Patches were generated and checked against linux-4.14-rc6 for a subset of
the use cases:
- file had no licensing information it it.
- file was a */uapi/* one with no licensing information in it,
- file was a */uapi/* one with existing licensing information,
Further patches will be generated in subsequent months to fix up cases
where non-standard license headers were used, and references to license
had to be inferred by heuristics based on keywords.
The analysis to determine which SPDX License Identifier to be applied to
a file was done in a spreadsheet of side by side results from of the
output of two independent scanners (ScanCode & Windriver) producing SPDX
tag:value files created by Philippe Ombredanne. Philippe prepared the
base worksheet, and did an initial spot review of a few 1000 files.
The 4.13 kernel was the starting point of the analysis with 60,537 files
assessed. Kate Stewart did a file by file comparison of the scanner
results in the spreadsheet to determine which SPDX license identifier(s)
to be applied to the file. She confirmed any determination that was not
immediately clear with lawyers working with the Linux Foundation.
Criteria used to select files for SPDX license identifier tagging was:
- Files considered eligible had to be source code files.
- Make and config files were included as candidates if they contained >5
lines of source
- File already had some variant of a license header in it (even if <5
lines).
All documentation files were explicitly excluded.
The following heuristics were used to determine which SPDX license
identifiers to apply.
- when both scanners couldn't find any license traces, file was
considered to have no license information in it, and the top level
COPYING file license applied.
For non */uapi/* files that summary was:
SPDX license identifier # files
---------------------------------------------------|-------
GPL-2.0 11139
and resulted in the first patch in this series.
If that file was a */uapi/* path one, it was "GPL-2.0 WITH
Linux-syscall-note" otherwise it was "GPL-2.0". Results of that was:
SPDX license identifier # files
---------------------------------------------------|-------
GPL-2.0 WITH Linux-syscall-note 930
and resulted in the second patch in this series.
- if a file had some form of licensing information in it, and was one
of the */uapi/* ones, it was denoted with the Linux-syscall-note if
any GPL family license was found in the file or had no licensing in
it (per prior point). Results summary:
SPDX license identifier # files
---------------------------------------------------|------
GPL-2.0 WITH Linux-syscall-note 270
GPL-2.0+ WITH Linux-syscall-note 169
((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) 21
((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) 17
LGPL-2.1+ WITH Linux-syscall-note 15
GPL-1.0+ WITH Linux-syscall-note 14
((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause) 5
LGPL-2.0+ WITH Linux-syscall-note 4
LGPL-2.1 WITH Linux-syscall-note 3
((GPL-2.0 WITH Linux-syscall-note) OR MIT) 3
((GPL-2.0 WITH Linux-syscall-note) AND MIT) 1
and that resulted in the third patch in this series.
- when the two scanners agreed on the detected license(s), that became
the concluded license(s).
- when there was disagreement between the two scanners (one detected a
license but the other didn't, or they both detected different
licenses) a manual inspection of the file occurred.
- In most cases a manual inspection of the information in the file
resulted in a clear resolution of the license that should apply (and
which scanner probably needed to revisit its heuristics).
- When it was not immediately clear, the license identifier was
confirmed with lawyers working with the Linux Foundation.
- If there was any question as to the appropriate license identifier,
the file was flagged for further research and to be revisited later
in time.
In total, over 70 hours of logged manual review was done on the
spreadsheet to determine the SPDX license identifiers to apply to the
source files by Kate, Philippe, Thomas and, in some cases, confirmation
by lawyers working with the Linux Foundation.
Kate also obtained a third independent scan of the 4.13 code base from
FOSSology, and compared selected files where the other two scanners
disagreed against that SPDX file, to see if there was new insights. The
Windriver scanner is based on an older version of FOSSology in part, so
they are related.
Thomas did random spot checks in about 500 files from the spreadsheets
for the uapi headers and agreed with SPDX license identifier in the
files he inspected. For the non-uapi files Thomas did random spot checks
in about 15000 files.
In initial set of patches against 4.14-rc6, 3 files were found to have
copy/paste license identifier errors, and have been fixed to reflect the
correct identifier.
Additionally Philippe spent 10 hours this week doing a detailed manual
inspection and review of the 12,461 patched files from the initial patch
version early this week with:
- a full scancode scan run, collecting the matched texts, detected
license ids and scores
- reviewing anything where there was a license detected (about 500+
files) to ensure that the applied SPDX license was correct
- reviewing anything where there was no detection but the patch license
was not GPL-2.0 WITH Linux-syscall-note to ensure that the applied
SPDX license was correct
This produced a worksheet with 20 files needing minor correction. This
worksheet was then exported into 3 different .csv files for the
different types of files to be modified.
These .csv files were then reviewed by Greg. Thomas wrote a script to
parse the csv files and add the proper SPDX tag to the file, in the
format that the file expected. This script was further refined by Greg
based on the output to detect more types of files automatically and to
distinguish between header and source .c files (which need different
comment types.) Finally Greg ran the script using the .csv files to
generate the patches.
Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org>
Reviewed-by: Philippe Ombredanne <pombredanne@nexb.com>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-01 14:07:57 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
2008-10-15 19:50:22 +00:00
|
|
|
#include <linux/fs.h>
|
|
|
|
#include <linux/init.h>
|
|
|
|
#include <linux/kernel.h>
|
|
|
|
#include <linux/mm.h>
|
2013-11-14 22:31:02 +00:00
|
|
|
#include <linux/hugetlb.h>
|
2008-10-15 19:50:22 +00:00
|
|
|
#include <linux/mman.h>
|
|
|
|
#include <linux/mmzone.h>
|
|
|
|
#include <linux/proc_fs.h>
|
|
|
|
#include <linux/quicklist.h>
|
|
|
|
#include <linux/seq_file.h>
|
|
|
|
#include <linux/swap.h>
|
|
|
|
#include <linux/vmstat.h>
|
2011-07-26 23:09:06 +00:00
|
|
|
#include <linux/atomic.h>
|
2013-04-29 22:07:28 +00:00
|
|
|
#include <linux/vmalloc.h>
|
fs/proc/meminfo.c: include cma info in proc/meminfo
This patch include CMA info (CMATotal, CMAFree) in /proc/meminfo.
Currently, in a CMA enabled system, if somebody wants to know the total
CMA size declared, there is no way to tell, other than the dmesg or
/var/log/messages logs.
With this patch we are showing the CMA info as part of meminfo, so that it
can be determined at any point of time. This will be populated only when
CMA is enabled.
Below is the sample output from a ARM based device with RAM:512MB and CMA:16MB.
MemTotal: 471172 kB
MemFree: 111712 kB
MemAvailable: 271172 kB
.
.
.
CmaTotal: 16384 kB
CmaFree: 6144 kB
This patch also fix below checkpatch errors that were found during these changes.
ERROR: space required after that ',' (ctx:ExV)
199: FILE: fs/proc/meminfo.c:199:
+ ,atomic_long_read(&num_poisoned_pages) << (PAGE_SHIFT - 10)
^
ERROR: space required after that ',' (ctx:ExV)
202: FILE: fs/proc/meminfo.c:202:
+ ,K(global_page_state(NR_ANON_TRANSPARENT_HUGEPAGES) *
^
ERROR: space required after that ',' (ctx:ExV)
206: FILE: fs/proc/meminfo.c:206:
+ ,K(totalcma_pages)
^
total: 3 errors, 0 warnings, 2 checks, 236 lines checked
Signed-off-by: Pintu Kumar <pintu.k@samsung.com>
Signed-off-by: Vishnu Pratap Singh <vishnu.ps@samsung.com>
Acked-by: Michal Nazarewicz <mina86@mina86.com>
Cc: Rafael Aquini <aquini@redhat.com>
Cc: Jerome Marchand <jmarchan@redhat.com>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2014-12-19 00:17:18 +00:00
|
|
|
#ifdef CONFIG_CMA
|
|
|
|
#include <linux/cma.h>
|
|
|
|
#endif
|
2008-10-15 19:50:22 +00:00
|
|
|
#include <asm/page.h>
|
|
|
|
#include <asm/pgtable.h>
|
|
|
|
#include "internal.h"
|
|
|
|
|
|
|
|
void __attribute__((weak)) arch_report_meminfo(struct seq_file *m)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2016-10-08 00:02:23 +00:00
|
|
|
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;
|
|
|
|
|
|
|
|
len = num_to_str(v, sizeof(v), num << (PAGE_SHIFT - 10));
|
|
|
|
|
|
|
|
seq_write(m, s, 16);
|
|
|
|
|
|
|
|
if (len > 0) {
|
|
|
|
if (len < 8)
|
|
|
|
seq_write(m, blanks, 8 - len);
|
|
|
|
|
|
|
|
seq_write(m, v, len);
|
|
|
|
}
|
|
|
|
seq_write(m, " kB\n", 4);
|
|
|
|
}
|
|
|
|
|
2008-10-15 19:50:22 +00:00
|
|
|
static int meminfo_proc_show(struct seq_file *m, void *v)
|
|
|
|
{
|
|
|
|
struct sysinfo i;
|
|
|
|
unsigned long committed;
|
|
|
|
long cached;
|
/proc/meminfo: provide estimated available memory
Many load balancing and workload placing programs check /proc/meminfo to
estimate how much free memory is available. They generally do this by
adding up "free" and "cached", which was fine ten years ago, but is
pretty much guaranteed to be wrong today.
It is wrong because Cached includes memory that is not freeable as page
cache, for example shared memory segments, tmpfs, and ramfs, and it does
not include reclaimable slab memory, which can take up a large fraction
of system memory on mostly idle systems with lots of files.
Currently, the amount of memory that is available for a new workload,
without pushing the system into swap, can be estimated from MemFree,
Active(file), Inactive(file), and SReclaimable, as well as the "low"
watermarks from /proc/zoneinfo.
However, this may change in the future, and user space really should not
be expected to know kernel internals to come up with an estimate for the
amount of free memory.
It is more convenient to provide such an estimate in /proc/meminfo. If
things change in the future, we only have to change it in one place.
Signed-off-by: Rik van Riel <riel@redhat.com>
Reported-by: Erik Mouw <erik.mouw_2@nxp.com>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2014-01-21 23:49:05 +00:00
|
|
|
long available;
|
2008-10-15 19:50:22 +00:00
|
|
|
unsigned long pages[NR_LRU_LISTS];
|
|
|
|
int lru;
|
|
|
|
|
|
|
|
si_meminfo(&i);
|
|
|
|
si_swapinfo(&i);
|
2009-04-30 22:08:51 +00:00
|
|
|
committed = percpu_counter_read_positive(&vm_committed_as);
|
2008-10-15 19:50:22 +00:00
|
|
|
|
2016-07-28 22:46:20 +00:00
|
|
|
cached = global_node_page_state(NR_FILE_PAGES) -
|
2013-02-23 00:34:37 +00:00
|
|
|
total_swapcache_pages() - i.bufferram;
|
2008-10-15 19:50:22 +00:00
|
|
|
if (cached < 0)
|
|
|
|
cached = 0;
|
|
|
|
|
|
|
|
for (lru = LRU_BASE; lru < NR_LRU_LISTS; lru++)
|
2016-08-11 22:32:57 +00:00
|
|
|
pages[lru] = global_node_page_state(NR_LRU_BASE + lru);
|
2008-10-15 19:50:22 +00:00
|
|
|
|
2016-03-17 21:19:05 +00:00
|
|
|
available = si_mem_available();
|
/proc/meminfo: provide estimated available memory
Many load balancing and workload placing programs check /proc/meminfo to
estimate how much free memory is available. They generally do this by
adding up "free" and "cached", which was fine ten years ago, but is
pretty much guaranteed to be wrong today.
It is wrong because Cached includes memory that is not freeable as page
cache, for example shared memory segments, tmpfs, and ramfs, and it does
not include reclaimable slab memory, which can take up a large fraction
of system memory on mostly idle systems with lots of files.
Currently, the amount of memory that is available for a new workload,
without pushing the system into swap, can be estimated from MemFree,
Active(file), Inactive(file), and SReclaimable, as well as the "low"
watermarks from /proc/zoneinfo.
However, this may change in the future, and user space really should not
be expected to know kernel internals to come up with an estimate for the
amount of free memory.
It is more convenient to provide such an estimate in /proc/meminfo. If
things change in the future, we only have to change it in one place.
Signed-off-by: Rik van Riel <riel@redhat.com>
Reported-by: Erik Mouw <erik.mouw_2@nxp.com>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2014-01-21 23:49:05 +00:00
|
|
|
|
2016-10-08 00:02:23 +00:00
|
|
|
show_val_kb(m, "MemTotal: ", i.totalram);
|
|
|
|
show_val_kb(m, "MemFree: ", i.freeram);
|
|
|
|
show_val_kb(m, "MemAvailable: ", available);
|
|
|
|
show_val_kb(m, "Buffers: ", i.bufferram);
|
|
|
|
show_val_kb(m, "Cached: ", cached);
|
|
|
|
show_val_kb(m, "SwapCached: ", total_swapcache_pages());
|
|
|
|
show_val_kb(m, "Active: ", pages[LRU_ACTIVE_ANON] +
|
|
|
|
pages[LRU_ACTIVE_FILE]);
|
|
|
|
show_val_kb(m, "Inactive: ", pages[LRU_INACTIVE_ANON] +
|
|
|
|
pages[LRU_INACTIVE_FILE]);
|
|
|
|
show_val_kb(m, "Active(anon): ", pages[LRU_ACTIVE_ANON]);
|
|
|
|
show_val_kb(m, "Inactive(anon): ", pages[LRU_INACTIVE_ANON]);
|
|
|
|
show_val_kb(m, "Active(file): ", pages[LRU_ACTIVE_FILE]);
|
|
|
|
show_val_kb(m, "Inactive(file): ", pages[LRU_INACTIVE_FILE]);
|
|
|
|
show_val_kb(m, "Unevictable: ", pages[LRU_UNEVICTABLE]);
|
2017-09-06 23:23:36 +00:00
|
|
|
show_val_kb(m, "Mlocked: ", global_zone_page_state(NR_MLOCK));
|
2016-10-08 00:02:23 +00:00
|
|
|
|
2008-10-15 19:50:22 +00:00
|
|
|
#ifdef CONFIG_HIGHMEM
|
2016-10-08 00:02:23 +00:00
|
|
|
show_val_kb(m, "HighTotal: ", i.totalhigh);
|
|
|
|
show_val_kb(m, "HighFree: ", i.freehigh);
|
|
|
|
show_val_kb(m, "LowTotal: ", i.totalram - i.totalhigh);
|
|
|
|
show_val_kb(m, "LowFree: ", i.freeram - i.freehigh);
|
2009-01-08 12:04:47 +00:00
|
|
|
#endif
|
2016-10-08 00:02:23 +00:00
|
|
|
|
2009-01-08 12:04:47 +00:00
|
|
|
#ifndef CONFIG_MMU
|
2016-10-08 00:02:23 +00:00
|
|
|
show_val_kb(m, "MmapCopy: ",
|
|
|
|
(unsigned long)atomic_long_read(&mmap_pages_allocated));
|
2008-10-15 19:50:22 +00:00
|
|
|
#endif
|
2016-10-08 00:02:23 +00:00
|
|
|
|
|
|
|
show_val_kb(m, "SwapTotal: ", i.totalswap);
|
|
|
|
show_val_kb(m, "SwapFree: ", i.freeswap);
|
|
|
|
show_val_kb(m, "Dirty: ",
|
|
|
|
global_node_page_state(NR_FILE_DIRTY));
|
|
|
|
show_val_kb(m, "Writeback: ",
|
|
|
|
global_node_page_state(NR_WRITEBACK));
|
|
|
|
show_val_kb(m, "AnonPages: ",
|
|
|
|
global_node_page_state(NR_ANON_MAPPED));
|
|
|
|
show_val_kb(m, "Mapped: ",
|
|
|
|
global_node_page_state(NR_FILE_MAPPED));
|
|
|
|
show_val_kb(m, "Shmem: ", i.sharedram);
|
|
|
|
show_val_kb(m, "Slab: ",
|
2017-08-10 22:23:31 +00:00
|
|
|
global_node_page_state(NR_SLAB_RECLAIMABLE) +
|
|
|
|
global_node_page_state(NR_SLAB_UNRECLAIMABLE));
|
2016-10-08 00:02:23 +00:00
|
|
|
|
|
|
|
show_val_kb(m, "SReclaimable: ",
|
2017-08-10 22:23:31 +00:00
|
|
|
global_node_page_state(NR_SLAB_RECLAIMABLE));
|
2016-10-08 00:02:23 +00:00
|
|
|
show_val_kb(m, "SUnreclaim: ",
|
2017-08-10 22:23:31 +00:00
|
|
|
global_node_page_state(NR_SLAB_UNRECLAIMABLE));
|
2016-10-08 00:02:23 +00:00
|
|
|
seq_printf(m, "KernelStack: %8lu kB\n",
|
2017-09-06 23:23:36 +00:00
|
|
|
global_zone_page_state(NR_KERNEL_STACK_KB));
|
2016-10-08 00:02:23 +00:00
|
|
|
show_val_kb(m, "PageTables: ",
|
2017-09-06 23:23:36 +00:00
|
|
|
global_zone_page_state(NR_PAGETABLE));
|
2008-10-15 19:50:22 +00:00
|
|
|
#ifdef CONFIG_QUICKLIST
|
2016-10-08 00:02:23 +00:00
|
|
|
show_val_kb(m, "Quicklists: ", quicklist_total_size());
|
2008-10-15 19:50:22 +00:00
|
|
|
#endif
|
2016-10-08 00:02:23 +00:00
|
|
|
|
|
|
|
show_val_kb(m, "NFS_Unstable: ",
|
|
|
|
global_node_page_state(NR_UNSTABLE_NFS));
|
|
|
|
show_val_kb(m, "Bounce: ",
|
2017-09-06 23:23:36 +00:00
|
|
|
global_zone_page_state(NR_BOUNCE));
|
2016-10-08 00:02:23 +00:00
|
|
|
show_val_kb(m, "WritebackTmp: ",
|
|
|
|
global_node_page_state(NR_WRITEBACK_TEMP));
|
|
|
|
show_val_kb(m, "CommitLimit: ", vm_commit_limit());
|
|
|
|
show_val_kb(m, "Committed_AS: ", committed);
|
|
|
|
seq_printf(m, "VmallocTotal: %8lu kB\n",
|
|
|
|
(unsigned long)VMALLOC_TOTAL >> 10);
|
|
|
|
show_val_kb(m, "VmallocUsed: ", 0ul);
|
|
|
|
show_val_kb(m, "VmallocChunk: ", 0ul);
|
|
|
|
|
2009-09-16 09:50:15 +00:00
|
|
|
#ifdef CONFIG_MEMORY_FAILURE
|
2016-10-08 00:02:23 +00:00
|
|
|
seq_printf(m, "HardwareCorrupted: %5lu kB\n",
|
|
|
|
atomic_long_read(&num_poisoned_pages) << (PAGE_SHIFT - 10));
|
2011-01-13 23:46:58 +00:00
|
|
|
#endif
|
2016-10-08 00:02:23 +00:00
|
|
|
|
2011-01-13 23:46:58 +00:00
|
|
|
#ifdef CONFIG_TRANSPARENT_HUGEPAGE
|
2016-10-08 00:02:23 +00:00
|
|
|
show_val_kb(m, "AnonHugePages: ",
|
|
|
|
global_node_page_state(NR_ANON_THPS) * HPAGE_PMD_NR);
|
|
|
|
show_val_kb(m, "ShmemHugePages: ",
|
|
|
|
global_node_page_state(NR_SHMEM_THPS) * HPAGE_PMD_NR);
|
|
|
|
show_val_kb(m, "ShmemPmdMapped: ",
|
|
|
|
global_node_page_state(NR_SHMEM_PMDMAPPED) * HPAGE_PMD_NR);
|
fs/proc/meminfo.c: include cma info in proc/meminfo
This patch include CMA info (CMATotal, CMAFree) in /proc/meminfo.
Currently, in a CMA enabled system, if somebody wants to know the total
CMA size declared, there is no way to tell, other than the dmesg or
/var/log/messages logs.
With this patch we are showing the CMA info as part of meminfo, so that it
can be determined at any point of time. This will be populated only when
CMA is enabled.
Below is the sample output from a ARM based device with RAM:512MB and CMA:16MB.
MemTotal: 471172 kB
MemFree: 111712 kB
MemAvailable: 271172 kB
.
.
.
CmaTotal: 16384 kB
CmaFree: 6144 kB
This patch also fix below checkpatch errors that were found during these changes.
ERROR: space required after that ',' (ctx:ExV)
199: FILE: fs/proc/meminfo.c:199:
+ ,atomic_long_read(&num_poisoned_pages) << (PAGE_SHIFT - 10)
^
ERROR: space required after that ',' (ctx:ExV)
202: FILE: fs/proc/meminfo.c:202:
+ ,K(global_page_state(NR_ANON_TRANSPARENT_HUGEPAGES) *
^
ERROR: space required after that ',' (ctx:ExV)
206: FILE: fs/proc/meminfo.c:206:
+ ,K(totalcma_pages)
^
total: 3 errors, 0 warnings, 2 checks, 236 lines checked
Signed-off-by: Pintu Kumar <pintu.k@samsung.com>
Signed-off-by: Vishnu Pratap Singh <vishnu.ps@samsung.com>
Acked-by: Michal Nazarewicz <mina86@mina86.com>
Cc: Rafael Aquini <aquini@redhat.com>
Cc: Jerome Marchand <jmarchan@redhat.com>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2014-12-19 00:17:18 +00:00
|
|
|
#endif
|
2016-10-08 00:02:23 +00:00
|
|
|
|
fs/proc/meminfo.c: include cma info in proc/meminfo
This patch include CMA info (CMATotal, CMAFree) in /proc/meminfo.
Currently, in a CMA enabled system, if somebody wants to know the total
CMA size declared, there is no way to tell, other than the dmesg or
/var/log/messages logs.
With this patch we are showing the CMA info as part of meminfo, so that it
can be determined at any point of time. This will be populated only when
CMA is enabled.
Below is the sample output from a ARM based device with RAM:512MB and CMA:16MB.
MemTotal: 471172 kB
MemFree: 111712 kB
MemAvailable: 271172 kB
.
.
.
CmaTotal: 16384 kB
CmaFree: 6144 kB
This patch also fix below checkpatch errors that were found during these changes.
ERROR: space required after that ',' (ctx:ExV)
199: FILE: fs/proc/meminfo.c:199:
+ ,atomic_long_read(&num_poisoned_pages) << (PAGE_SHIFT - 10)
^
ERROR: space required after that ',' (ctx:ExV)
202: FILE: fs/proc/meminfo.c:202:
+ ,K(global_page_state(NR_ANON_TRANSPARENT_HUGEPAGES) *
^
ERROR: space required after that ',' (ctx:ExV)
206: FILE: fs/proc/meminfo.c:206:
+ ,K(totalcma_pages)
^
total: 3 errors, 0 warnings, 2 checks, 236 lines checked
Signed-off-by: Pintu Kumar <pintu.k@samsung.com>
Signed-off-by: Vishnu Pratap Singh <vishnu.ps@samsung.com>
Acked-by: Michal Nazarewicz <mina86@mina86.com>
Cc: Rafael Aquini <aquini@redhat.com>
Cc: Jerome Marchand <jmarchan@redhat.com>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2014-12-19 00:17:18 +00:00
|
|
|
#ifdef CONFIG_CMA
|
2016-10-08 00:02:23 +00:00
|
|
|
show_val_kb(m, "CmaTotal: ", totalcma_pages);
|
|
|
|
show_val_kb(m, "CmaFree: ",
|
2017-09-06 23:23:36 +00:00
|
|
|
global_zone_page_state(NR_FREE_CMA_PAGES));
|
2009-09-16 09:50:15 +00:00
|
|
|
#endif
|
2008-10-15 19:50:22 +00:00
|
|
|
|
|
|
|
hugetlb_report_meminfo(m);
|
|
|
|
|
|
|
|
arch_report_meminfo(m);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int meminfo_proc_open(struct inode *inode, struct file *file)
|
|
|
|
{
|
|
|
|
return single_open(file, meminfo_proc_show, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
static const struct file_operations meminfo_proc_fops = {
|
|
|
|
.open = meminfo_proc_open,
|
|
|
|
.read = seq_read,
|
|
|
|
.llseek = seq_lseek,
|
|
|
|
.release = single_release,
|
|
|
|
};
|
|
|
|
|
|
|
|
static int __init proc_meminfo_init(void)
|
|
|
|
{
|
|
|
|
proc_create("meminfo", 0, NULL, &meminfo_proc_fops);
|
|
|
|
return 0;
|
|
|
|
}
|
2014-01-23 23:55:45 +00:00
|
|
|
fs_initcall(proc_meminfo_init);
|