Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 


Quelle  i915_gemfs.c   Sprache: C

 
// SPDX-License-Identifier: MIT
/*
 * Copyright © 2017 Intel Corporation
 */


#include <linux/fs.h>
#include <linux/mount.h>
#include <linux/fs_context.h>

#include "i915_drv.h"
#include "i915_gemfs.h"
#include "i915_utils.h"

static int add_param(struct fs_context *fc, const char *key, const char *val)
{
 return vfs_parse_fs_string(fc, key, val, strlen(val));
}

void i915_gemfs_init(struct drm_i915_private *i915)
{
 struct file_system_type *type;
 struct fs_context *fc;
 struct vfsmount *gemfs;
 int ret;

 /*
 * By creating our own shmemfs mountpoint, we can pass in
 * mount flags that better match our usecase.
 *
 * One example, although it is probably better with a per-file
 * control, is selecting huge page allocations ("huge=within_size").
 * However, we only do so on platforms which benefit from it, or to
 * offset the overhead of iommu lookups, where with latter it is a net
 * win even on platforms which would otherwise see some performance
 * regressions such a slow reads issue on Broadwell and Skylake.
 */


 if (GRAPHICS_VER(i915) < 11 && !i915_vtd_active(i915))
  return;

 if (!IS_ENABLED(CONFIG_TRANSPARENT_HUGEPAGE))
  goto err;

 type = get_fs_type("tmpfs");
 if (!type)
  goto err;

 fc = fs_context_for_mount(type, SB_KERNMOUNT);
 if (IS_ERR(fc))
  goto err;
 ret = add_param(fc, "source""tmpfs");
 if (!ret)
  ret = add_param(fc, "huge""within_size");
 if (!ret)
  gemfs = fc_mount_longterm(fc);
 put_fs_context(fc);
 if (ret)
  goto err;

 i915->mm.gemfs = gemfs;
 drm_info(&i915->drm, "Using Transparent Hugepages\n");
 return;

err:
 drm_notice(&i915->drm,
     "Transparent Hugepage support is recommended for optimal performance%s\n",
     GRAPHICS_VER(i915) >= 11 ? " on this platform!" :
           " when IOMMU is enabled!");
}

void i915_gemfs_fini(struct drm_i915_private *i915)
{
 kern_unmount(i915->mm.gemfs);
}

Messung V0.5
C=92 H=91 G=91

¤ Dauer der Verarbeitung: 0.1 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Software

     Produkte
     Quellcodebibliothek

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik

Monitoring

Montastic status badge