hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alan Burlison (JIRA)" <j...@apache.org>
Subject [jira] [Assigned] (HDFS-9957) HDFS's use of mlock() is not portable
Date Mon, 14 Mar 2016 17:04:33 GMT

     [ https://issues.apache.org/jira/browse/HDFS-9957?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel

Alan Burlison reassigned HDFS-9957:

    Assignee: Alan Burlison

> HDFS's use of mlock() is not portable
> -------------------------------------
>                 Key: HDFS-9957
>                 URL: https://issues.apache.org/jira/browse/HDFS-9957
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>          Components: native
>    Affects Versions: 2.7.2
>         Environment: Any UNIX system other than Linux
>            Reporter: Alan Burlison
>            Assignee: Alan Burlison
> HDFS uses mlock() to lock in the memory used to back java.nio.Buffer. Unfortunately the
way it is done is not standards-compliant. As the Linux manpage for mlock() says:
> {quote}
>        Under Linux, mlock(), mlock2(), and munlock() automatically round
>        addr down to the nearest page boundary.  However, the POSIX.1
>        specification of mlock() and munlock() allows an implementation to
>        require that addr is page aligned, so portable applications should
>        ensure this.
> {quote}
> The HDFS code does not do any such alignment, nor is it true that the backing buffers
for java.nio.Buffer are necessarily page aligned. And even if the address was aligned by the
code, it would end up calling mlock() on other random JVM data structures that shared the
same page. That seems potentially dangerous.

This message was sent by Atlassian JIRA

View raw message