)]}'
{
  "log": [
    {
      "commit": "60063497a95e716c9a689af3be2687d261f115b4",
      "tree": "6ce0d68db76982c53df46aee5f29f944ebf2c320",
      "parents": [
        "148817ba092f9f6edd35bad3c6c6b8e8f90fe2ed"
      ],
      "author": {
        "name": "Arun Sharma",
        "email": "asharma@fb.com",
        "time": "Tue Jul 26 16:09:06 2011 -0700"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@linux-foundation.org",
        "time": "Tue Jul 26 16:49:47 2011 -0700"
      },
      "message": "atomic: use \u003clinux/atomic.h\u003e\n\nThis allows us to move duplicated code in \u003casm/atomic.h\u003e\n(atomic_inc_not_zero() for now) to \u003clinux/atomic.h\u003e\n\nSigned-off-by: Arun Sharma \u003casharma@fb.com\u003e\nReviewed-by: Eric Dumazet \u003ceric.dumazet@gmail.com\u003e\nCc: Ingo Molnar \u003cmingo@elte.hu\u003e\nCc: David Miller \u003cdavem@davemloft.net\u003e\nCc: Eric Dumazet \u003ceric.dumazet@gmail.com\u003e\nAcked-by: Mike Frysinger \u003cvapier@gentoo.org\u003e\nSigned-off-by: Andrew Morton \u003cakpm@linux-foundation.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@linux-foundation.org\u003e\n"
    },
    {
      "commit": "2f7e33d432d097a2a7f467b031bf18be91cb3d49",
      "tree": "a1729a436b3c9921390e23cae35e5b837653dfe4",
      "parents": [
        "9b90f5135320bc74dc6c9a8c74d69fd4821d9282"
      ],
      "author": {
        "name": "Miao Xie",
        "email": "miaox@cn.fujitsu.com",
        "time": "Thu Jun 23 07:27:13 2011 +0000"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Mon Jun 27 11:34:27 2011 -0400"
      },
      "message": "btrfs: fix inconsonant inode information\n\nWhen iputting the inode, We may leave the delayed nodes if they have some\ndelayed items that have not been dealt with. So when the inode is read again,\nwe must look up the relative delayed node, and use the information in it to\ninitialize the inode. Or we will get inconsonant inode information, it may\ncause that the same directory index number is allocated again, and hit the\nfollowing oops:\n\n[ 5447.554187] err add delayed dir index item(name: pglog_0.965_0) into the\ninsertion tree of the delayed node(root id: 262, inode id: 258, errno: -17)\n[ 5447.569766] ------------[ cut here ]------------\n[ 5447.575361] kernel BUG at fs/btrfs/delayed-inode.c:1301!\n[SNIP]\n[ 5447.790721] Call Trace:\n[ 5447.793191]  [\u003cffffffffa0641c4e\u003e] btrfs_insert_dir_item+0x189/0x1bb [btrfs]\n[ 5447.800156]  [\u003cffffffffa0651a45\u003e] btrfs_add_link+0x12b/0x191 [btrfs]\n[ 5447.806517]  [\u003cffffffffa0651adc\u003e] btrfs_add_nondir+0x31/0x58 [btrfs]\n[ 5447.812876]  [\u003cffffffffa0651d6a\u003e] btrfs_create+0xf9/0x197 [btrfs]\n[ 5447.818961]  [\u003cffffffff8111f840\u003e] vfs_create+0x72/0x92\n[ 5447.824090]  [\u003cffffffff8111fa8c\u003e] do_last+0x22c/0x40b\n[ 5447.829133]  [\u003cffffffff8112076a\u003e] path_openat+0xc0/0x2ef\n[ 5447.834438]  [\u003cffffffff810c58e2\u003e] ? __perf_event_task_sched_out+0x24/0x44\n[ 5447.841216]  [\u003cffffffff8103ecdd\u003e] ? perf_event_task_sched_out+0x59/0x67\n[ 5447.847846]  [\u003cffffffff81121a79\u003e] do_filp_open+0x3d/0x87\n[ 5447.853156]  [\u003cffffffff811e126c\u003e] ? strncpy_from_user+0x43/0x4d\n[ 5447.859072]  [\u003cffffffff8111f1f5\u003e] ? getname_flags+0x2e/0x80\n[ 5447.864636]  [\u003cffffffff8111f179\u003e] ? do_getname+0x14b/0x173\n[ 5447.870112]  [\u003cffffffff8111f1b7\u003e] ? audit_getname+0x16/0x26\n[ 5447.875682]  [\u003cffffffff8112b1ab\u003e] ? spin_lock+0xe/0x10\n[ 5447.880882]  [\u003cffffffff81112d39\u003e] do_sys_open+0x69/0xae\n[ 5447.886153]  [\u003cffffffff81112db1\u003e] sys_open+0x20/0x22\n[ 5447.891114]  [\u003cffffffff813b9aab\u003e] system_call_fastpath+0x16/0x1b\n\nFix it by reusing the old delayed node.\n\nReported-by: Jim Schutt \u003cjaschut@sandia.gov\u003e\nSigned-off-by: Miao Xie \u003cmiaox@cn.fujitsu.com\u003e\nTested-by: Jim Schutt \u003cjaschut@sandia.gov\u003e\nSigned-off-by: Chris Mason \u003cchris.mason@oracle.com\u003e\n"
    },
    {
      "commit": "e999376f094162aa425ae749aa1df95ab928d010",
      "tree": "080d4a2a20d8d7e7ea8b36f63150827b970da715",
      "parents": [
        "35a30d7ce54e087d8025a725d4e5a2fdee723a9f"
      ],
      "author": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Fri Jun 17 16:14:09 2011 -0400"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Fri Jun 17 16:38:47 2011 -0400"
      },
      "message": "Btrfs: avoid delayed metadata items during commits\n\nSnapshot creation has two phases.  One is the initial snapshot setup,\nand the second is done during commit, while nobody is allowed to modify\nthe root we are snapshotting.\n\nThe delayed metadata insertion code can break that rule, it does a\ndelayed inode update on the inode of the parent of the snapshot,\nand delayed directory item insertion.\n\nThis makes sure to run the pending delayed operations before we\nrecord the snapshot root, which avoids corruptions.\n\nSigned-off-by: Chris Mason \u003cchris.mason@oracle.com\u003e\n"
    },
    {
      "commit": "19fd294957e426bfdd8e19085096467ec18df5c4",
      "tree": "47c3ee705ac9d591d2f9497d3dfc3d1426a881a2",
      "parents": [
        "9fe6a50fb764f508dd2de47a66e62e51388791fb"
      ],
      "author": {
        "name": "Miao Xie",
        "email": "miaox@cn.fujitsu.com",
        "time": "Wed Jun 15 10:47:30 2011 +0000"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Fri Jun 17 14:54:18 2011 -0400"
      },
      "message": "btrfs: fix wrong reservation when doing delayed inode operations\n\nWe have migrated the space for the delayed inode items from\ntrans_block_rsv to global_block_rsv, but we forgot to set trans-\u003eblock_rsv to\nglobal_block_rsv when we doing delayed inode operations, and the following Oops\nhappened:\n\n[ 9792.654889] ------------[ cut here ]------------\n[ 9792.654898] WARNING: at fs/btrfs/extent-tree.c:5681\nbtrfs_alloc_free_block+0xca/0x27c [btrfs]()\n[ 9792.654899] Hardware name: To Be Filled By O.E.M.\n[ 9792.654900] Modules linked in: btrfs zlib_deflate libcrc32c\nip6t_REJECT nf_conntrack_ipv6 nf_defrag_ipv6 ip6table_filter ip6_tables\narc4 rt61pci rt2x00pci rt2x00lib snd_hda_codec_hdmi mac80211\nsnd_hda_codec_realtek cfg80211 snd_hda_intel edac_core snd_seq rfkill\npcspkr serio_raw snd_hda_codec eeprom_93cx6 edac_mce_amd sp5100_tco\ni2c_piix4 k10temp snd_hwdep snd_seq_device snd_pcm floppy r8169 xhci_hcd\nmii snd_timer snd soundcore snd_page_alloc ipv6 firewire_ohci pata_acpi\nata_generic firewire_core pata_via crc_itu_t radeon ttm drm_kms_helper\ndrm i2c_algo_bit i2c_core [last unloaded: scsi_wait_scan]\n[ 9792.654919] Pid: 2762, comm: rm Tainted: G        W   2.6.39+ #1\n[ 9792.654920] Call Trace:\n[ 9792.654922]  [\u003cffffffff81053c4a\u003e] warn_slowpath_common+0x83/0x9b\n[ 9792.654925]  [\u003cffffffff81053c7c\u003e] warn_slowpath_null+0x1a/0x1c\n[ 9792.654933]  [\u003cffffffffa038e747\u003e] btrfs_alloc_free_block+0xca/0x27c [btrfs]\n[ 9792.654945]  [\u003cffffffffa03b8562\u003e] ? map_extent_buffer+0x6e/0xa8 [btrfs]\n[ 9792.654953]  [\u003cffffffffa038189b\u003e] __btrfs_cow_block+0xfc/0x30c [btrfs]\n[ 9792.654963]  [\u003cffffffffa0396aa6\u003e] ? btrfs_buffer_uptodate+0x47/0x58 [btrfs]\n[ 9792.654970]  [\u003cffffffffa0382e48\u003e] ? read_block_for_search+0x94/0x368 [btrfs]\n[ 9792.654978]  [\u003cffffffffa0381ba9\u003e] btrfs_cow_block+0xfe/0x146 [btrfs]\n[ 9792.654986]  [\u003cffffffffa03848b0\u003e] btrfs_search_slot+0x14d/0x4b6 [btrfs]\n[ 9792.654997]  [\u003cffffffffa03b8562\u003e] ? map_extent_buffer+0x6e/0xa8 [btrfs]\n[ 9792.655022]  [\u003cffffffffa03938e8\u003e] btrfs_lookup_inode+0x2f/0x8f [btrfs]\n[ 9792.655025]  [\u003cffffffff8147afac\u003e] ? _cond_resched+0xe/0x22\n[ 9792.655027]  [\u003cffffffff8147b892\u003e] ? mutex_lock+0x29/0x50\n[ 9792.655039]  [\u003cffffffffa03d41b1\u003e] btrfs_update_delayed_inode+0x72/0x137 [btrfs]\n[ 9792.655051]  [\u003cffffffffa03d4ea2\u003e] btrfs_run_delayed_items+0x90/0xdb [btrfs]\n[ 9792.655062]  [\u003cffffffffa039a69b\u003e] btrfs_commit_transaction+0x228/0x654 [btrfs]\n[ 9792.655064]  [\u003cffffffff8106e8da\u003e] ? remove_wait_queue+0x3a/0x3a\n[ 9792.655075]  [\u003cffffffffa03a2fa5\u003e] btrfs_evict_inode+0x14d/0x202 [btrfs]\n[ 9792.655077]  [\u003cffffffff81132bd6\u003e] evict+0x71/0x111\n[ 9792.655079]  [\u003cffffffff81132de0\u003e] iput+0x12a/0x132\n[ 9792.655081]  [\u003cffffffff8112aa3a\u003e] do_unlinkat+0x106/0x155\n[ 9792.655083]  [\u003cffffffff81127b83\u003e] ? path_put+0x1f/0x23\n[ 9792.655085]  [\u003cffffffff8109c53c\u003e] ? audit_syscall_entry+0x145/0x171\n[ 9792.655087]  [\u003cffffffff81128410\u003e] ? putname+0x34/0x36\n[ 9792.655090]  [\u003cffffffff8112b441\u003e] sys_unlinkat+0x29/0x2b\n[ 9792.655092]  [\u003cffffffff81482c42\u003e] system_call_fastpath+0x16/0x1b\n[ 9792.655093] ---[ end trace 02b696eb02b3f768 ]---\n\nThis patch fix it by setting the reservation of the transaction handle to the\ncorrect one.\n\nReported-by: Josef Bacik \u003cjosef@redhat.com\u003e\nSigned-off-by: Miao Xie \u003cmiaox@cn.fujitsu.com\u003e\nSigned-off-by: Chris Mason \u003cchris.mason@oracle.com\u003e\n"
    },
    {
      "commit": "16cdcec736cd214350cdb591bf1091f8beedefa0",
      "tree": "5598d4561660c4d7a1d4de8b3703d6dd3cc7f9e7",
      "parents": [
        "61c4f2c81c61f73549928dfd9f3e8f26aa36a8cf"
      ],
      "author": {
        "name": "Miao Xie",
        "email": "miaox@cn.fujitsu.com",
        "time": "Fri Apr 22 18:12:22 2011 +0800"
      },
      "committer": {
        "name": "Chris Mason",
        "email": "chris.mason@oracle.com",
        "time": "Sat May 21 09:30:56 2011 -0400"
      },
      "message": "btrfs: implement delayed inode items operation\n\nChangelog V5 -\u003e V6:\n- Fix oom when the memory load is high, by storing the delayed nodes into the\n  root\u0027s radix tree, and letting btrfs inodes go.\n\nChangelog V4 -\u003e V5:\n- Fix the race on adding the delayed node to the inode, which is spotted by\n  Chris Mason.\n- Merge Chris Mason\u0027s incremental patch into this patch.\n- Fix deadlock between readdir() and memory fault, which is reported by\n  Itaru Kitayama.\n\nChangelog V3 -\u003e V4:\n- Fix nested lock, which is reported by Itaru Kitayama, by updating space cache\n  inode in time.\n\nChangelog V2 -\u003e V3:\n- Fix the race between the delayed worker and the task which does delayed items\n  balance, which is reported by Tsutomu Itoh.\n- Modify the patch address David Sterba\u0027s comment.\n- Fix the bug of the cpu recursion spinlock, reported by Chris Mason\n\nChangelog V1 -\u003e V2:\n- break up the global rb-tree, use a list to manage the delayed nodes,\n  which is created for every directory and file, and used to manage the\n  delayed directory name index items and the delayed inode item.\n- introduce a worker to deal with the delayed nodes.\n\nCompare with Ext3/4, the performance of file creation and deletion on btrfs\nis very poor. the reason is that btrfs must do a lot of b+ tree insertions,\nsuch as inode item, directory name item, directory name index and so on.\n\nIf we can do some delayed b+ tree insertion or deletion, we can improve the\nperformance, so we made this patch which implemented delayed directory name\nindex insertion/deletion and delayed inode update.\n\nImplementation:\n- introduce a delayed root object into the filesystem, that use two lists to\n  manage the delayed nodes which are created for every file/directory.\n  One is used to manage all the delayed nodes that have delayed items. And the\n  other is used to manage the delayed nodes which is waiting to be dealt with\n  by the work thread.\n- Every delayed node has two rb-tree, one is used to manage the directory name\n  index which is going to be inserted into b+ tree, and the other is used to\n  manage the directory name index which is going to be deleted from b+ tree.\n- introduce a worker to deal with the delayed operation. This worker is used\n  to deal with the works of the delayed directory name index items insertion\n  and deletion and the delayed inode update.\n  When the delayed items is beyond the lower limit, we create works for some\n  delayed nodes and insert them into the work queue of the worker, and then\n  go back.\n  When the delayed items is beyond the upper bound, we create works for all\n  the delayed nodes that haven\u0027t been dealt with, and insert them into the work\n  queue of the worker, and then wait for that the untreated items is below some\n  threshold value.\n- When we want to insert a directory name index into b+ tree, we just add the\n  information into the delayed inserting rb-tree.\n  And then we check the number of the delayed items and do delayed items\n  balance. (The balance policy is above.)\n- When we want to delete a directory name index from the b+ tree, we search it\n  in the inserting rb-tree at first. If we look it up, just drop it. If not,\n  add the key of it into the delayed deleting rb-tree.\n  Similar to the delayed inserting rb-tree, we also check the number of the\n  delayed items and do delayed items balance.\n  (The same to inserting manipulation)\n- When we want to update the metadata of some inode, we cached the data of the\n  inode into the delayed node. the worker will flush it into the b+ tree after\n  dealing with the delayed insertion and deletion.\n- We will move the delayed node to the tail of the list after we access the\n  delayed node, By this way, we can cache more delayed items and merge more\n  inode updates.\n- If we want to commit transaction, we will deal with all the delayed node.\n- the delayed node will be freed when we free the btrfs inode.\n- Before we log the inode items, we commit all the directory name index items\n  and the delayed inode update.\n\nI did a quick test by the benchmark tool[1] and found we can improve the\nperformance of file creation by ~15%, and file deletion by ~20%.\n\nBefore applying this patch:\nCreate files:\n        Total files: 50000\n        Total time: 1.096108\n        Average time: 0.000022\nDelete files:\n        Total files: 50000\n        Total time: 1.510403\n        Average time: 0.000030\n\nAfter applying this patch:\nCreate files:\n        Total files: 50000\n        Total time: 0.932899\n        Average time: 0.000019\nDelete files:\n        Total files: 50000\n        Total time: 1.215732\n        Average time: 0.000024\n\n[1] http://marc.info/?l\u003dlinux-btrfs\u0026m\u003d128212635122920\u0026q\u003dp3\n\nMany thanks for Kitayama-san\u0027s help!\n\nSigned-off-by: Miao Xie \u003cmiaox@cn.fujitsu.com\u003e\nReviewed-by: David Sterba \u003cdave@jikos.cz\u003e\nTested-by: Tsutomu Itoh \u003ct-itoh@jp.fujitsu.com\u003e\nTested-by: Itaru Kitayama \u003ckitayama@cl.bb4u.ne.jp\u003e\nSigned-off-by: Chris Mason \u003cchris.mason@oracle.com\u003e\n"
    }
  ]
}
