Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 132645
b: refs/heads/master
c: 8d80ce8
h: refs/heads/master
i:
  132643: b8fc29e
v: v3
  • Loading branch information
Linus Torvalds committed Mar 26, 2009
1 parent 97a9588 commit 04749e4
Show file tree
Hide file tree
Showing 11 changed files with 71 additions and 34 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 703a3cd72817e99201cef84a8a7aecc60b2b3581
refs/heads/master: 8d80ce80e1d58ba9cd3e3972b112cccd6b4008f4
22 changes: 11 additions & 11 deletions trunk/arch/mips/include/asm/mipsregs.h
Original file line number Diff line number Diff line change
Expand Up @@ -1391,36 +1391,36 @@ static inline void tlb_write_random(void)
static inline unsigned int \
set_c0_##name(unsigned int set) \
{ \
unsigned int res; \
unsigned int res, new; \
\
res = read_c0_##name(); \
res |= set; \
write_c0_##name(res); \
new = res | set; \
write_c0_##name(new); \
\
return res; \
} \
\
static inline unsigned int \
clear_c0_##name(unsigned int clear) \
{ \
unsigned int res; \
unsigned int res, new; \
\
res = read_c0_##name(); \
res &= ~clear; \
write_c0_##name(res); \
new = res & ~clear; \
write_c0_##name(new); \
\
return res; \
} \
\
static inline unsigned int \
change_c0_##name(unsigned int change, unsigned int new) \
change_c0_##name(unsigned int change, unsigned int val) \
{ \
unsigned int res; \
unsigned int res, new; \
\
res = read_c0_##name(); \
res &= ~change; \
res |= (new & change); \
write_c0_##name(res); \
new = res & ~change; \
new |= (val & change); \
write_c0_##name(new); \
\
return res; \
}
Expand Down
1 change: 0 additions & 1 deletion trunk/arch/mips/kernel/linux32.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
#include <linux/module.h>
#include <linux/binfmts.h>
#include <linux/security.h>
#include <linux/syscalls.h>
#include <linux/compat.h>
#include <linux/vfs.h>
#include <linux/ipc.h>
Expand Down
12 changes: 7 additions & 5 deletions trunk/arch/mips/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -1520,7 +1520,9 @@ void __cpuinit per_cpu_trap_init(void)
#endif /* CONFIG_MIPS_MT_SMTC */

