On Wed, 5 Jun 2002, chas williams wrote:

> the attached patch 'fixes', in my opinion, in osi_alloc.  objects <=
> AFS_SMALLOCSIZ are alloced with kmalloc, other vmalloc.  if kmalloc
> fails it doesnt fail over to vmalloc.  TASK_RUNNING is set after
> schedule.  it doesnt drop the GLOCK.  i moved the allocator init
> later so that it doesnt need to toggle the semaphore just before
> going to linux_alloc.


but you have the "can call linux_alloc before linux_alloc_init" problem
now.

> @@ -287,21 +286,21 @@
>      void *new = NULL;
>      struct osi_linux_mem *lmem;
>  
> +    new = linux_alloc(asize); /* get a chunk of memory of size asize */
> +
> +    if (!new) {
> +     printf("afs_osi_Alloc: Can't vmalloc %d bytes.\n", asize);
> +     return new;
> +    }
> +
>      down(&afs_linux_alloc_sem);
>  
> -    if (allocator_init == 0) { /* allocator hasn't been initialized yet */
> +    /* allocator hasn't been initialized yet */
> +    if (allocator_init == 0) {
>       if (linux_alloc_init() == 0) {
>           goto error;
>        }
>       allocator_init = 1; /* initialization complete */
> -    }
> -
> -    up(&afs_linux_alloc_sem);
> -    new = linux_alloc(asize); /* get a chunk of memory of size asize */
> -    down(&afs_linux_alloc_sem);
> -    if (!new) {
> -     printf("afs_osi_Alloc: Can't vmalloc %d bytes.\n", asize);
> -     goto error;
>      }

_______________________________________________
OpenAFS-devel mailing list
[EMAIL PROTECTED]
https://lists.openafs.org/mailman/listinfo/openafs-devel

Reply via email to