> On Aug. 25, 2016, 12:32 a.m., Kevin Klues wrote: > > src/slave/containerizer/docker.cpp, line 1555 > > <https://reviews.apache.org/r/50841/diff/6/?file=1480595#file1480595line1555> > > > > I wouldn't just blindly call this function here. It should be wrapped > > in some logic that makes sure it's OK to call it (i.e. checks to make sure > > that we have the nvidia->allocator component passed in). > > > > Again, you could have some logic above which saves a temporary `Future` > > that is set to `Nothing()` by default and is the result of calling > > `deallocateNvidiaGpu()` otherwise. > > Guangya Liu wrote: > The `deallocateNvidiaGpu` already have some checking for > `nvidiaGpuAllocator`, is this enough?
I don't think we want to call any `nvidia*` functions anywhere in the code without checks around them at the call site. For someone reading the code top to bottom it makes it look like we are *always* allocating / deallocating / etc. GPUs, which is cnfusing. The checks inside the function are to make sure that we don't accidentally call them somewhere without the proper check at the call site. - Kevin ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/50841/#review146726 ----------------------------------------------------------- On Aug. 22, 2016, 10:11 a.m., Yubo Li wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/50841/ > ----------------------------------------------------------- > > (Updated Aug. 22, 2016, 10:11 a.m.) > > > Review request for mesos, Benjamin Mahler, Guangya Liu, Kevin Klues, and > Rajat Phull. > > > Bugs: MESOS-5795 > https://issues.apache.org/jira/browse/MESOS-5795 > > > Repository: mesos > > > Description > ------- > > Added control logic to allocate/deallocate GPUs to GPU-related task > when the task is started/terminated. > > > Diffs > ----- > > src/slave/containerizer/docker.hpp f2a06065cf99fed934c2c1ffc47461ec8a97f50d > src/slave/containerizer/docker.cpp 5c1ee8e467d1c54c60b67dc5275ef71e1bb90723 > > Diff: https://reviews.apache.org/r/50841/diff/ > > > Testing > ------- > > make check > > > Thanks, > > Yubo Li > >
