mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Ulrich Drepper <drepper@redhat.com>
Cc: linux-kernel@vger.kernel.org, akpm@linux-foundation.org
Subject: Re: [PATCH] VMA comment fixes
Date: Sat, 16 Aug 2008 10:44:29 -0700 (PDT)	[thread overview]
Message-ID: <alpine.LFD.1.10.0808161033350.3324@nehalem.linux-foundation.org> (raw)
In-Reply-To: <200808160934.m7G9YgWs028953@hs20-bc2-1.build.redhat.com>



On Sat, 16 Aug 2008, Ulrich Drepper wrote:
>
> These seem to be two tiny problems in comments related to VMA data
> structures.  Am I correct?

No.

> diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
> -	unsigned long vm_flags;		/* Flags, listed below. */
> +	unsigned long vm_flags;		/* Flags, see vmalloc.h. */

It's "see mm.h" for the primary one. The vmalloc.h ones are only used for 
vmalloc'ed areas, no for regular _user_ mappings.

That said, I agree that it's damn confusing that we have two different 
sets of flags, both called VM_xyz. We use the "vm_area_struct" for the 
normal user virtual mappings (mmap) tracking, and we use the "vm_struct" 
for the kernel virtual mappings (vmalloc).

Both have a flags field, and both use VM_xyz for their field names.

> diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h
> -/* bits in vm_struct->flags */
> +/* bits in vm_area_struct->flags */

See above. The vmalloc ones really are in "vm_struct->flags".

The confusion comes at least partly because

 - I think historically we _used_ to use vm_area_struct for both, if I 
   recall correctly

and because

 - we actually have some mixing of the two (for example 
   "remap_vmalloc_range()" will remap a vmalloc mapping _into_ a user 
   mapping, so it takes a _user_ mapping (a "vm_area_struct") _and_ a 
   vmalloc address (internally using a "struct vm_struct") and copies from 
   one to the other.

it might be a good idea to call the vmalloc flags somethign else than 
VM_xyz. But I'm not sure it's worth the churn. I don't remember there 
having ever been any _actual_ confusion by the VM people who have to deal 
with both (because you really very seldom can confuse them).

		Linus

      parent reply	other threads:[~2008-08-16 17:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-16  9:34 Ulrich Drepper
2008-08-16 10:07 ` Hugh Dickins
2008-08-16 17:44 ` Linus Torvalds [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LFD.1.10.0808161033350.3324@nehalem.linux-foundation.org \
    --to=torvalds@linux-foundation.org \
    --cc=akpm@linux-foundation.org \
    --cc=drepper@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®