Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
ea982d9f
Commit
ea982d9f
authored
Nov 11, 2013
by
Pekka Enberg
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'slab/struct-page' into slab/next
parents
d56791b3
7e007355
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
243 additions
and
365 deletions
+243
-365
include/linux/mm_types.h
include/linux/mm_types.h
+16
-8
include/linux/slab.h
include/linux/slab.h
+8
-1
include/linux/slab_def.h
include/linux/slab_def.h
+2
-2
mm/slab.c
mm/slab.c
+217
-354
No files found.
include/linux/mm_types.h
View file @
ea982d9f
...
@@ -42,18 +42,22 @@ struct page {
...
@@ -42,18 +42,22 @@ struct page {
/* First double word block */
/* First double word block */
unsigned
long
flags
;
/* Atomic flags, some possibly
unsigned
long
flags
;
/* Atomic flags, some possibly
* updated asynchronously */
* updated asynchronously */
struct
address_space
*
mapping
;
/* If low bit clear, points to
union
{
* inode address_space, or NULL.
struct
address_space
*
mapping
;
/* If low bit clear, points to
* If page mapped as anonymous
* inode address_space, or NULL.
* memory, low bit is set, and
* If page mapped as anonymous
* it points to anon_vma object:
* memory, low bit is set, and
* see PAGE_MAPPING_ANON below.
* it points to anon_vma object:
*/
* see PAGE_MAPPING_ANON below.
*/
void
*
s_mem
;
/* slab first object */
};
/* Second double word */
/* Second double word */
struct
{
struct
{
union
{
union
{
pgoff_t
index
;
/* Our offset within mapping. */
pgoff_t
index
;
/* Our offset within mapping. */
void
*
freelist
;
/* sl
ub/slo
b first free object */
void
*
freelist
;
/* sl
[aou]
b first free object */
bool
pfmemalloc
;
/* If set by the page allocator,
bool
pfmemalloc
;
/* If set by the page allocator,
* ALLOC_NO_WATERMARKS was set
* ALLOC_NO_WATERMARKS was set
* and the low watermark was not
* and the low watermark was not
...
@@ -109,6 +113,7 @@ struct page {
...
@@ -109,6 +113,7 @@ struct page {
};
};
atomic_t
_count
;
/* Usage count, see below. */
atomic_t
_count
;
/* Usage count, see below. */
};
};
unsigned
int
active
;
/* SLAB */
};
};
};
};
...
@@ -130,6 +135,9 @@ struct page {
...
@@ -130,6 +135,9 @@ struct page {
struct
list_head
list
;
/* slobs list of pages */
struct
list_head
list
;
/* slobs list of pages */
struct
slab
*
slab_page
;
/* slab fields */
struct
slab
*
slab_page
;
/* slab fields */
struct
rcu_head
rcu_head
;
/* Used by SLAB
* when destroying via RCU
*/
};
};
/* Remainder is not double word aligned */
/* Remainder is not double word aligned */
...
...
include/linux/slab.h
View file @
ea982d9f
...
@@ -51,7 +51,14 @@
...
@@ -51,7 +51,14 @@
* }
* }
* rcu_read_unlock();
* rcu_read_unlock();
*
*
* See also the comment on struct slab_rcu in mm/slab.c.
* This is useful if we need to approach a kernel structure obliquely,
* from its address obtained without the usual locking. We can lock
* the structure to stabilize it and check it's still at the given address,
* only if we can be sure that the memory has not been meanwhile reused
* for some other kind of object (which our subsystem's lock might corrupt).
*
* rcu_read_lock before reading the address, then rcu_read_unlock after
* taking the spinlock within the structure expected at that address.
*/
*/
#define SLAB_DESTROY_BY_RCU 0x00080000UL
/* Defer freeing slabs to RCU */
#define SLAB_DESTROY_BY_RCU 0x00080000UL
/* Defer freeing slabs to RCU */
#define SLAB_MEM_SPREAD 0x00100000UL
/* Spread some memory over cpuset */
#define SLAB_MEM_SPREAD 0x00100000UL
/* Spread some memory over cpuset */
...
...
include/linux/slab_def.h
View file @
ea982d9f
...
@@ -41,8 +41,8 @@ struct kmem_cache {
...
@@ -41,8 +41,8 @@ struct kmem_cache {
size_t
colour
;
/* cache colouring range */
size_t
colour
;
/* cache colouring range */
unsigned
int
colour_off
;
/* colour offset */
unsigned
int
colour_off
;
/* colour offset */
struct
kmem_cache
*
slabp
_cache
;
struct
kmem_cache
*
freelist
_cache
;
unsigned
int
slab
_size
;
unsigned
int
freelist
_size
;
/* constructor func */
/* constructor func */
void
(
*
ctor
)(
void
*
obj
);
void
(
*
ctor
)(
void
*
obj
);
...
...
mm/slab.c
View file @
ea982d9f
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment