Главная страница


ru.unix.bsd

 
 - RU.UNIX.BSD ------------------------------------------------------------------
 From : Eugene Grosbein                      2:5006/1       11 Aug 2007  18:03:42
 To : All
 Subject : softupdates на /
 -------------------------------------------------------------------------------- 
 
 Привет!
 
 Казалось бы, простой вопрос: как включить softupdates на /
 для 6.2-STABLE, если они там отключены? / это UFS2.
 
 Это, в частности, даёт ускорение make -j3 installworld на две минуты.
 А следующий патч учит make понимать TMPDIR и позволяет заставить
 make -j писать свои временные файлы на, скажем, md0, что даёт ускорение
 более чем на три минуты и повышает эффективность распараллеливания
 до 93.6% на dual core Pentium-D 2.8Ghz. Hа машинах с небыстрой дисковой
 подсистемой ускорение в абсолютном выражении должно быть ещё больше.
 
 - --- usr.bin/make/job.c.orig  2007-08-11 09:38:05.000000000 +0800
 +++ usr.bin/make/job.c 2007-08-11 09:52:43.000000000 +0800
 @@ -118,6 +118,7 @@
  #include <errno.h>
  #include <fcntl.h>
  #include <inttypes.h>
 +#include <limits.h>
  #include <string.h>
  #include <signal.h>
  #include <stdlib.h>
 @@ -141,7 +142,7 @@
  #include "util.h"
  #include "var.h"
  
 -#define  TMPPAT  "/tmp/makeXXXXXXXXXX"
 +#define  TMPPAT  "makeXXXXXXXXXX"
  
  #ifndef USE_KQUEUE
  /*
 @@ -240,7 +241,7 @@
        */
       struct {
        /* Name of file to which shell output was rerouted */
 -      char   of_outFile[sizeof(TMPPAT)];
 +      char   of_outFile[PATH_MAX];
  
        /*
         * Stream open to the output file. Used to funnel all
 @@ -1576,7 +1577,8 @@
    Boolean noExec;    /* Set true if we decide not to run the job */
    int tfd;    /* File descriptor for temp file */
    LstNode *ln;
 -  char   tfile[sizeof(TMPPAT)];
 +  char   tfile[PATH_MAX];
 +  char   *tdir;
  
    if (interrupted) {
       JobPassSig(interrupted);
 @@ -1617,6 +1619,9 @@
       cmdsOK = TRUE;
    }
  
 +  if ( (tdir = getenv("TMPDIR")) == NULL )
 +     tdir = "/tmp";
 +
    /*
     * If the -n flag wasn't given, we open up OUR (not the child's)
     * temporary file to stuff commands in it. The thing is rd/wr so we
 @@ -1632,7 +1637,7 @@
        DieHorribly();
       }
  
 -     strcpy(tfile, TMPPAT);
 +     snprintf(tfile, sizeof(tfile), "%s/%s", tdir, TMPPAT);
       if ((tfd = mkstemp(tfile)) == -1)
        Punt("Cannot create temp file: %s", strerror(errno));
       job->cmdFILE = fdopen(tfd, "w+");
 @@ -1811,7 +1816,7 @@
       } else {
        fprintf(stdout, "Remaking `%s'\n", gn->name);
        fflush(stdout);
 -      strcpy(job->outFile, TMPPAT);
 +      snprintf(job->outFile, sizeof(job->outFile), "%s/%s", tdir, TMPPAT);
        if ((job->outFd = mkstemp(job->outFile)) == -1)
           Punt("cannot create temp file: %s",
               strerror(errno));
 Eugene
 -- 
 For the Colonel's Lady an' Judy O'Grady
 Are sisters under their skins! 
 --- slrn/0.9.8.1 (FreeBSD)
  * Origin: Svyaz Service JSC (2:5006/1@fidonet)
 
 

Вернуться к списку тем, сортированных по: возрастание даты  уменьшение даты  тема  автор 

 Тема:    Автор:    Дата:  
 softupdates на /   Eugene Grosbein   11 Aug 2007 18:03:42 
 Re: softupdates на /   Kostik Belousov   11 Aug 2007 16:44:48 
 softupdates на /   Slawa Olhovchenkov   22 Aug 2007 12:13:56 
 softupdates на /   Alex Semenyaka   12 Aug 2007 18:50:02 
 Re: softupdates на /   Eugene Grosbein   12 Aug 2007 23:55:05 
 softupdates на /   Alex Semenyaka   12 Aug 2007 20:13:36 
 Re: softupdates на /   Eugene Grosbein   13 Aug 2007 09:28:08 
 softupdates на /   Alex Semenyaka   13 Aug 2007 10:38:22 
 Re: softupdates на /   Valentin Davydov   13 Aug 2007 14:45:23 
 softupdates на /   Alex Semenyaka   14 Aug 2007 00:05:00 
 Re: softupdates на /   Valentin Davydov   14 Aug 2007 22:41:44 
 softupdates на /   Alex Semenyaka   15 Aug 2007 02:13:40 
Архивное /ru.unix.bsd/260938f62e2ed.html, оценка 1 из 5, голосов 10
Яндекс.Метрика
Valid HTML 4.01 Transitional