~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise-security

« back to all changes in this revision

Viewing changes to include/linux/mm.h

  • Committer: Package Import Robot
  • Author(s): Paolo Pisati, Paolo Pisati
  • Date: 2011-12-06 15:56:07 UTC
  • Revision ID: package-import@ubuntu.com-20111206155607-pcf44kv5fmhk564f
Tags: 3.2.0-1401.1
[ Paolo Pisati ]

* Rebased on top of Ubuntu-3.2.0-3.8
* Tilt-tracking @ ef2487af4bb15bdd0689631774b5a5e3a59f74e2
* Delete debian.ti-omap4/control, it shoudln't be tracked
* Fix architecture spelling (s/armel/armhf/)
* [Config] Update configs following 3.2 import
* [Config] Fix compilation: disable CODA and ARCH_OMAP3
* [Config] Fix compilation: disable Ethernet Faraday
* Update series to precise

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
#include <linux/range.h>
16
16
#include <linux/pfn.h>
17
17
#include <linux/bit_spinlock.h>
 
18
#include <linux/shrinker.h>
18
19
 
19
20
struct mempolicy;
20
21
struct anon_vma;
650
651
#define SECTIONS_MASK           ((1UL << SECTIONS_WIDTH) - 1)
651
652
#define ZONEID_MASK             ((1UL << ZONEID_SHIFT) - 1)
652
653
 
653
 
static inline enum zone_type page_zonenum(struct page *page)
 
654
static inline enum zone_type page_zonenum(const struct page *page)
654
655
{
655
656
        return (page->flags >> ZONES_PGSHIFT) & ZONES_MASK;
656
657
}
678
679
}
679
680
 
680
681
#ifdef NODE_NOT_IN_PAGE_FLAGS
681
 
extern int page_to_nid(struct page *page);
 
682
extern int page_to_nid(const struct page *page);
682
683
#else
683
 
static inline int page_to_nid(struct page *page)
 
684
static inline int page_to_nid(const struct page *page)
684
685
{
685
686
        return (page->flags >> NODES_PGSHIFT) & NODES_MASK;
686
687
}
687
688
#endif
688
689
 
689
 
static inline struct zone *page_zone(struct page *page)
 
690
static inline struct zone *page_zone(const struct page *page)
690
691
{
691
692
        return &NODE_DATA(page_to_nid(page))->node_zones[page_zonenum(page)];
692
693
}
698
699
        page->flags |= (section & SECTIONS_MASK) << SECTIONS_PGSHIFT;
699
700
}
700
701
 
701
 
static inline unsigned long page_to_section(struct page *page)
 
702
static inline unsigned long page_to_section(const struct page *page)
702
703
{
703
704
        return (page->flags >> SECTIONS_PGSHIFT) & SECTIONS_MASK;
704
705
}
731
732
 */
732
733
#include <linux/vmstat.h>
733
734
 
734
 
static __always_inline void *lowmem_page_address(struct page *page)
 
735
static __always_inline void *lowmem_page_address(const struct page *page)
735
736
{
736
737
        return __va(PFN_PHYS(page_to_pfn(page)));
737
738
}
750
751
#endif
751
752
 
752
753
#if defined(HASHED_PAGE_VIRTUAL)
753
 
void *page_address(struct page *page);
 
754
void *page_address(const struct page *page);
754
755
void set_page_address(struct page *page, void *virtual);
755
756
void page_address_init(void);
756
757
#endif
909
910
 * @pte_entry: if set, called for each non-empty PTE (4th-level) entry
910
911
 * @pte_hole: if set, called for each hole at all levels
911
912
 * @hugetlb_entry: if set, called for each hugetlb entry
 
913
 *                 *Caution*: The caller must hold mmap_sem() if @hugetlb_entry
 
914
 *                            is used.
912
915
 *
913
916
 * (see walk_page_range for more details)
914
917
 */
1130
1133
}
1131
1134
#endif
1132
1135
 
1133
 
/*
1134
 
 * This struct is used to pass information from page reclaim to the shrinkers.
1135
 
 * We consolidate the values for easier extention later.
1136
 
 */
1137
 
struct shrink_control {
1138
 
        gfp_t gfp_mask;
1139
 
 
1140
 
        /* How many slab objects shrinker() should scan and try to reclaim */
1141
 
        unsigned long nr_to_scan;
1142
 
};
1143
 
 
1144
 
/*
1145
 
 * A callback you can register to apply pressure to ageable caches.
1146
 
 *
1147
 
 * 'sc' is passed shrink_control which includes a count 'nr_to_scan'
1148
 
 * and a 'gfpmask'.  It should look through the least-recently-used
1149
 
 * 'nr_to_scan' entries and attempt to free them up.  It should return
1150
 
 * the number of objects which remain in the cache.  If it returns -1, it means
1151
 
 * it cannot do any scanning at this time (eg. there is a risk of deadlock).
1152
 
 *
1153
 
 * The 'gfpmask' refers to the allocation we are currently trying to
1154
 
 * fulfil.
1155
 
 *
1156
 
 * Note that 'shrink' will be passed nr_to_scan == 0 when the VM is
1157
 
 * querying the cache size, so a fastpath for that case is appropriate.
1158
 
 */
1159
 
struct shrinker {
1160
 
        int (*shrink)(struct shrinker *, struct shrink_control *sc);
1161
 
        int seeks;      /* seeks to recreate an obj */
1162
 
 
1163
 
        /* These are for internal use */
1164
 
        struct list_head list;
1165
 
        long nr;        /* objs pending delete */
1166
 
};
1167
 
#define DEFAULT_SEEKS 2 /* A good number if you don't know better. */
1168
 
extern void register_shrinker(struct shrinker *);
1169
 
extern void unregister_shrinker(struct shrinker *);
1170
 
 
1171
1136
int vma_wants_writenotify(struct vm_area_struct *vma);
1172
1137
 
1173
1138
extern pte_t *__get_locked_pte(struct mm_struct *mm, unsigned long addr,
1322
1287
                                        unsigned long end_pfn);
1323
1288
extern void remove_all_active_ranges(void);
1324
1289
void sort_node_map(void);
 
1290
unsigned long node_map_pfn_alignment(void);
1325
1291
unsigned long __absent_pages_in_range(int nid, unsigned long start_pfn,
1326
1292
                                                unsigned long end_pfn);
1327
1293
extern unsigned long absent_pages_in_range(unsigned long start_pfn,
1367
1333
extern void si_meminfo_node(struct sysinfo *val, int nid);
1368
1334
extern int after_bootmem;
1369
1335
 
1370
 
extern void warn_alloc_failed(gfp_t gfp_mask, int order, const char *fmt, ...);
 
1336
extern __printf(3, 4)
 
1337
void warn_alloc_failed(gfp_t gfp_mask, int order, const char *fmt, ...);
1371
1338
 
1372
1339
extern void setup_per_cpu_pageset(void);
1373
1340
 
1460
1427
 
1461
1428
extern unsigned long do_brk(unsigned long, unsigned long);
1462
1429
 
1463
 
/* filemap.c */
1464
 
extern unsigned long page_unuse(struct page *);
 
1430
/* truncate.c */
1465
1431
extern void truncate_inode_pages(struct address_space *, loff_t);
1466
1432
extern void truncate_inode_pages_range(struct address_space *,
1467
1433
                                       loff_t lstart, loff_t lend);
1648
1614
};
1649
1615
extern void memory_failure(unsigned long pfn, int trapno);
1650
1616
extern int __memory_failure(unsigned long pfn, int trapno, int flags);
 
1617
extern void memory_failure_queue(unsigned long pfn, int trapno, int flags);
1651
1618
extern int unpoison_memory(unsigned long pfn);
1652
1619
extern int sysctl_memory_failure_early_kill;
1653
1620
extern int sysctl_memory_failure_recovery;