1/*
2 * Copyright (C) 2017 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16syntax = "proto2";
17
18option java_multiple_files = true;
19
20import "frameworks/base/core/proto/android/privacy.proto";
21
22package android.os;
23
24/*
25 *  /proc/pagetypeinfo exports free memory distributions.
26 *
27 *  For example, the order of a page ranges form 0 to 10.
28 *  An order-0 page is 4 KB in size and 4 KB aligned.
29 *  An order-1 page is 8 KB in size and 8 KB aligned.
30 *  An order-10 page is 4096 KB in size and 4096 aligned.
31 *  The memory has multiple zones, e.g. DMA zone, Normal zone
32 *  Each zone has 11 free area. Each free area corresponds to pages of the same order.
33 *  Each free area has 6 free list. Each corresponds to one migration type.
34 *  The six migration types are Unmovable, Reclaimable, Movable, Reserve, CMA, and Isolate.
35 *  Each zone has 11 * 6 = 66 free list.
36 *
37 *  Next tag: 5
38 */
39message PageTypeInfoProto {
40    option (android.msg_privacy).dest = DEST_AUTOMATIC;
41
42    optional int32 page_block_order = 1;
43
44    optional int32 pages_per_block = 2;
45
46    // Next tag: 5
47    message MigrateType {
48        option (android.msg_privacy).dest = DEST_AUTOMATIC;
49
50        optional int32 node = 1;
51
52        // Memory zone.
53        optional string zone = 2;
54
55        // Migration type (Unmovable, Reclaimable, Movable, Reserve, CMA, and
56        // Isolate).
57        optional string type = 3;
58
59        // order level starts from 0 for 4KB to page_block_order defined above, e.g. 10 for 4096KB
60        repeated int32 free_pages_count = 4;
61    }
62    repeated MigrateType migrate_types = 3;
63
64    // Next tag: 10
65    message Block {
66        option (android.msg_privacy).dest = DEST_AUTOMATIC;
67
68        optional int32 node = 1;
69
70        // Memory zone.
71        optional string zone = 2;
72
73        optional int32 unmovable = 3;
74
75        optional int32 reclaimable = 4;
76
77        optional int32 movable = 5;
78
79        optional int32 cma = 6;
80
81        optional int32 reserve = 7;
82
83        optional int32 isolate = 8;
84
85        optional int32 highatomic = 9;
86    }
87    repeated Block blocks = 4;
88}
89