Re: Document about page and buffer cache.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



What is the difference between Page cache and Buffer cache?

in buffer.c, the following function create the buffer cache
(&alloc_page_buffer() as well):

struct buffer_head *alloc_buffer_head(gfp_t gfp_flags)
{
        struct buffer_head *ret = kmem_cache_alloc(bh_cachep,
                                set_migrateflags(gfp_flags, __GFP_RECLAIMABLE));
        if (ret) {
                INIT_LIST_HEAD(&ret->b_assoc_buffers);
                get_cpu_var(bh_accounting).nr++;
                recalc_bh_state();
                put_cpu_var(bh_accounting);
        }
        return ret;
}

In /proc/slabinfo it appeared as "buffer_head".

Tracing for the caller of alloc_buffer_head() and alloc_page_buffer(),
it seemed that it is only used for journalling: jbd2/jbd/gfs:

./jbd2/journal.c:
        new_bh = alloc_buffer_head(GFP_NOFS|__GFP_NOFAIL);

./gfs2/log.c:
        bh = alloc_buffer_head(GFP_NOFS | __GFP_NOFAIL);

./jbd/journal.c:
        new_bh = alloc_buffer_head(GFP_NOFS|__GFP_NOFAIL);

./ntfs/mft.c:
                bh = head = alloc_page_buffers(page, blocksize, 1);

./ntfs/aops.c:
                bh = head = alloc_page_buffers(page, bh_size, 1);

Don't really understand why it can't use page cache instead?

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux