Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1167182

Re: [RFC v4 PATCH 2/9] mm/hugetlb: expose hugetlb fault mutex for use by fallocate

From Mike Kravetz <mike.kravetz@oracle.com>
Newsgroups linux.kernel
Subject Re: [RFC v4 PATCH 2/9] mm/hugetlb: expose hugetlb fault mutex for use by fallocate
Date 2015-06-18 00:10 +0200
Message-ID <pCtGW-5ZF-37@gated-at.bofh.it> (permalink)
References <pAhTz-S7-3@gated-at.bofh.it> <pAhTA-S7-25@gated-at.bofh.it> <pAjsm-30O-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 06/11/2015 03:46 PM, Davidlohr Bueso wrote:
> On Thu, 2015-06-11 at 14:01 -0700, Mike Kravetz wrote:
>>   /* Forward declaration */
>>   static int hugetlb_acct_memory(struct hstate *h, long delta);
>> @@ -3324,7 +3324,8 @@ static u32 fault_mutex_hash(struct hstate *h, struct mm_struct *mm,
>>   	unsigned long key[2];
>>   	u32 hash;
>>
>> -	if (vma->vm_flags & VM_SHARED) {
>> +	/* !vma implies this was called from hugetlbfs fallocate code */
>> +	if (!vma || vma->vm_flags & VM_SHARED) {
>
> That !vma is icky, and really no need for it: hugetlbfs_fallocate(), for
> example, already passes [pseudo]vma->vm_flags with VM_SHARED, and you
> say it yourself in the comment. Do you see any reason why we cannot just
> keep the vma->vm_flags & VM_SHARED check?
>

Ah, I did not recall all the users of this code until I went to change
it. The other user is truncate_hugapages() which will now be used for
fallocate hole punch.  Truncate like fallocate is an inode operation
and there is no specific vma.  I can create a pseudo-vma here as well
just to pass the flag.  I guess that would at least be consistent with
the other user.

-- 
Mike Kravetz
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[RFC v4 PATCH 2/9] mm/hugetlb: expose hugetlb fault mutex for use by fallocate Mike Kravetz <mike.kravetz@oracle.com> - 2015-06-11 23:10 +0200
  Re: [RFC v4 PATCH 2/9] mm/hugetlb: expose hugetlb fault mutex for  use by fallocate Mike Kravetz <mike.kravetz@oracle.com> - 2015-06-18 00:10 +0200

csiph-web