if (cpu_has_veic || cpu_has_vint) {
unsigned long sr = set_c0_status(ST0_BEV);
write_c0_ebase(ebase);
write_c0_status(sr);
/* Setting vector spacing enables EI/VI mode */
change_c0_intctl(0x3e0, VECTORSPACING);
}
Expand Down Expand Up @@ -1602,8 +1604,6 @@ void __cpuinit set_uncached_handler(unsigned long offset, void *addr,
#ifdef CONFIG_64BIT
unsigned long uncached_ebase = TO_UNCAC(ebase);
#endif
if (cpu_has_mips_r2)
uncached_ebase += (read_c0_ebase() & 0x3ffff000);

if (!addr)
panic(panic_null_cerr);
Expand Down Expand Up @@ -1635,9 +1635,11 @@ void __init trap_init(void)
return; /* Already done */
#endif

if (cpu_has_veic || cpu_has_vint)
ebase = (unsigned long) alloc_bootmem_low_pages(0x200 + VECTORSPACING*64);
else {
if (cpu_has_veic || cpu_has_vint) {
unsigned long size = 0x200 + VECTORSPACING*64;
ebase = (unsigned long)
__alloc_bootmem(size, 1 << fls(size), 0);
} else {
ebase = CAC_BASE;
if (cpu_has_mips_r2)
ebase += (read_c0_ebase() & 0x3ffff000);
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/mips/mm/c-r4k.c
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,7 @@ static void __cpuinit probe_pcache(void)
c->dcache.ways = 2;
c->dcache.waybit = 0;

c->options |= MIPS_CPU_CACHE_CDEX_P;
c->options |= MIPS_CPU_CACHE_CDEX_P | MIPS_CPU_PREFETCH;
break;

case CPU_TX49XX:
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/mips/mm/dma-default.c
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ void dma_unmap_page(struct device *dev, dma_addr_t dma_address, size_t size,
if (!plat_device_is_coherent(dev) && direction != DMA_TO_DEVICE) {
unsigned long addr;

addr = plat_dma_addr_to_phys(dma_address);
addr = dma_addr_to_virt(dma_address);
dma_cache_wback_inv(addr, size);
}

Expand Down
47 changes: 38 additions & 9 deletions trunk/fs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1300,6 +1300,40 @@ sector_t bmap(struct inode * inode, sector_t block)
}
EXPORT_SYMBOL(bmap);

/*
* With relative atime, only update atime if the previous atime is
* earlier than either the ctime or mtime or if at least a day has
* passed since the last atime update.
*/
static int relatime_need_update(struct vfsmount *mnt, struct inode *inode,
struct timespec now)
{

if (!(mnt->mnt_flags & MNT_RELATIME))
return 1;
/*
* Is mtime younger than atime? If yes, update atime:
*/
if (timespec_compare(&inode->i_mtime, &inode->i_atime) >= 0)
return 1;
/*
* Is ctime younger than atime? If yes, update atime:
*/
if (timespec_compare(&inode->i_ctime, &inode->i_atime) >= 0)
return 1;

/*
* Is the previous atime value older than a day? If yes,
* update atime:
*/
if ((long)(now.tv_sec - inode->i_atime.tv_sec) >= 24*60*60)
return 1;
/*
* Good, we can skip the atime update:
*/
return 0;
}

/**
* touch_atime - update the access time
* @mnt: mount the inode is accessed on
Expand Down Expand Up @@ -1327,17 +1361,12 @@ void touch_atime(struct vfsmount *mnt, struct dentry *dentry)
goto out;
if ((mnt->mnt_flags & MNT_NODIRATIME) && S_ISDIR(inode->i_mode))
goto out;
if (mnt->mnt_flags & MNT_RELATIME) {
/*
* With relative atime, only update atime if the previous
* atime is earlier than either the ctime or mtime.
*/
if (timespec_compare(&inode->i_mtime, &inode->i_atime) < 0 &&
timespec_compare(&inode->i_ctime, &inode->i_atime) < 0)
goto out;
}

now = current_fs_time(inode->i_sb);

if (!relatime_need_update(mnt, inode, now))
goto out;

if (timespec_equal(&inode->i_atime, &now))
goto out;

Expand Down
11 changes: 8 additions & 3 deletions trunk/fs/namespace.c
Original file line number Diff line number Diff line change
Expand Up @@ -780,6 +780,7 @@ static void show_mnt_opts(struct seq_file *m, struct vfsmount *mnt)
{ MNT_NOATIME, ",noatime" },
{ MNT_NODIRATIME, ",nodiratime" },
{ MNT_RELATIME, ",relatime" },
{ MNT_STRICTATIME, ",strictatime" },
{ 0, NULL }
};
const struct proc_fs_info *fs_infop;
Expand Down Expand Up @@ -1919,6 +1920,9 @@ long do_mount(char *dev_name, char *dir_name, char *type_page,
if (data_page)
((char *)data_page)[PAGE_SIZE - 1] = 0;

/* Default to relatime */
mnt_flags |= MNT_RELATIME;

/* Separate the per-mountpoint flags */
if (flags & MS_NOSUID)
mnt_flags |= MNT_NOSUID;
Expand All @@ -1930,13 +1934,14 @@ long do_mount(char *dev_name, char *dir_name, char *type_page,
mnt_flags |= MNT_NOATIME;
if (flags & MS_NODIRATIME)
mnt_flags |= MNT_NODIRATIME;
if (flags & MS_RELATIME)
mnt_flags |= MNT_RELATIME;
if (flags & MS_STRICTATIME)
mnt_flags &= ~(MNT_RELATIME | MNT_NOATIME);
if (flags & MS_RDONLY)
mnt_flags |= MNT_READONLY;

flags &= ~(MS_NOSUID | MS_NOEXEC | MS_NODEV | MS_ACTIVE |
MS_NOATIME | MS_NODIRATIME | MS_RELATIME| MS_KERNMOUNT);
MS_NOATIME | MS_NODIRATIME | MS_RELATIME| MS_KERNMOUNT |
MS_STRICTATIME);

/* ... and get the mountpoint */
retval = kern_path(dir_name, LOOKUP_FOLLOW, &path);
Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ struct inodes_stat_t {
#define MS_RELATIME (1<<21) /* Update atime relative to mtime/ctime. */
#define MS_KERNMOUNT (1<<22) /* this is a kern_mount call */
#define MS_I_VERSION (1<<23) /* Update inode I_version field */
#define MS_STRICTATIME (1<<24) /* Always perform atime updates */
#define MS_ACTIVE (1<<30)
#define MS_NOUSER (1<<31)

Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/mount.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ struct mnt_namespace;
#define MNT_NODIRATIME 0x10
#define MNT_RELATIME 0x20
#define MNT_READONLY 0x40 /* does the user want this to be r/o? */
#define MNT_STRICTATIME 0x80

#define MNT_SHRINKABLE 0x100
#define MNT_IMBALANCED_WRITE_COUNT 0x200 /* just for debugging */
Expand Down
4 changes: 2 additions & 2 deletions trunk/mm/page-writeback.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ static inline long sync_writeback_pages(void)
/*
* Start background writeback (via pdflush) at this percentage
*/
int dirty_background_ratio = 5;
int dirty_background_ratio = 10;

/*
* dirty_background_bytes starts at 0 (disabled) so that it is a function of
Expand All @@ -83,7 +83,7 @@ int vm_highmem_is_dirtyable;
/*
* The generator of dirty data starts writeback at this percentage
*/
int vm_dirty_ratio = 10;
int vm_dirty_ratio = 20;

/*
* vm_dirty_bytes starts at 0 (disabled) so that it is a function of
Expand Down

0 comments on commit 04749e4

Please sign in to comment.